分享
适配其他国产模型
输入“/”快速插入内容
适配其他国产模型
飞书用户2238
2024年3月1日修改
智谱(在0.6.6下测试成功)
代码块
Python
#### if zhipuai from `https://open.bigmodel.cn`. You can set here or export API_KEY="YOUR_API_KEY"
ZHIPUAI_API_KEY: 'YOUR_API_KEY'
API申请地址
智谱AI开放平台
配置方法
代码块
Python
os.environ["ZHIPUAI_API_KEY"] = xxx
如果用config.yaml文件进行配置默认调用的文件路径在
代码块
SQL
default_yaml_file = METAGPT_ROOT / "config/config.yaml"
可以运行如下代码查看绝对路径然后在该路径下修改
代码块
SQL
from metagpt.const import DEFAULT_WORKSPACE_ROOT, METAGPT_ROOT, OPTIONS
default_yaml_file = METAGPT_ROOT / "config/config.yaml"
print(METAGPT_ROOT / "config/config.yaml")
讯飞星火
如何领取
xinghuo.xfyun.cn
同理更改对应的config.yaml文件
和开源模型集成
https://docs.deepwisdom.ai/main/en/guide/tutorials/integration_with_open_llm.html
Gemini
如何获取
https://github.com/geekan/MetaGPT/blob/main/config/config.yaml
更改配置信息
代码块
Python
#### if Google Gemini from `https://ai.google.dev/` and API_KEY from `https://makersuite.google.com/app/apikey`.
#### You can set here or export GOOGLE_API_KEY="YOUR_API_KEY"
# GEMINI_API_KEY: "YOUR_API_KEY"