Empty message returned by agent in SelectorGroupChat #6437
Replies: 4 comments 2 replies
|
Would you try changing the model to OpenAI’s GPT series? In that PR, I applied the fix only for Anthropic and OpenAI SDKs, However, if you could provide a minimal runnable sample (something that works with simple copy & paste) to reproduce the issue for #6168, If switching to OpenAI still doesn’t fix the issue, then this might be a new bug. Could you provide a minimal reproducible example?
|
|
Hi SongChiyoung (@SongChiYoung) , Any suggestions on what can be done would be much appreciated, as unfortunately we are constrained to using Bedrock for this project. Please find the minimal runnable sample attached, with the requirements.txt. The only thing that needs to be configured is the .env file (as attached). |
|
Eric Zhu (@ekzhu) In this case, the error originates from Semantic Kernel, so I’m unsure whether this should be fixed at the AutoGen layer or considered SK’s responsibility. Do you think it should be patched inside AutoGen for robustness, or is it better to leave it to SK? I’m happy to follow your recommendation. |
|
Thanks for packaging the runnable sample with the
Reproduced on autogen
Two ways out without an extra library: # 1. agent level: never emit a blank summary (and have the generated code print the saved path)
chart_coder_agent = AssistantAgent(..., tool_call_summary_format="{tool_name}: {result}")
# 2. adapter level: also covers the empty-reflection case from your first snippet
class BedrockSafeSKAdapter(SKChatCompletionAdapter):
def _convert_to_chat_history(self, messages):
kept = [m for m in messages if not (isinstance(m.content, str) and not m.content.strip())]
return super()._convert_to_chat_history(kept)Where each step happens (main @ 027ecf0)
With |
Uh oh!
There was an error while loading. Please reload this page.
Hello,
I am using a SelectorGroupChat, including several agents that can help query a SQL database to answer the user prompt. One of the agents is a chart_coder_agent that is meant to use the PythonCodeExecutionTool to generate a chart/visualization relevant to the data. Here are some parts of the code.
The group chat works very well, until the chart_coder_agent successfully generates the chart, and then responds with an empty message. This causes the chat to fail. Any ideas on how this can be rectified would be much appreciated!
All reactions