/mistral command for chat with Mistral AI

This commit is contained in:
2026-01-16 15:40:15 +03:00
parent d7dfe3f3a5
commit 326cfcafc8
8 changed files with 196 additions and 32 deletions
+6 -5
View File
@@ -35,13 +35,11 @@ import {OllamaPrompt} from "./commands/ollama-prompt";
import {AdminsAdd} from "./commands/admins-add";
import {AdminsRemove} from "./commands/admins-remove";
import {Shutdown} from "./commands/shutdown";
import {OllamaKill} from "./commands/ollama-kill";
import {Leave} from "./commands/leave";
import {OllamaChat} from "./commands/ollama-chat";
import {Start} from "./commands/start";
import {MessageStore} from "./common/message-store";
import {PrefixResponse} from "./commands/prefix-response";
import {GoogleGenAI} from "@google/genai";
import {GeminiChat} from "./commands/gemini-chat";
import {Choice} from "./commands/choice";
import {Coin} from "./commands/coin";
@@ -57,6 +55,7 @@ import {UserStore} from "./common/user-store";
import {OllamaRequest} from "./model/ollama-request";
import {CallbackCommand} from "./base/callback-command";
import {OllamaCancel} from "./callback_commands/ollama-cancel";
import {MistralChat} from "./commands/mistral-chat";
process.setUncaughtExceptionCaptureCallback(console.error);
@@ -101,8 +100,6 @@ export function abortOllamaRequest(uuid: string): boolean {
}
}
export const googleAi = new GoogleGenAI({apiKey: Environment.GEMINI_API_KEY});
export let systemInfoText: string = "";
export function setSystemInfo(info: string) {
@@ -149,7 +146,7 @@ export const callbackCommands: CallbackCommand[] = [
];
if (Environment.OLLAMA_ADDRESS && Environment.OLLAMA_MODEL && Environment.SYSTEM_PROMPT) {
chatCommands.push(new OllamaChat(), new OllamaPrompt(), new OllamaKill());
chatCommands.push(new OllamaChat(), new OllamaPrompt());
}
if (Environment.OLLAMA_API_KEY) {
@@ -160,6 +157,10 @@ if (Environment.GEMINI_API_KEY) {
chatCommands.push(new GeminiChat());
}
if (Environment.MISTRAL_API_KEY) {
chatCommands.push(new MistralChat());
}
async function main() {
console.log(
`TEST_ENVIRONMENT: ${Environment.TEST_ENVIRONMENT}\n` +