checking models capabilities
This commit is contained in:
@@ -2,6 +2,8 @@ import {Command} from "../base/command";
|
||||
import {Message} from "typescript-telegram-bot-api";
|
||||
import {logError, replyToMessage} from "../util/utils";
|
||||
import {Environment} from "../common/environment";
|
||||
import {googleAi} from "../index";
|
||||
import {AiModelCapabilities} from "../model/ai-model-capabilities";
|
||||
|
||||
export class GeminiGetModel extends Command {
|
||||
title = "/geminiGetModel";
|
||||
@@ -10,4 +12,21 @@ export class GeminiGetModel extends Command {
|
||||
async execute(msg: Message): Promise<void> {
|
||||
await replyToMessage({message: msg, text: `Текущая модель: "${Environment.GEMINI_MODEL}"`}).catch(logError);
|
||||
}
|
||||
|
||||
async getModelCapabilities(): Promise<AiModelCapabilities | null> {
|
||||
try {
|
||||
const info = await googleAi.models.get({model: Environment.GEMINI_MODEL});
|
||||
console.log(info);
|
||||
|
||||
return {
|
||||
vision: {supported: true},
|
||||
ocr: null,
|
||||
thinking: {supported: info.thinking},
|
||||
tools: null
|
||||
};
|
||||
} catch (e) {
|
||||
logError(e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user