EnhancedChatCapability class abstract

Enhanced chat capability with advanced tool and output control

This extends the basic ChatCapability with advanced features like:

  • Tool choice strategies (auto, required, specific tool, none)
  • Structured output formats (JSON schema, etc.)
  • Advanced streaming with tool choice support

When to use:

  • When you need precise control over tool selection
  • When you need structured/typed responses
  • When working with providers that support advanced tool features

API References:

Inheritance

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

chat(List<ChatMessage> messages) Future<ChatResponse>
Sends a chat request to the provider with a sequence of messages.
inherited
chatStream(List<ChatMessage> messages, {List<Tool>? tools}) Stream<ChatStreamEvent>
Sends a streaming chat request to the provider
inherited
chatStreamWithAdvancedTools(List<ChatMessage> messages, {List<Tool>? tools, ToolChoice? toolChoice, StructuredOutputFormat? structuredOutput}) Stream<ChatStreamEvent>
Sends a streaming chat request with advanced tool and output configuration
chatWithAdvancedTools(List<ChatMessage> messages, {List<Tool>? tools, ToolChoice? toolChoice, StructuredOutputFormat? structuredOutput}) Future<ChatResponse>
Sends a chat request with advanced tool and output configuration
chatWithTools(List<ChatMessage> messages, List<Tool>? tools) Future<ChatResponse>
Sends a chat request to the provider with a sequence of messages and tools.
inherited
memoryContents() Future<List<ChatMessage>?>
Get current memory contents if provider supports memory
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
summarizeHistory(List<ChatMessage> messages) Future<String>
Summarizes a conversation history into a concise 2-3 sentence summary
inherited
toString() String
A string representation of this object.
inherited

Operators

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