microsoft / autogen

A programming framework for agentic AI. Discord: https://aka.ms/autogen-dc. Roadmap: https://aka.ms/autogen-roadmap
https://microsoft.github.io/autogen/
Creative Commons Attribution 4.0 International
28.43k stars 4.16k forks source link

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

Open 1390806607 opened 1 month ago

1390806607 commented 1 month ago

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

gotoolkits commented 3 weeks ago

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