Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
congliu19 opened this issue Jan 15, 2024 · 10 comments
Labels
bug Something isn't working

Comments

@congliu19
Copy link

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

@ekzhu
Copy link
Collaborator

ekzhu commented Jan 15, 2024

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

@congliu19
Copy link
Author

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?

@ekzhu
Copy link
Collaborator

ekzhu commented Jan 15, 2024

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"?

@congliu19
Copy link
Author

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}}"

@ekzhu
Copy link
Collaborator

ekzhu commented Jan 16, 2024

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

@congliu19
Copy link
Author

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?~

@cheng-tan
Copy link
Contributor

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

@congliu19
Copy link
Author

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.

@aishoot
Copy link

aishoot commented Mar 17, 2024

the same question

@qingyun-wu
Copy link
Collaborator

Hi @congliu19, is the issue addressed?

@qingyun-wu qingyun-wu added the bug Something isn't working label Jun 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants