prompt method

Future<String> prompt(
  1. String prompt, {
  2. String? system,
  3. double? temperature,
  4. int? maxOutputTokens,
  5. AgenticContext? context,
})

Answers a single prompt and returns the text.

The shortest useful call in the framework, for the many cases that are not a conversation.

Implementation

Future<String> prompt(
  String prompt, {
  String? system,
  double? temperature,
  int? maxOutputTokens,
  AgenticContext? context,
}) async {
  final response = await generate(
    ChatRequest.prompt(
      prompt,
      system: system,
      temperature: temperature,
      maxOutputTokens: maxOutputTokens,
    ),
    context: context,
  );
  response.ensureComplete();
  return response.text;
}