geekan / MetaGPT

🌟 The Multi-Agent Framework: First AI Software Company, Towards Natural Language Programming
https://deepwisdom.ai/
MIT License
43.58k stars 5.19k forks source link

狼人杀配置说明文档 #1142

Open kbkbsxwd opened 5 months ago

kbkbsxwd commented 5 months ago

请问有狼人杀项目的相关配置说明文档吗?或者有相关交流群/社区也可以

geekan commented 5 months ago

You can ask questions directly, or through discord, or through the WeChat group (there are contact information above the discord-Chinese channel)

kbkbsxwd commented 5 months ago
1

image

image

image

请问这个问题我该如何解决?

nameBai commented 5 months ago

这是网络的问题,如果你想访问openai的api服务,需要添加代理 image lei类似于这样

voidking commented 5 months ago

这个问题确实是 GreBai 说的网络问题,可以参照他给的方法进行处理,也可以把base url改为openai api专用代理,比如

llm:
  api_type: 'openai' # or azure / ollama / open_llm etc. Check LLMType for more options
  model: 'gpt-4-turbo-preview' # or gpt-3.5-turbo-1106 / gpt-4-1106-preview
  base_url: 'https://render.openai-forward.com/v1' # or forward url / other llm url
  api_key: 'YOUR_API_KEY'
  # proxy: 'YOUR_LLM_PROXY_IF_NEEDED' # Optional. If you want to use a proxy, set it here.
  # pricing_plan: 'YOUR_PRICING_PLAN' # Optional. If your pricing plan uses a different name than the `model`.
geekan commented 5 months ago

Yes. @GreBai has provided old version (@kbkbsxwd is using) config @voidking has provided newer version (main branch).

Meanwhile, the werewolf env will be refactored into main branch. Could you estimate what date to provide it? @better629

kbkbsxwd commented 5 months ago

感谢各位提供的解决方案!我使用的是werewolf_game分支,因此当我采取@GreBai的方法后仍然出现同样的bug,我的config配置如图: image

一开始的配置: OPENAI_API_BASE: "https://api.openai.com/v1" OPENAI_PROXY: "http://127.0.0.1:8118" 和新的写法: OPENAI_BASE_URL: "https://api.openai.com/v1" OPENAI_PROXY: "http://127.0.0.1:7890" 这两种方法均出现和上述相同的报错。

另外config后面这些需要注释掉吗? image 再次感谢!

voidking commented 5 months ago

从报错看不是额度问题。 查了一下狼人杀分支是使用的openai==0.27.8,配置使用老版本配置。你可以使用下面的命令先测试一下网络

export OPENAI_API_KEY="sk-xxx"

# 测试官方OPENAI API
openai api chat_completions.create -m gpt-3.5-turbo-1106 -g user "Hello world"

# 测试OPENAI API代理
openai -b "https://render.openai-forward.com/v1" api chat_completions.create -m gpt-3.5-turbo-1106 -g user "Hello world"

如果使用OPENAI API代理可以正常连接openai,那么metagpt配置修改为:

OPENAI_API_BASE: "https://render.openai-forward.com/v1"