A programming framework for agentic AI
refactor: [conversable_agent] remove raise from property access (#2006)
Eduardo Salinas146d49b2e3a4
diff --git a/autogen/agentchat/conversable_agent.py b/autogen/agentchat/conversable_agent.pyindex 0c6d4c812..86610d867 100644--- a/autogen/agentchat/conversable_agent.py+++ b/autogen/agentchat/conversable_agent.py@@ -270,13 +270,10 @@ class ConversableAgent(LLMAgent):self._description = description@property- def code_executor(self) -> CodeExecutor:- """The code executor used by this agent. Raise if code execution is disabled."""+ def code_executor(self) -> Optional[CodeExecutor]:+ """The code executor used by this agent. Returns None if code execution is disabled."""if not hasattr(self, "_code_executor"):- raise ValueError(- "No code executor as code execution is disabled. "- "To enable code execution, set code_execution_config."- )+ return Nonereturn self._code_executordef register_reply(