MetaGPT icon indicating copy to clipboard operation
MetaGPT copied to clipboard

MetaGPT 不能兼容gpt3.5的key吗?

Open zencorn opened this issue 2 years ago • 1 comments

Bug description

在windows的docker里尝试项目生成,key 的配置如下,运行后失败了. 能否支持使用3.5的key方便体验一下

2024-01-24 14:33:02.887 | ERROR | metagpt.utils.common:log_it:434 - Finished call to 'metagpt.actions.action_node.ActionNode._aask_v1' after 1.672(s), this was the 1st time calling it. exp: Error code: 400 - {'error': {'message': "This model's maximum context length is 4097 tokens. However, you requested 5044 tokens (948 in the messages, 4096 in the completion). Please reduce the length of the messages or completion.", 'type': 'invalid_request_error', 'param': 'messages', 'code': 'context_length_exceeded'}} Bug solved method

Environment information

  • LLM type and model name:

OPENAI_BASE_URL: "https://a.of0.cn/v1" OPENAI_API_KEY: "sk-**********************" # set the value to sk-xxx if you host the openai interface for open llm model OPENAI_API_MODEL: "gpt-3.5-turbo" MAX_TOKENS: 4096 RPM: 10 TIMEOUT: 60 # Timeout for llm invocation #DEFAULT_PROVIDER: openai

  • System version: win10 + docker

zencorn avatar Jan 24 '24 14:01 zencorn

"gpt-3.5-turbo" 的上下文窗口的token上限是4096,但是生成的prompt长度已经超过了这个限制. 用这个模型 "gpt-3.5-turbo-1106" 就可以了. 而且比"gpt-3.5-turbo"更便宜. 参考: [https://platform.openai.com/docs/models/gpt-3-5]

gaoshan5211 avatar Jan 28 '24 05:01 gaoshan5211