update @mistralai lib
This commit is contained in:
@@ -6,6 +6,7 @@ import {Requirements} from "../base/requirements";
|
||||
import {Requirement} from "../base/requirement";
|
||||
import {mistralAi} from "../index";
|
||||
import {AiModelCapabilities} from "../model/ai-model-capabilities";
|
||||
import {BaseModelCard} from "@mistralai/mistralai/models/components/basemodelcard";
|
||||
|
||||
export class MistralGetModel extends Command {
|
||||
title = "/mistralGetModel";
|
||||
@@ -19,14 +20,15 @@ export class MistralGetModel extends Command {
|
||||
|
||||
async getModelCapabilities(): Promise<AiModelCapabilities | null> {
|
||||
try {
|
||||
const info = await mistralAi.models.retrieve({modelId: Environment.MISTRAL_MODEL});
|
||||
const info: BaseModelCard = await mistralAi.models.retrieve({modelId: Environment.MISTRAL_MODEL}) as BaseModelCard;
|
||||
console.log(info);
|
||||
|
||||
return {
|
||||
vision: {supported: info.capabilities.vision},
|
||||
ocr: {supported: info.capabilities.ocr},
|
||||
thinking: null,
|
||||
tools: {supported: info.capabilities.functionCalling}
|
||||
tools: {supported: info.capabilities.functionCalling},
|
||||
audio: {supported: info.capabilities.audioTranscription}
|
||||
};
|
||||
} catch (e) {
|
||||
logError(e);
|
||||
|
||||
@@ -4,6 +4,7 @@ import {Requirement} from "../base/requirement";
|
||||
import {Message} from "typescript-telegram-bot-api";
|
||||
import {mistralAi} from "../index";
|
||||
import {logError, oldReplyToMessage, replyToMessage} from "../util/utils";
|
||||
import {BaseModelCard} from "@mistralai/mistralai/models/components/basemodelcard";
|
||||
|
||||
export class MistralListModels extends Command {
|
||||
title = "/mistralListModels";
|
||||
@@ -13,7 +14,10 @@ export class MistralListModels extends Command {
|
||||
|
||||
async execute(msg: Message): Promise<void> {
|
||||
try {
|
||||
const listResponse = await mistralAi.models.list();
|
||||
const listResponse = await mistralAi.models.list() as {
|
||||
object: string;
|
||||
data: Array<BaseModelCard>
|
||||
};
|
||||
console.log(listResponse);
|
||||
|
||||
const modelsString = listResponse.data
|
||||
|
||||
@@ -252,8 +252,6 @@ async function shutdown(signal: NodeJS.Signals) {
|
||||
async function main() {
|
||||
const start = Date.now();
|
||||
|
||||
console.log(Environment.SYSTEM_PROMPT);
|
||||
|
||||
console.log(
|
||||
`TEST_ENVIRONMENT: ${Environment.TEST_ENVIRONMENT}\n` +
|
||||
`DATA_PATH: ${Environment.DATA_PATH}\n` +
|
||||
|
||||
Reference in New Issue
Block a user