fix: fix typing hinting issue on code

This commit is contained in:
Eduardo Chiarotti
2024-05-16 19:48:42 -03:00
parent 2520f389f2
commit d34c2a2672
2 changed files with 11 additions and 10 deletions

View File

@@ -1,11 +1,10 @@
import inspect
import yaml
import os
from pathlib import Path
from pydantic import ConfigDict
import yaml
from dotenv import load_dotenv
from pydantic import ConfigDict
load_dotenv()
@@ -13,7 +12,7 @@ load_dotenv()
def CrewBase(cls):
class WrappedClass(cls):
model_config = ConfigDict(arbitrary_types_allowed=True)
is_crew_class: bool = True
is_crew_class: bool = True # type: ignore
base_directory = None
for frame_info in inspect.stack():

View File

@@ -38,9 +38,10 @@ class AgentTools(BaseModel):
):
"""Useful to delegate a specific task to a co-worker passing all necessary context and names."""
coworker = coworker or kwargs.get("co_worker") or kwargs.get("co-worker")
is_list = coworker.startswith("[") and coworker.endswith("]")
if is_list:
coworker = coworker[1:-1].split(",")[0]
if coworker is not None:
is_list = coworker.startswith("[") and coworker.endswith("]")
if is_list:
coworker = coworker[1:-1].split(",")[0]
return self._execute(coworker, task, context)
def ask_question(
@@ -48,9 +49,10 @@ class AgentTools(BaseModel):
):
"""Useful to ask a question, opinion or take from a co-worker passing all necessary context and names."""
coworker = coworker or kwargs.get("co_worker") or kwargs.get("co-worker")
is_list = coworker.startswith("[") and coworker.endswith("]")
if is_list:
coworker = coworker[1:-1].split(",")[0]
if coworker is not None:
is_list = coworker.startswith("[") and coworker.endswith("]")
if is_list:
coworker = coworker[1:-1].split(",")[0]
return self._execute(coworker, question, context)
def _execute(self, agent, task, context):