Describe the bug
openai.BadRequestError: Error code: 400 - {'error': {'message': 'invalid request: agent message content is empty', 'type': 'invalid_request_error'}}
when i run the groupchat. First round is good, the second round appear the error.
Steps to reproduce
No response
Model Used
gpt-4
Expected Behavior
No response
Screenshots and logs
Traceback (most recent call last):
File "/Users/zhouql1978/dev/xplorer/xplorer-new-func.py", line 351, in
chat_results=user_proxy.initiate_chats(
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/autogen/agentchat/conversable_agent.py", line 1183, in initiate_chats
self._finished_chats = initiate_chats(_chat_queue)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/autogen/agentchat/chat.py", line 179, in initiate_chats
chat_res = sender.initiate_chat(**chat_info)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/autogen/agentchat/conversable_agent.py", line 987, in initiate_chat
self.send(msg2send, recipient, silent=silent)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/autogen/agentchat/conversable_agent.py", line 628, in send
recipient.receive(message, self, request_reply, silent)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/autogen/agentchat/conversable_agent.py", line 788, in receive
reply = self.generate_reply(messages=self.chat_messages[sender], sender=sender)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/autogen/agentchat/conversable_agent.py", line 1909, in generate_reply
final, reply = reply_func(self, messages=messages, sender=sender, config=reply_func_tuple["config"])
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/autogen/agentchat/groupchat.py", line 620, in run_chat
reply = speaker.generate_reply(sender=self)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/autogen/agentchat/conversable_agent.py", line 1909, in generate_reply
final, reply = reply_func(self, messages=messages, sender=sender, config=reply_func_tuple["config"])
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/autogen/agentchat/conversable_agent.py", line 1275, in generate_oai_reply
extracted_response = self._generate_oai_reply_from_client(
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/autogen/agentchat/conversable_agent.py", line 1294, in _generate_oai_reply_from_client
response = llm_client.create(
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/autogen/oai/client.py", line 626, in create
response = client.create(params)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/autogen/oai/client.py", line 279, in create
response = completions.create(**params)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/openai/_utils/_utils.py", line 275, in wrapper
return func(*args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/openai/resources/chat/completions.py", line 667, in create
return self._post(
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/openai/_base_client.py", line 1208, in post
return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/openai/_base_client.py", line 897, in request
return self._request(
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/openai/_base_client.py", line 988, in _request
raise self._make_status_error_from_response(err.response) from None
openai.BadRequestError: Error code: 400 - {'error': {'message': 'invalid request: agent message content is empty', 'type': 'invalid_request_error'}}
Additional Information
No response
Can you please provide a repro/code of the issue
Can you please try reproing your issue in 0.4 and create a new issue if it is still a problem for you. Thanks!
You can find the migration guide for 0.2 to 0.4 here