Open gitkitian opened 1 week ago
@gitkitian this is a very interesting error as it worked for the first few steps of the plan then something happened seemingly in relation to conversation management in openai library. Is there a way for me to try this LLM? I tried hosting it on my mac, but I do not have enough memory. Does Qwen2 support function calling capability? I am not seeing concrete evidence one way or another.
In the absence of an access point that has 70B, I tried this with qwen2 7B running locally and I get as far as github is opened but nothing else. The key issue is that the model does not adhere to instructions and does not return the termination string requested. So we just sit there and do nothing.
If I try this in openai gpt4, I get something like this:
Page loaded: https://github.com/, Title: GitHub: Let’s build from here · GitHub
browser_navigation_agent (to browser_nav_executor):
The page has been successfully navigated to GitHub.
##TERMINATE TASK##
Notice ##TERMINATE TASK##
at the end. That is what the code is looking for as a termination signal. I tried 5 iterations on the prompt including asking in the user command to add the termination string, but the model still never output it.
At this point we do not have a fix quite yet. If you have ideas on a different way to determine termination please share or make a PR. Meanwhile we are going to think about this.
Thanks for your attention and response. I am using the latest version of agent-e. You can reproduce this bug with the following LLM parameters configuration. AUTOGEN_MODEL_NAME=qwen2-72b-instruct AUTOGEN_MODEL_API_KEY=redacted for privacy AUTOGEN_MODEL_BASE_URL=https://dashscope.aliyuncs.com/compatible-mode/v1
@gitkitian I removed your key. You can't put an API key like this in a public forum. It would have been better to share it in a direct message in Discord. I tried what you gave and I get an error from that endpoint. I do not know much about that service so I can't debug it. I suspect some parameters are missing. Here is the error:
httpx.HTTPStatusError: Client error '400 Bad Request' for url 'https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions'
For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/400
DEBUG:openai._base_client:Not retrying
DEBUG:openai._base_client:Re-raising status error
ERROR:ae.utils.logger:Unable to process command: "go to github and search agent-e". Error code: 400 - {'error': {'code': 'invalid_parameter_error', 'param': None, 'message': 'field required: payload.parameters.tools.0.type & field required: payload.parameters.tools.1.type & field required: payload.parameters.tools.2.type & field required: payload.parameters.tools.3.type & field required: payload.parameters.tools.4.type & field required: payload.parameters.tools.5.type & field required: payload.parameters.tools.6.type & field required: payload.parameters.tools.7.type', 'type': 'invalid_request_error'}, 'id': 'chatcmpl-215d076a-0cac-9d8c-aa23-1ebb0464bb6f'}
Title
openai.BadRequestError: Error code: 400 - {'error': {'code': 'invalid_type', 'param': 'messages[0].content', 'message': "Invalid type for 'messages[0].content': expected one of a string or array of objects, but got an object instead.", 'type': 'invalid_request_error'}}
Description
(Agent-E) D:\Platform\Agent-E>python -m ae.main
Execute the user task "open https://github.com/ and search agent-e" Current Page: https://www.baidu.com/
planner_agent (to user):
{"plan": "1. Navigate to https://github.com/.
WARNING:ae.utils.logger:LLM response was not properly formed JSON. Will try to use it as is. LLM response: "{"plan": "1. Navigate to https://github.com/.
Starting a new chat....
browser_nav_executor (to browser_navigation_agent):
: Navigate to https://github.com/., Current Page: https://www.baidu.com/,
Suggested tool call (): openurl Arguments: {"url": "https://github.com/"}
Adding system message: "Opened URL: https://github.com/" browser_nav_executor (to browser_navigation_agent):
browser_nav_executor (to browser_navigation_agent):
Response from calling tool () Page loaded: https://github.com/, Title: GitHub: Let’s build from here · GitHub