mirror of
https://github.com/microsoft/autogen.git
synced 2026-04-20 03:02:16 -04:00
Raise errors if incompatible args are used with an executor (#1855)
* Raise errors if incompatible args are used with an executor * spelling error
This commit is contained in:
@@ -197,6 +197,21 @@ class ConversableAgent(LLMAgent):
|
||||
self._code_execution_config = code_execution_config
|
||||
|
||||
if self._code_execution_config.get("executor") is not None:
|
||||
if "use_docker" in self._code_execution_config:
|
||||
raise ValueError(
|
||||
"'use_docker' in code_execution_config is not valid when 'executor' is set. Use the appropriate arg in the chosen executor instead."
|
||||
)
|
||||
|
||||
if "work_dir" in self._code_execution_config:
|
||||
raise ValueError(
|
||||
"'work_dir' in code_execution_config is not valid when 'executor' is set. Use the appropriate arg in the chosen executor instead."
|
||||
)
|
||||
|
||||
if "timeout" in self._code_execution_config:
|
||||
raise ValueError(
|
||||
"'timeout' in code_execution_config is not valid when 'executor' is set. Use the appropriate arg in the chosen executor instead."
|
||||
)
|
||||
|
||||
# Use the new code executor.
|
||||
self._code_executor = CodeExecutorFactory.create(self._code_execution_config)
|
||||
self.register_reply([Agent, None], ConversableAgent._generate_code_execution_reply_using_executor)
|
||||
|
||||
Reference in New Issue
Block a user