mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-05-03 08:12:39 +00:00
Adding Autocomplete to OSS (#1198)
* Cleaned up model_config * Fix pydantic issues * 99% done with autocomplete * fixed test issues * Fix type checking issues
This commit is contained in:
committed by
GitHub
parent
c511f4d0b5
commit
678dfffb62
@@ -113,10 +113,11 @@ class Agent(BaseAgent):
|
||||
description="Maximum number of retries for an agent to execute a task when an error occurs.",
|
||||
)
|
||||
|
||||
def __init__(__pydantic_self__, **data):
|
||||
config = data.pop("config", {})
|
||||
super().__init__(**config, **data)
|
||||
__pydantic_self__.agent_ops_agent_name = __pydantic_self__.role
|
||||
@model_validator(mode="after")
|
||||
def set_agent_ops_agent_name(self) -> "Agent":
|
||||
"""Set agent ops agent name."""
|
||||
self.agent_ops_agent_name = self.role
|
||||
return self
|
||||
|
||||
@model_validator(mode="after")
|
||||
def set_agent_executor(self) -> "Agent":
|
||||
@@ -213,7 +214,7 @@ class Agent(BaseAgent):
|
||||
raise e
|
||||
result = self.execute_task(task, context, tools)
|
||||
|
||||
if self.max_rpm:
|
||||
if self.max_rpm and self._rpm_controller:
|
||||
self._rpm_controller.stop_rpm_counter()
|
||||
|
||||
# If there was any tool in self.tools_results that had result_as_answer
|
||||
|
||||
Reference in New Issue
Block a user