QwenLM / Qwen-Agent

Agent framework and applications built upon Qwen2, featuring Function Calling, Code Interpreter, RAG, and Chrome extension.
https://pypi.org/project/qwen-agent/
Other
2.51k stars 249 forks source link

使用Azuere OpenAI,报Invalid 'stop': array too long. Expected an array with maximum length 4, but got an array with length 5 instead. #228

Open chenk-gd opened 4 days ago

chenk-gd commented 4 days ago

传过去的stop参数:['✿RESULT✿', '✿RESULT✿:', '✿RESULT✿:\n', 'Observation:', 'Observation:\n'],超过了OpenAI的限制

JianxinMa commented 4 days ago

我查了下Up to 4 sequences where the API will stop generating further tokens. 所以是最多4个吗。。。

那可以尝试安装下最新的qwen-agent(v0.0.6版本)(pip install -U "qwen-agent>=0.0.6"),那个版本可能刚好是4个stop words。

chenk-gd commented 4 days ago

openai确实是限制了最多4个(https://help.openai.com/en/articles/5072263-how-do-i-use-stop-sequences-in-the-openai-api),就是不知道为什么要做这个限制...