data/engine/conversation_engine library
Classes
- ConversationConfig
- Configuration for the conversation engine.
- ConversationEngine
- Core conversation engine — manages the agentic loop.
- ConversationError
- ConversationEvent
- Events emitted during conversation processing.
- ConversationTurn
- Turn in a conversation.
- PermissionNeeded
- StateChanged
- StreamingText
- StreamingThinking
- TokenUsageUpdated
- ToolExecution
- Record of a tool execution within a turn.
- ToolExecutionCompleted
- ToolExecutionStarted
- ToolUseRequested
- TurnCompleted
Enums
- ConversationState
- Conversation state.
- PermissionDecision
- Permission decision from user.
Functions
-
buildSystemPromptWithContext(
{required String basePrompt, String? memoryContent, String? projectInfo, List< String> ? activeTools, bool planMode = false}) → String - Build a system prompt with context.
-
executeToolSafe(
Tool tool, Map< String, dynamic> input, {Duration timeout = const Duration(minutes: 2)}) → Future<ToolResult> - Execute a tool with timeout and error handling.
-
formatToolResult(
ToolExecution execution) → String - Format a tool result for display.
-
hasExceededTurnLimit(
int turns, int maxTurns) → bool - Check if we've exceeded the turn limit.
-
isNaturalStop(
String stopReason) → bool - Check if a stop reason indicates natural completion.
-
isToolUseStop(
String stopReason) → bool - Check if a stop reason indicates the model wants to use tools.
Typedefs
-
PermissionChecker
= Future<
PermissionDecision> Function(String toolName, Map<String, dynamic> input, String? description) - Permission checker callback.