ConversationEngine class
Core conversation engine — manages the agentic loop.
Constructors
- ConversationEngine({required ApiProvider provider, required ToolRegistry toolRegistry, required PermissionChecker permissionChecker, required ConversationConfig config})
Properties
-
events
→ Stream<
ConversationEvent> -
Event stream for UI updates.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
-
messages
→ List<
Map< String, dynamic> > -
Raw message history (for serialization).
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- state → ConversationState
-
Current state.
no setter
- totalCost → double
-
Get total cost.
no setter
- totalInputTokens → int
-
Total token usage.
no setter
- totalOutputTokens → int
-
no setter
-
turns
→ List<
ConversationTurn> -
All turns so far.
no setter
Methods
-
cancel(
) → void - Cancel the current operation.
-
clear(
) → void - Clear conversation history.
-
compact(
String summary) → Future< void> - Compact conversation (replace old messages with summary).
-
dispose(
) → void - Dispose resources.
-
loadMessages(
List< Map< messages) → voidString, dynamic> > - Load previous messages (for session restore).
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
sendMessage(
String text, {List< Map< ? attachments}) → Future<String, dynamic> >ConversationTurn> - Send a user message and run the agentic loop.
-
toString(
) → String -
A string representation of this object.
inherited
-
updateConfig(
ConversationConfig config) → void - Update configuration.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited