import type { ResponseInputFile } from "openai/resources/responses/responses.js"; import type { AsyncRes } from "sortug"; export type ChatMessage = { author: string; text: string; sent: number; reasoning?: string; }; export type InputToken = | { text: string } | { img: string } | { file: ResponseInputFile } | { tools: ToolUseInput[] }; export type ToolUseInput = any; // TODO // me export type RequestOptions = { textOutput: boolean; }; export const defaultOptions: RequestOptions = { textOutput: true, }; // openai export type ContentType = { text: string } | { audio: Response }; export interface AIModelAPI { setModel: (model: string) => void; tokenizer: (text: string) => number; maxTokens: number; send: ( input: string | InputToken[], systemPrompt?: string, ) => AsyncRes; stream: ( input: string | InputToken[], handler: (data: string) => void, systemPrompt?: string, ) => void; } export type LLMChoice = | { gemini: string } | { claude: string } | { chatgpt: string } | { grok: string } | { deepseek: string } | { kimi: string } | { openai: { url: string; apiKey: string; model: string; allowBrowser?: boolean; }; };