/** * OpenAI API Client * * Low-level fetch wrapper for the talker processing pipeline. * Uses fetch directly (no SDK) to keep dependencies minimal. */ import type { TalkerDependencies } from "../../types"; /** * Call OpenAI chat completions API. * * A raw fetch, not the injected `OpenAI` SDK client, so this stays reachable * without the `openai` peer being installed (see peer-deps.test.ts). Honours * `processing.baseUrl` so a host routing through Azure OpenAI or a gateway * isn't silently bypassed, aborts after `processing.requestTimeoutMs` so a * hung upstream request can't hold a /call, /sms or /whatsapp webhook open * indefinitely, and samples at `processing.temperature` - callers already * fall back to the original text on any rejection here. */ export declare function callOpenAI(deps: TalkerDependencies, systemPrompt: string, userMessage: string, context: { phoneNumber: string; stage: "incoming" | "outgoing"; }): Promise;