/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
+5 -3
View File
@@ -9,11 +9,11 @@ import {
startIntervalEditor
} from "../util/utils";
import {Environment} from "../common/environment";
import {bot, googleAi} from "../index";
import {bot} from "../index";
import {MessageStore} from "../common/message-store";
import {Requirements} from "../base/requirements";
import {Requirement} from "../base/requirement";
import {ApiError} from "@google/genai";
import {ApiError, GoogleGenAI} from "@google/genai";
export class GeminiChat extends ChatCommand {
regexp = /^\/gemini\s([^]+)/i;
@@ -22,6 +22,8 @@ export class GeminiChat extends ChatCommand {
requirements = Requirements.Build(Requirement.BOT_CREATOR);
private googleAi = new GoogleGenAI({apiKey: Environment.GEMINI_API_KEY});
async execute(msg: Message, match?: RegExpExecArray): Promise<void> {
console.log("match", match);
return this.executeGemini(msg, match?.[1]);
@@ -65,7 +67,7 @@ export class GeminiChat extends ChatCommand {
}
});
const stream = await googleAi.models.generateContentStream({
const stream = await this.googleAi.models.generateContentStream({
model: "gemini-2.5-flash",
contents: chatContent,
});