Fixes bug no attribute 'logger' (#259)

This commit is contained in:
joaopauloschuler 2025-01-18 14:31:19 -03:00 committed by GitHub
parent 34810986e0
commit 5aa0f2b53d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 7 deletions

View File

@ -910,13 +910,6 @@ class CodeAgent(MultiStepAgent):
raise AgentError(
"Tag '{{authorized_imports}}' should be provided in the prompt."
)
if "*" in self.additional_authorized_imports:
self.logger.log(
"Caution: you set an authorization for all imports, meaning your agent can decide to import any package it deems necessary. This might raise issues if the package is not installed in your environment.",
0,
)
super().__init__(
tools=tools,
model=model,
@ -925,6 +918,12 @@ class CodeAgent(MultiStepAgent):
planning_interval=planning_interval,
**kwargs,
)
if "*" in self.additional_authorized_imports:
self.logger.log(
"Caution: you set an authorization for all imports, meaning your agent can decide to import any package it deems necessary. This might raise issues if the package is not installed in your environment.",
0,
)
if use_e2b_executor and len(self.managed_agents) > 0:
raise Exception(
f"You passed both {use_e2b_executor=} and some managed agents. Managed agents is not yet supported with remote code execution."