crewAI icon indicating copy to clipboard operation
crewAI copied to clipboard

Return type of `check_agent_executor`

Open matsuobasho opened this issue 2 years ago • 1 comments

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

matsuobasho avatar Jan 17 '24 22:01 matsuobasho

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.

michaelwdombek avatar Jan 23 '24 14:01 michaelwdombek