ai-utils.js
Version:
Build AI applications, chatbots, and agents with JavaScript and TypeScript.
27 lines (26 loc) • 714 B
TypeScript
export type OpenAIChatMessage = {
role: "user" | "assistant" | "system";
content: string;
name?: string;
} | {
role: "assistant";
content: string | null;
function_call: {
name: string;
arguments: string;
};
} | {
role: "function";
content: string;
name: string;
};
export declare const OpenAIChatMessage: {
system(content: string): OpenAIChatMessage;
user(content: string): OpenAIChatMessage;
assistant(content: string): OpenAIChatMessage;
functionCall(content: string | null, functionCall: {
name: string;
arguments: string;
}): OpenAIChatMessage;
functionResult(name: string, content: string): OpenAIChatMessage;
};