Skip to content

Commit

Permalink
refactor: minimax 使用 openai model
Browse files Browse the repository at this point in the history
  • Loading branch information
crazyurus committed May 24, 2024
1 parent 24f2ea5 commit 17c1c0f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 15 deletions.
1 change: 1 addition & 0 deletions src/cli/commands/chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`
);
Expand Down
16 changes: 1 addition & 15 deletions src/platform/minimax.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,11 @@
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 {
protected model = 'abab5.5-chat';

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;

0 comments on commit 17c1c0f

Please sign in to comment.