VanturaAgent class

Agent that interacts with the Vantura API and uses tools.

Manages conversation memory, executes tool calls, and handles API responses.

Constructors

VanturaAgent({required String instructions, required VanturaMemory memory, required List<VanturaTool> tools, required VanturaClient client, required VanturaState state, String name = 'default_agent', String description = 'General assistant agent', void onToolError(String toolName, String error, StackTrace? stackTrace)?, void onAgentFailure(String error, StackTrace? stackTrace)?, void onWarning(String warning)?})
Creates an VanturaAgent with the specified components.

Properties

client VanturaClient
Client for API communication.
final
description String
Clear description of what this agent does, for routing decisions.
final
hashCode int
The hash code for this object.
no setterinherited
instructions String
System instructions for the agent.
final
memory VanturaMemory
Memory storage for conversation history.
final
name String
Internal name for identifying this agent in multi-agent routing.
final
onAgentFailure → void Function(String error, StackTrace? stackTrace)?
Callback when the overall agent execution fails.
final
onToolError → void Function(String toolName, String error, StackTrace? stackTrace)?
Callback when a tool execution fails.
final
onWarning → void Function(String warning)?
Callback for non-fatal warnings during execution.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
state VanturaState
State manager for UI synchronization.
final
tools List<VanturaTool>
List of available tools.
final

Methods

addTool(VanturaTool tool) → void
Adds a tool dynamically at runtime (e.g. injected by AgentCoordinator).
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
run(String prompt, {CancellationToken? cancellationToken}) Future<VanturaResponse>
Runs the agent with the given prompt. You can optionally pass a cancellationToken to stop the generation early.
runStreaming(String prompt, {CancellationToken? cancellationToken}) Stream<VanturaResponse>
Runs the agent with the given prompt and streams the response. You can optionally pass a cancellationToken to stop the generation early.
toString() String
A string representation of this object.
inherited

Operators

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