shitton of the ai changes

This commit is contained in:
2026-05-01 04:54:11 +03:00
parent d95c37a322
commit 8cff086a8e
194 changed files with 29409 additions and 8841 deletions
+45
View File
@@ -0,0 +1,45 @@
import {AiToolCall} from "./tool-types";
import {OllamaChatMessage} from "./ollama-chat-message";
import {MistralChatMessage} from "./mistral-chat-message";
import {MessageAudioPart, MessageImagePart} from "../common/message-part";
import {OpenAIChatMessage} from "./openai-chat-message";
export type ChatMessage = {
role: "system" | "user" | "assistant" | "tool";
content: string;
images?: string[];
imageParts?: MessageImagePart[];
documents?: string[];
audios?: string[];
audioParts?: MessageAudioPart[];
videos?: string[];
videoNotes?: string[];
thinking?: string;
tool_calls?: AiToolCall[];
tool_name?: string;
}
export function asOllamaChatMessage(message: ChatMessage): OllamaChatMessage {
return {
role: message.role,
content: message.content,
thinking: message.thinking,
images: message.images,
tool_calls: message.tool_calls,
tool_name: message.tool_name
};
}
export function asMistralChatMessage(message: ChatMessage): MistralChatMessage {
return {
role: message.role,
content: message.content,
};
}
// export function asOpenAIChatMessage(message: ChatMessage): OpenAIChatMessage {
// return {
//
// }
// }
export type AiChatMessage = OpenAIChatMessage | OllamaChatMessage | MistralChatMessage;