Update some docstrings / typehints (#144)

This commit is contained in:
Greyson LaLonde
2024-01-21 14:55:17 -05:00
committed by GitHub
parent 7a93124cdb
commit e8a31da05d
3 changed files with 50 additions and 13 deletions

View File

@@ -39,11 +39,12 @@ class Task(BaseModel):
@model_validator(mode="after")
def check_tools(self):
"""Check if the tools are set."""
if not self.tools and (self.agent and self.agent.tools):
self.tools.extend(self.agent.tools)
return self
def execute(self, context: str = None) -> str:
def execute(self, context: Optional[str] = None) -> str:
"""Execute the task.
Returns: