import type { GenerationOptions } from './client-config.interface'; /** Normalized usage metrics across providers. */ export interface UsageMetrics { inputTokens: number; outputTokens: number; totalTokens: number; } /** * Input parameters for askWithTools() — provider-agnostic. * telbany's buildResponseConfig produces the instructions/tools fields. */ export interface AskWithToolsParams { /** App-level thread identifier (Thread.thread_id in MongoDB). */ threadKey: string; /** Chatbot ID — passed to the tool handler for context resolution. */ chatbotId: string; /** Organization ID — passed to tool handler for notifications. */ organizationId?: string; /** The user's question / message text. */ userQuestion: string; /** Pre-assembled system instructions (from buildResponseConfig or equivalent). */ instructions: string; /** Pre-assembled tool definitions for this chatbot. */ tools?: unknown[]; /** Vector store IDs for file_search (OpenAI only). */ vectorStoreIds?: string[]; /** AI model override for this call. Falls back to ClientConfig.model. */ model?: string; /** Media URLs attached by the user (images, files). */ mediaUrl?: string[]; /** * Chain this user turn from a prior response (after tool-output heal/submit). * Uses previous_response_id instead of conversation — required to unblock stuck threads. */ chainFromResponseId?: string; /** Per-call generation override — wins over client-level defaults. */ generation?: GenerationOptions; } /** Returned when the AI produced a plain text answer. */ export interface TextResult { kind: 'text'; outputText: string; responseId: string; usage: UsageMetrics | null; model: string; } /** Returned when a tool call triggered an app-level side effect (ticket, product, etc.). */ export interface ToolResult { kind: 'toolResult'; toolCallResult: unknown; responseId: string; usage: UsageMetrics | null; model: string; } export type AskWithToolsResult = TextResult | ToolResult; //# sourceMappingURL=ask-with-tools.types.d.ts.map