/mistral command for chat with Mistral AI
This commit is contained in:
@@ -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,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user