modelscope / agentscope

Start building LLM-empowered multi-agent applications in an easier way.
https://doc.agentscope.io/
Apache License 2.0
5.05k stars 309 forks source link

[Bug]: run gomoku game change the qianwen llm out bug #126

Closed BarryYin closed 6 months ago

BarryYin commented 6 months ago

just change the llm from openai to qianwen

bug is out here :

image

agentscope.models.model:checking_wrapper:182 - Fail to parsing response: { "text": "{\n \"thought\": \"I will start by placing my piece in the center of the board to establish control over the center and increase my chances of forming a winning line in the future.\",\n \"move\": [7, 7]\n}", "embedding": null, "image_urls": null, "raw": { "id": "chatcmpl-98kpgz4fFFdnzCXtT5yfU78Z1GM5h", "choices": [ { "finish_reason": "stop", "index": 0, "logprobs": null, "message": { "content": "{\n \"thought\": \"I will start by placing my piece in the center of the board to establish control over the center and increase my chances of forming a winning line in the future.\",\n \"move\": [7, 7]\n}", "role": "assistant", "function_call": null, "tool_calls": null } } ], "created": 1711873676, "model": "gpt-3.5-turbo-0125", "object": "chat.completion", "system_fingerprint": "fp_3bc1b5746c", "usage": { "completion_tokens": 49, "prompt_tokens": 341, "total_tokens": 390 } } }. Exception: name 'res_dict' is not defined, Attempt 1 / 3

File "/Users/mac/Documents/GitHub/gogamgo/testgame1.py", line 293, in reply response = self.model( File "/Users/mac/Documents/GitHub/agentscope/src/agentscope/models/model.py", line 192, in checking_wrapper raise ValueError( ValueError: fail to parsing response with: parse_func. Attempts fails 3 times

BarryYin commented 6 months ago

config like this: YOUR_MODEL_CONFIGURATION_NAME = "qwen" YOUR_MODEL_CONFIGURATION = { "model_type": "dashscope_chat", "config_name": "qwen", "model_name": "qwen-max", "api_key": "", "generate_args": { "temperature": 0.5 } }

BarryYin commented 6 months ago

https://github.com/modelscope/agentscope/commit/ff919ed69931374a53888237d17957f8647e9356 find out the way to fix the bug

DavdGao commented 6 months ago

Thanks for your suggestions! We have updated the parsing method and the prompt engineering strategies to enhance the react agent in #136 . Now the react agent example supports qwen-max in dashscope api.