autogen icon indicating copy to clipboard operation
autogen copied to clipboard

[Issue]: Error code: 400 - {'error': {'message': "You submitted a length-0 POST body, but must submit a JSON object.

Open congliu19 opened this issue 2 years ago • 9 comments

Describe the issue

hello, I'm running the demo of plot the stock price of APPL and TESLA. When I interact with useragent, this error occurs. Why the post body is length-0? How to deal this? Wait for reply~ thx!

Steps to reproduce

No response

Screenshots and logs

No response

Additional Information

No response

congliu19 avatar Jan 15 '24 03:01 congliu19

Can you post the complete code you use and print the llm_config (remove the secretes like OPENAI_API_KEY).

ekzhu avatar Jan 15 '24 04:01 ekzhu

the OAI_CONFIG_LIST👇

[ { "model": "gpt-4", "api_key": "06xxxxxxx", "base_url": "https://canadaeast4ai.openai.azure.com/", "api_type": "azure", "api_version": "2023-07-01-preview" }, { "model": "GPT-35-Turbo-G", # the name in azure deploy model name "api_key": "06xxxx", "base_url": "https://switzerlandnorthinstance4ai.openai.azure.com/", "api_type": "azure", "api_version": "2023-07-01-preview" } ]

I have a question that the value of "model" is from the deployment model name in azure or something match what?

congliu19 avatar Jan 15 '24 07:01 congliu19

I have a question that the value of "model" is from the deployment model name in azure or something match what?

Should be deployment name I believe.

"api_version": "2023-07-01-preview"

Can you use "2023-12-01-preview"?

ekzhu avatar Jan 15 '24 19:01 ekzhu

I have try with 2023-12-01-preview, but it error again after "Successfully installed contourpy-1.2.0 cycler-0.12.1 fonttools-4.47.2 kiwisolver-1.4.5 matplotlib-3.8.2 packaging-23.2 pillow-10.2.0 pyparsing-3.1.1" with the error message below "raise self._make_status_error_from_response(err.response) from None openai.BadRequestError: Error code: 400 - {'error': {'message': "You submitted a length-0 POST body, but must submit a JSON object. (HINT: Try submitting an empty object instead, i.e. {}. If you're using curl, you can pass -d '{}' -H 'Content-Type: application/json')", 'type': 'invalid_request_error', 'param': None, 'code': None}}"

congliu19 avatar Jan 16 '24 02:01 congliu19

Could you also post your pyautogen version, and your Python version?

ekzhu avatar Jan 16 '24 03:01 ekzhu

I get the code by git clone last week. How to find the version? But I just pull the newest, the python script can run longer than before until the stock price chart was plotted. However, when I continue send the new request, such as, "add the BABA to this chart" the same error occurs again. I guess it should be something null get this, but I can't locate it. Can u help me?~

congliu19 avatar Jan 16 '24 06:01 congliu19

use pip list | grep 'pyautogen' to check autogen version, can you also check openai version?

cheng-tan avatar Jan 16 '24 15:01 cheng-tan

I'm sorry for the late reply. The pyautogen version is 0.2.7 and openai version is 1.10.0. I have meet the same error in other agent such as crewAI. However, I have not debugged it out yet.

congliu19 avatar Jan 29 '24 09:01 congliu19

the same question

aishoot avatar Mar 17 '24 13:03 aishoot

Hi @congliu19, is the issue addressed?

qingyun-wu avatar Jun 18 '24 20:06 qingyun-wu