/** * Extract a best-effort text string from OpenAI/Anthropic "content" fields. * Supports: * - string * - array of parts: [{ type: "text", text: "..." }, ...] * - objects with a `text` string field */ export declare function extractCompatTextContent(content: unknown): string; export type OpenAiChatRole = "system" | "developer" | "user" | "assistant" | "tool" | "function"; export interface OpenAiChatMessage { role: OpenAiChatRole; content?: unknown; } /** * For OpenAI-compatible requests, we intentionally reduce "messages" to: * - all system/developer messages (joined) * - the last user message * * This keeps the server-side room memory coherent (so stateless clients that * resend full history do not cause runaway duplication). */ export declare function extractOpenAiSystemAndLastUser(messages: unknown): { system: string; user: string; } | null; export type AnthropicRole = "user" | "assistant"; export interface AnthropicMessage { role: AnthropicRole; content?: unknown; } export declare function extractAnthropicSystemAndLastUser(args: { system?: unknown; messages: unknown; }): { system: string; user: string; } | null; /** * Resolve a stable room key for compatibility endpoints so manual testing can * keep conversation memory when the client provides an identifier. * * We accept a few common fields without requiring any one client: * - OpenAI: body.user (string) * - OpenAI: body.metadata.conversation_id * - Anthropic: body.metadata.user_id * - Anthropic: body.metadata.conversation_id */ export declare function resolveCompatRoomKey(body: Record, fallback?: string): string; //# sourceMappingURL=compat-utils.d.ts.map