DartBridgeToolCalling class

Tool calling bridge for C++ interop.

*** ALL PARSING LOGIC IS IN C++ - NO DART FALLBACKS ***

Provides access to C++ tool calling functions:

  • Parse <tool_call> tags from LLM output
  • Format tools for system prompt
  • Build initial and follow-up prompts
  • Normalize JSON (fix unquoted keys)

Properties

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

Methods

buildFollowupPrompt({required String originalPrompt, String? toolsPrompt, required String toolName, required String toolResultJson, bool keepToolsAvailable = false}) String
Build follow-up prompt after tool execution using C++ implementation.
buildInitialPrompt(String userPrompt, String toolsJson, {String? optionsJson}) String
Build initial prompt with tools and user query using C++ implementation.
formatToolsPrompt(String toolsJson) String
Format tool definitions into a system prompt using C++ implementation (uses default format).
formatToolsPromptWithFormat(String toolsJson, String formatName) String
Format tool definitions into a system prompt using C++ implementation with a specific format.
normalizeJson(String jsonStr) String
Normalize JSON by adding quotes around unquoted keys using C++ implementation.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
parseToolCall(String llmOutput) ToolCallParseResult
Parse LLM output for tool calls using C++ implementation.
toString() String
A string representation of this object.
inherited

Operators

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

Static Properties

shared DartBridgeToolCalling
Shared instance
final