aiwrapper
Version:
A Universal AI Wrapper for JavaScript & TypeScript
47 lines (46 loc) • 1.36 kB
TypeScript
import { LangOptions, LanguageProvider } from "../../language-provider.ts";
import { LangMessage, LangMessageItem, LangMessageRole, LangMessages } from "../../messages.ts";
/**
* OpenAI-specific built-in tools
*/
export type OpenAIBuiltInTool = {
name: "web_search";
} | {
name: "file_search";
vector_store_ids: string[];
} | {
name: "mcp";
server_label: string;
server_description: string;
server_url: string;
require_approval: "never" | "always" | "if_needed";
} | {
name: "image_generation";
} | {
name: "code_interpreter";
} | {
name: "computer_use";
};
export type OpenAILangOptions = {
apiKey: string;
model?: string;
systemPrompt?: string;
reasoningEffort?: "low" | "medium" | "high";
showReasoningSummary?: boolean;
};
export declare class OpenAIResponsesLang extends LanguageProvider {
private model;
private apiKey;
private baseURL;
private reasoningEffort;
private showReasoningSummary;
constructor(options: OpenAILangOptions);
ask(prompt: string, options?: LangOptions): Promise<LangMessages>;
chat(messages: {
role: LangMessageRole;
items: LangMessageItem[];
}[] | LangMessage[] | LangMessages, options?: LangOptions): Promise<LangMessages>;
private buildStructuredOutput;
private buildRequestBody;
private sendToApi;
}