DartBridgeToolCalling class
Thin C ABI bridge for tool-calling parse / format / validate and the session state machine.
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
-
cancelSession(
int sessionHandle) → bool - Cancel an in-flight session. Safe to call from any isolate; the native side latches the cancel and asks the in-flight LifecycleLlmRef to abort. Idempotent for unknown handles. Returns false when the native cancellation call fails.
-
createSession(
ToolCallingSessionCreateRequest request) → ToolCallingSessionHandle -
Create a tool-calling session that runs entirely in a dedicated worker
isolate, so the inline llama.cpp generation loop (create + every step)
never blocks the calling isolate. Events are copied SYNCHRONOUSLY inside a
worker-owned
NativeCallable.isolateLocal(commons' dispatcher hands out a stack-local buffer valid only for the call — see tool_calling_session.cppdispatch_pending) and forwarded to this isolate over a port, where they are decoded onto the returned broadcast stream. Tool results are sent back to the worker via ToolCallingSessionHandle.stepWithResult; cancellation uses the thread-saferac_tool_calling_session_cancel_protodirectly. -
destroySession(
int sessionHandle) → void - Teardown a session handle (called by the session worker, not directly).
-
formatPrompt(
ToolPromptFormatRequest request) → ToolPromptFormatResult - Format a tools-aware prompt via commons.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
parse(
ToolParseRequest request) → ToolParseResult - Parse LLM output bytes via commons.
-
toolValueFromJson(
String json) → ToolValue -
Parse a JSON string back into a ToolValue. Recursive walk lives in
commons (
rac_tool_value_from_json_proto); Dart only marshals bytes. -
toolValueToJson(
ToolValue value) → String -
Serialize a ToolValue to its canonical JSON string. Recursive walk
lives in commons (
rac_tool_value_to_json_proto); Dart only marshals bytes. -
toString(
) → String -
A string representation of this object.
inherited
-
validate(
ToolCallValidationRequest request) → ToolCallValidationResult - Validate a parsed tool call via commons.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
-
final