import { ToolCallEngine, Tool, ToolCallEnginePrepareRequestContext, ChatCompletionCreateParams, ChatCompletionAssistantMessageParam, ChatCompletionChunk, MultimodalToolCallResult, AgentEventStream, ChatCompletionMessageParam, ParsedModelResponse, StreamProcessingState, StreamChunkResult } from '@ui-tars-test/tarko-agent-interface'; import { CustomActionParser } from '@ui-tars-test/shared/types'; /** * GUIAgentToolCallEngine - Minimal prompt engineering tool call engine * * This is the simplest possible implementation of a tool call engine that: * 1. Uses prompt engineering to instruct the LLM to output tool calls in a specific format * 2. Parses tool calls from LLM response text using simple regex matching * 3. Does not support streaming (focuses on core functionality only) * * Format used: {"name": "tool_name", "arguments": {...}} */ export declare class GUIAgentToolCallEngine extends ToolCallEngine { private customActionParser?; constructor(customActionParser?: CustomActionParser); /** * Prepare system prompt with tool information and instructions */ preparePrompt(instructions: string, tools: Tool[]): string; /** * Prepare request parameters for the LLM * * FIXME: move to base tool call engine. */ prepareRequest(context: ToolCallEnginePrepareRequestContext): ChatCompletionCreateParams; /** * Initialize processing state (minimal implementation) * * FIXME: move to base tool call engine. */ initStreamProcessingState(): StreamProcessingState; /** * Process streaming chunks - simply accumulate content * * FIXME: make it optional */ processStreamingChunk(chunk: ChatCompletionChunk, state: StreamProcessingState): StreamChunkResult; /** * Generate a tool call ID */ private generateToolCallId; /** * Extract tool calls from complete response text */ finalizeStreamProcessing(state: StreamProcessingState): ParsedModelResponse; /** * Build assistant message for conversation history * For PE engines, we preserve the raw content including tool call markup * * FIXME: move to base tool call engine. */ buildHistoricalAssistantMessage(currentLoopAssistantEvent: AgentEventStream.AssistantMessageEvent): ChatCompletionAssistantMessageParam; /** * Build tool result messages as user messages * PE engines format tool results as user input for next iteration * * FIXME: move to base tool call engine. */ buildHistoricalToolCallResultMessages(toolCallResults: MultimodalToolCallResult[]): ChatCompletionMessageParam[]; } //# sourceMappingURL=ToolCallEngine.d.ts.map