tool call WIP

This commit is contained in:
2023-11-09 17:48:04 +08:00
parent 81660d563f
commit e7e3e693ef
2 changed files with 105 additions and 10 deletions

View File

@@ -9,7 +9,7 @@ export interface MessageDetail {
image_url?: ImageURL;
}
export interface Message {
role: "system" | "user" | "assistant" | "function";
role: "system" | "user" | "assistant" | "tool";
content: string | MessageDetail[];
name?: "example_user" | "example_assistant";
tool_calls?: {
@@ -17,6 +17,7 @@ export interface Message {
type: string;
function: any;
}[];
tool_call_id?: string;
}
export const getMessageText = (message: Message): string => {
if (typeof message.content === "string") {