import OpenAI from 'openai'; import type { CrowcoderConfig, Message } from './types.js'; import type { Tool } from './tools/types.js'; export declare function getClient(config: CrowcoderConfig): OpenAI; /** * Same as getClient but explicitly reports the active key in use, so * callers (streamChat) can attribute success/failure back to the * specific key for rotation health-tracking. */ export declare function getClientWithKey(config: CrowcoderConfig): { client: OpenAI; activeKey: string; }; export declare function resetClient(): void; /** Re-export so callers (index.ts /keys) can introspect pool status. */ export { reportFailure, reportSuccess, poolSize } from './key-rotation.js'; export declare function toolsToFunctions(tools: Tool[]): OpenAI.Chat.ChatCompletionTool[]; export declare function streamChat(config: CrowcoderConfig, messages: Message[], tools: Tool[], signal?: AbortSignal): AsyncGenerator<{ type: 'text' | 'thinking' | 'tool_call' | 'done'; content?: string; toolCalls?: OpenAI.Chat.ChatCompletionMessageFunctionToolCall[]; usage?: { prompt: number; completion: number; total: number; }; }>;