From 17c1c0f4ddc50e76c2ce3cbe1e8ff8b56281b1a1 Mon Sep 17 00:00:00 2001 From: Crazy Urus Date: Fri, 24 May 2024 14:48:07 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20minimax=20=E4=BD=BF=E7=94=A8=20open?= =?UTF-8?q?ai=20model?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/cli/commands/chat.ts | 1 + src/platform/minimax.ts | 16 +--------------- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/src/cli/commands/chat.ts b/src/cli/commands/chat.ts index 556ecdb..c3927a0 100644 --- a/src/cli/commands/chat.ts +++ b/src/cli/commands/chat.ts @@ -57,6 +57,7 @@ class ChatCommand extends BaseCommand { const aiDisplay = this.getDisplayContent(PromptRole.AI); let lastMessage = 'How can I help you today?'; + console.warn = () => {}; process.stdout.write( this.getDisplayContent(PromptRole.SYSTEM) + `Type ${chalk.cyan('exit')} to end this conversation\n` ); diff --git a/src/platform/minimax.ts b/src/platform/minimax.ts index bc3db7d..dc7f7a3 100644 --- a/src/platform/minimax.ts +++ b/src/platform/minimax.ts @@ -1,7 +1,3 @@ -import type { BaseLanguageModel } from '@langchain/core/language_models/base'; - -import { ChatMinimax } from '@langchain/community/chat_models/minimax'; - import Platform from './base'; class MiniMax extends Platform { @@ -9,17 +5,7 @@ class MiniMax extends Platform { public name = 'MiniMax'; - protected server = 'api.minimax.chat'; - - protected getChatModel(apiKey?: string, streaming = false): BaseLanguageModel { - return new ChatMinimax({ - minimaxApiKey: apiKey, - minimaxGroupId: process.env.MINIMAX_GROUP_ID || '1782658868262748274', - model: this.model, - streaming, - temperature: this.temperature - }); - } + protected server = 'api.minimax.chat/v1/text/chatcompletion_v2#'; } export default MiniMax;