call method

Future<String> call(
  1. String prompt, {
  2. Options? options,
})

Runs the LLM on the given String prompt and returns a String with the generated text.

  • prompt The prompt to pass into the model.
  • options Generation options to pass into the LLM.

Example:

final result = await openai('Tell me a joke.');

Implementation

Future<String> call(
  final String prompt, {
  final Options? options,
}) async {
  final result = await invoke(PromptValue.string(prompt), options: options);
  return result.output;
}