You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
code executor throw Unsupported language: echarts To Reproduce
code_executor_agent = CodeExecutorAgent(
name="code_executor", code_executor=code_executor
)
assistant_agent = AssistantAgent(
name="coder_agent",
model_client=self.model_client,
system_message=DEFAULT_SYSTEM_MESSAGE,
model_client_stream=True,
)
# The termination condition is a combination of text termination and max message termination, either of which will cause the chat to terminate.
termination = TextMentionTermination("TERMINATE") | MaxMessageTermination(20)
# The group chat will alternate between the assistant and the code executor.
self.group_chat = RoundRobinGroupChat(
[assistant_agent, code_executor_agent], termination_condition=termination
)
When the model generates an ECharts code block in Markdown format (```echarts), the following exception is thrown:
| async for message in self.group_chat.run_stream(
| File "d:\Develop\conda\envs\ai_table\Lib\site-packages\autogen_agentchat\teams\_group_chat\_base_group_chat.py", line 518, in run_stream
| raise RuntimeError(str(message.error))
| RuntimeError: ValueError: Unsupported language: echarts
| Traceback:
| Traceback (most recent call last):
|
| File "d:\Develop\conda\envs\ai_table\Lib\site-packages\autogen_agentchat\teams\_group_chat\_chat_agent_container.py", line 79, in handle_request
| async for msg in self._agent.on_messages_stream(self._message_buffer, ctx.cancellation_token):
|
| File "d:\Develop\conda\envs\ai_table\Lib\site-packages\autogen_agentchat\agents\_code_executor_agent.py", line 427, in on_messages_stream
| execution_result = await self.execute_code_block(code_blocks, cancellation_token)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
| File "d:\Develop\conda\envs\ai_table\Lib\site-packages\autogen_agentchat\agents\_code_executor_agent.py", line 576, in execute_code_block
| result = await self._code_executor.execute_code_blocks(code_blocks, cancellation_token=cancellation_token)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
| File "d:\Develop\conda\envs\ai_table\Lib\site-packages\autogen_ext\code_executors\docker\_docker_code_executor.py", line 403, in execute_code_blocks
| return await self._execute_code_dont_check_setup(code_blocks, cancellation_token)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
| File "d:\Develop\conda\envs\ai_table\Lib\site-packages\autogen_ext\code_executors\docker\_docker_code_executor.py", line 344, in _execute_code_dont_check_setup
| command = ["timeout", str(self._timeout), lang_to_cmd(lang), filename]
| ^^^^^^^^^^^^^^^^^
|
| File "d:\Develop\conda\envs\ai_table\Lib\site-packages\autogen_ext\code_executors\_common.py", line 171, in lang_to_cmd
| raise ValueError(f"Unsupported language: {lang}")
|
| ValueError: Unsupported language: echarts
Expected behavior
Unsupported code should not be executed.
Which packages was the bug in?
Python AgentChat (autogen-agentchat>=0.4.0)
AutoGen library version.
Python 0.5.6
Other library version.
No response
Model used
No response
Model provider
Azure OpenAI
Other model provider
No response
Python version
3.10
.NET version
None
Operating system
Windows
The text was updated successfully, but these errors were encountered:
What is your scenario here? Are there other code blocks you need to execute that are generated in addition to the echarts one?
There are also Python and Shell code blocks, but the ECharts code block is used for frontend display. The code executor should not execute the ECharts code block.
Can the code executor skip unsupported code blocks instead of throwing errors?
Thanks for the info. I think the required fix here is that the CodeExecutorAgent should be able to specify either explicit languages to include or exclude.
What happened?
Describe the bug
code executor throw Unsupported language: echarts
To Reproduce
When the model generates an ECharts code block in Markdown format (```echarts), the following exception is thrown:
Expected behavior
Unsupported code should not be executed.
Which packages was the bug in?
Python AgentChat (autogen-agentchat>=0.4.0)
AutoGen library version.
Python 0.5.6
Other library version.
No response
Model used
No response
Model provider
Azure OpenAI
Other model provider
No response
Python version
3.10
.NET version
None
Operating system
Windows
The text was updated successfully, but these errors were encountered: