crewAI
crewAI copied to clipboard
Return type of `check_agent_executor`
I was reviewing the source code for agent and have a question about the check_agent_executor function. The type of the return is "Agent". If that's an agent class, then shouldn't it be without quotes? Or maybe I'm not following something and this means something else?
@model_validator(mode="after")
def check_agent_executor(self) -> "Agent":
if not self.agent_executor:
self.set_cache_handler(self.cache_handler)
return self
Uhm - it's just a guess but since you are in the agent class, you can't tell that you are currently return the exact class. Therefore "Agent" to hit at least something.
but not sure about that.