BaseAgent class abstract

Shared Genkit wrapper used by the stage-specific agents.

Implementers

Constructors

BaseAgent({required ModelRef model, required GenkitPlugin plugin, required void onMessage(ToolStatus), required ToolRuntime runtime, required String? systemPrompt, required int maxTurns})
Creates an agent configured with the provided model and plugin.

Properties

ai ↔ Genkit
The configured Genkit instance used to fulfill model requests.
latefinal
hashCode int
The hash code for this object.
no setterinherited
maxTurns int
The maximum number of turns to allow in a conversation.
final
model → ModelRef
The model name used for requests.
final
onMessage → void Function(ToolStatus)
The callback function to handle tool messages.
final
plugin → GenkitPlugin
The plugin used to fulfill model requests.
final
runtime ToolRuntime
Shared runtime for stateful tools.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stageInstructions String
Instructions prepended to the user-provided system prompt.
no setter
systemPrompt String?
The system prompt to use for the agent.
final
tools List<Tool>
The tool definitions exposed to the model during generation.
latefinal

Methods

buildTools() List<Tool>
Builds the list of tools exposed to this agent.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
query(String prompt, {List<Message>? messages}) Future<GenerateResponseHelper>
Sends prompt to the model and returns the generated text response.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited