autogen icon indicating copy to clipboard operation
autogen copied to clipboard

[Bug]: openai.BadRequestError: Error code: 400 - {'error': {'message': 'Invalid request: user message content is empty', 'type': 'invalid_request_error'}}

Open 1390806607 opened this issue 1 year ago • 2 comments

Describe the bug

import autogen

config_list = autogen.config_list_from_json( "OAI_CONFIG_LIST.json", filter_dict={ "model": ["moonshot-v1-8k"], }, )

llm_config = {"config_list": config_list, "cache_seed": 42}

user_proxy = autogen.UserProxyAgent( name="User_proxy", system_message="A human admin.", code_execution_config={ "last_n_messages": 2, "work_dir": "groupchat", "use_docker": False, }, # Please set use_docker=True if docker is available to run the generated code. Using docker is safer than running the generated code directly. human_input_mode="TERMINATE", )

coder = autogen.AssistantAgent( name="Coder", llm_config=llm_config, )

pm = autogen.AssistantAgent( name="Product_manager", system_message="Creative in software product ideas.", llm_config=llm_config, )

groupchat = autogen.GroupChat(agents=[user_proxy, coder, pm], messages=[], max_round=12) manager = autogen.GroupChatManager(groupchat=groupchat, llm_config=llm_config)

user_proxy.initiate_chat( manager, message="Find a latest paper about gpt-4 on arxiv and find its potential applications in software." )

Steps to reproduce

No response

Model Used

No response

Expected Behavior

No response

Screenshots and logs

No response

Additional Information

No response

1390806607 avatar May 22 '24 08:05 1390806607

We faced the same issue when employing the step-1-32k model.

BadRequestError: Error code: 400 - {'error': {'message': 'role or content cannot be empty.', 'type': 'request_params_invalid'}}

gotoolkits avatar Jun 18 '24 06:06 gotoolkits

I meet the same error when use the groupchat example (https://microsoft.github.io/autogen/docs/notebooks/agentchat_groupchat) openai.BadRequestError: Error code: 400

After the first speaker replied, the second request has the error above.

Alaya-Con avatar Aug 06 '24 06:08 Alaya-Con

Have you resovled this problem?

sdzcgaoxiang avatar Aug 29 '24 02:08 sdzcgaoxiang

Closing as stale

victordibia avatar Jun 14 '25 04:06 victordibia