import { ToolCallEngine, Tool, PrepareRequestContext, ChatCompletionCreateParams, ChatCompletionChunk, MultimodalToolCallResult, AgentSingleLoopReponse, ChatCompletionMessageParam, ParsedModelResponse, StreamProcessingState, StreamChunkResult } from '@multimodal/agent-interface'; /** * StructuredOutputsToolCallEngine - Uses structured outputs (JSON Schema) for tool calls * * This approach instructs the model to return a structured JSON response * with tool call information, avoiding the need to parse * tool call markers from text content. */ export declare class StructuredOutputsToolCallEngine implements ToolCallEngine { private logger; /** * Prepare the system prompt with tool definitions * * @param basePrompt The base system prompt * @param tools Available tools for the agent * @returns Enhanced system prompt with tool information */ preparePrompt(basePrompt: string, tools: Tool[]): string; /** * Prepare the request parameters for the LLM call * * @param context The request context * @returns ChatCompletionCreateParams with structured outputs configuration */ prepareRequest(context: PrepareRequestContext): ChatCompletionCreateParams; /** * Initialize stream processing state for structured outputs * Adding lastExtractedContent to track what's been extracted from JSON for incremental updates */ initStreamProcessingState(): StreamProcessingState; /** * Process a streaming chunk for structured outputs * Improved to properly handle incremental JSON content extraction */ processStreamingChunk(chunk: ChatCompletionChunk, state: StreamProcessingState): StreamChunkResult; /** * Finalize the stream processing and extract the final response */ finalizeStreamProcessing(state: StreamProcessingState): ParsedModelResponse; /** * Check if the text might be in the process of building a JSON object */ private mightBeCollectingJson; /** * Build a historical assistant message for conversation history * * For structured outputs, we maintain the original content without tool_calls * to ensure compatibility with our JSON schema approach. * * @param response The agent's response * @returns Formatted message parameter for conversation history */ buildHistoricalAssistantMessage(response: AgentSingleLoopReponse): ChatCompletionMessageParam; /** * Build historical tool call result messages for conversation history * * For structured outputs engine, we format results as user messages * to maintain consistency with our JSON schema approach. * * @param results The tool call results * @returns Array of formatted message parameters */ buildHistoricalToolCallResultMessages(results: MultimodalToolCallResult[]): ChatCompletionMessageParam[]; } //# sourceMappingURL=StructuredOutputsToolCallEngine.d.ts.map