Open CJFEdu opened 3 weeks ago
Modified the issue description to use "````" quote for the output block.
You can see this markdown code block in the output:
pip install yfinance
It doesn't have a language annotation. So, the language annotation becomes an empty string. The Executor
's code executor cannot understand it.
To fix this we can respond in the Executor
that the language is not detected and ask the coding agent to try again.
What happened?
It got the following output trying to get the Quick Start code to work. I made some minor changes to the prompt because it was generating fake data rather than trying to pull original data.
The prompt I used was pretty close to.
Create a plot of NVDA vs TSLA stock returns YTD from 2024-01-01. Download real world data. Don't use sudo in the command line.
I also made a modification to run this in an async function. I don't think this affected the error, because it ran properly once before. However, I'll include the full function just for thoroughness.
pip install yfinance
Error processing publish message Traceback (most recent call last): File "/path/to/folder/.venv/lib/python3.12/site-packages/autogen_core/application/_single_threaded_agent_runtime.py", line 385, in _process_publish await asyncio.gather(*responses) File "/path/to/folder/.venv/lib/python3.12/site-packages/autogen_core/application/_single_threaded_agent_runtime.py", line 377, in _on_message return await agent.on_message( ^^^^^^^^^^^^^^^^^^^^^^^ File "/path/to/folder/.venv/lib/python3.12/site-packages/autogen_core/components/_routed_agent.py", line 468, in on_message return await h(self, message, ctx) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/path/to/folder/.venv/lib/python3.12/site-packages/autogen_core/components/_routed_agent.py", line 148, in wrapper return_value = await func(self, message, ctx) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/path/to/folder/autogen_agents.py", line 52, in handle_message result = await self._code_executor.execute_code_blocks( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/path/to/folder/.venv/lib/python3.12/site-packages/autogen_ext/code_executors/_docker_code_executor.py", line 284, in execute_code_blocks return await self._execute_code_dont_check_setup(code_blocks, cancellation_token) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/path/to/folder/.venv/lib/python3.12/site-packages/autogen_ext/code_executors/_docker_code_executor.py", line 249, in _execute_code_dont_check_setup command = ["timeout", str(self._timeout), lang_to_cmd(lang), filename] ^^^^^^^^^^^^^^^^^ File "/path/to/folder/.venv/lib/python3.12/site-packages/autogen_core/components/code_executor/_impl/utils.py", line 78, in lang_to_cmd raise ValueError(f"Unsupported language: {lang}") ValueError: Unsupported language: