Browse Source

docs: Add note recommending PythonCodeExecutionTool as an alternative to CodeExecutorAgent (#5809)

Resolves #5782

---------

Co-authored-by: Victor Dibia <victordibia@microsoft.com>
tags/python-v0.4.9
Eric Zhu GitHub 1 year ago
parent
commit
39bfa35e28
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 0 deletions
  1. +8
    -0
      python/packages/autogen-agentchat/src/autogen_agentchat/agents/_code_executor_agent.py

+ 8
- 0
python/packages/autogen-agentchat/src/autogen_agentchat/agents/_code_executor_agent.py View File

@@ -25,6 +25,14 @@ class CodeExecutorAgent(BaseChatAgent, Component[CodeExecutorAgentConfig]):

It is typically used within a team with another agent that generates code snippets to be executed.

.. note::

Consider :class:`~autogen_ext.tools.code_execution.PythonCodeExecutionTool`
as an alternative to this agent. The tool allows for executing Python code
within a single agent, rather than sending it to a separate agent for execution.
However, the model for the agent will have to generate properly escaped code
string as a parameter to the tool.

Args:
name: The name of the agent.
code_executor: The CodeExecutor responsible for executing code received in messages (:py:class:`~autogen_ext.code_executors.docker.DockerCommandLineCodeExecutor` recommended. See example below)


Loading…
Cancel
Save