Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add Minimax model #774

Merged
merged 2 commits into from
May 23, 2023
Merged

feat: Add Minimax model #774

merged 2 commits into from
May 23, 2023

Conversation

noahzark
Copy link
Contributor

@noahzark noahzark commented May 23, 2023

作者自述

描述

本次 pr 实现的功能:

  • 接入 Minimax 对话 API
  • 实现流式传输
  • 翻译 base_model.history 以实现多轮对话
  • 翻译n_choices, system_prompt, max_generation_token, top_p, temperature 参数
  • 实现对话角色扮演(可选,在system_prompt中的第一行,以【用户角色:bot角色】定义)
  • 计算对话使用的token

对话示例

作为助手机器人对话(无 system prompt)
bfc9eb7e5e7bdd10405a37b7fd1b438

使用知识库设定进行角色扮演对话(直接使用上文的回答作为system prompt)
af443d05940abce9c027d682f30a034

相关问题

无,直接弄出来了

补充信息

该公司比较有名的应用是 Glow,据说用户已经上百万而且效果不错。
现在已经对公司开放 API 申请。
个人感觉比较擅长 文本续写和角色扮演对话,对于指令性和代码生成有待提高。
作为国产 AI 自然是可以直接调用,不论是生成速度还是价格都比 openai 好。

定价

abab4 暂时看不到了,但是比abab5便宜很多

接口 模型 定价(元/1000token) 说明
Chat Completion abab5 0.015 适用范围包括互动娱乐场景如游戏、社交、等场景的聊天互动,以及知识型问答对话,营销文案、周报、演讲稿、小说等文字创作

介绍

Minimax 最新一代的中文大语言模型
帮助人类高效写作、激发创意、获取知识、做出决策

相关新闻

传获米哈游投资,估值10亿美元:一家低调的AI创业公司
和AI谈恋爱,掏空我钱包

Copilot4PR

🤖 Generated by Copilot at 086575e

Summary

🔑💬🎲

This pull request adds support for the MiniMax chat models, which use a game-theoretic strategy for generating chat responses. It defines a new model type, Minimax, and a new class, MiniMax_Client, that handles the communication with the MiniMax chat API. It also adds the necessary configuration options, environment variables, and model names to enable the use of the MiniMax models.

Oh, we're the chatbots of the sea, and we're ready for a spree
We've got a new Minimax model to make us smart and free
So haul away the yardarm, lads and lasses, on the count of three
And set the minimax_api_key to access the MiniMax API

Walkthrough

  • Add support for MiniMax chat models (link, link, link, link, link, link)
  • Add a new configuration option for the minimax_api_key in config.py and set the environment variable MINIMAX_API_KEY (link)
  • Add a new enum value for the ModelType class in base_model.py and a new condition to the get_type function to recognize MiniMax models (link, link)
  • Add a new module minimax.py that contains the MiniMax_Client class, which inherits from the BaseLLMModel class and implements the methods for interacting with the MiniMax chat API (link)
  • Add a new branch to the get_model function in models.py that creates and returns an instance of the MiniMax_Client class based on the model name and the access key, and import the minimax module (link)
  • Add two new model names to the ONLINE_MODELS list in presets.py that correspond to the MiniMax chat models (link)

@noahzark noahzark changed the title add minimax model and implement both get answer at once/stream, also … feat: add minimax model and implement both get answer at once/stream, also … May 23, 2023
@noahzark noahzark changed the title feat: add minimax model and implement both get answer at once/stream, also … feat: Add Minimax model May 23, 2023
@Keldos-Li Keldos-Li added 🚀 enhancement 🤖 model 与特定大语言模型LLM相关 labels May 23, 2023
@GaiZhenbiao GaiZhenbiao self-assigned this May 23, 2023
@GaiZhenbiao
Copy link
Owner

GaiZhenbiao commented May 23, 2023

感谢你的工作🚀!不过有两个小问题:

  • config.py中,也应该加入Group ID的配置:
minimax_group_id = config.get("minimax_group_id", "")
os.environ["MINIMAX_GROUP_ID"] = minimax_group_id
  • config_example.json中,应该加入相应的说明:
// MiniMax的APIKey(不包含"Bearer "前缀)和Group ID,用于MiniMax对话模型
    "minimax_api_key": "",
    "minimax_group_id": "",

@noahzark
Copy link
Contributor Author

感谢你的工作🚀!不过有两个小问题:

  • config.py中,也应该加入Group ID的配置:
minimax_group_id = config.get("minimax_group_id", "")
os.environ["MINIMAX_GROUP_ID"] = minimax_group_id
  • config_example.json中,应该加入相应的说明:
// MiniMax的APIKey(不包含"Bearer "前缀)和Group ID,用于MiniMax对话模型
    "minimax_api_key": "",
    "minimax_group_id": "",

感谢提醒 🤝 已加

@GaiZhenbiao GaiZhenbiao merged commit cef64b2 into GaiZhenbiao:main May 23, 2023
@noahzark noahzark deleted the minimax branch May 23, 2023 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚀 enhancement 🤖 model 与特定大语言模型LLM相关
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants