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

View File

@@ -38,6 +38,7 @@ class AgentTools(BaseModel):
): ):
"""Useful to delegate a specific task to a co-worker passing all necessary context and names.""" """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") coworker = coworker or kwargs.get("co_worker") or kwargs.get("co-worker")
if coworker is not None:
is_list = coworker.startswith("[") and coworker.endswith("]") is_list = coworker.startswith("[") and coworker.endswith("]")
if is_list: if is_list:
coworker = coworker[1:-1].split(",")[0] coworker = coworker[1:-1].split(",")[0]
@@ -48,6 +49,7 @@ class AgentTools(BaseModel):
): ):
"""Useful to ask a question, opinion or take from a co-worker passing all necessary context and names.""" """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") coworker = coworker or kwargs.get("co_worker") or kwargs.get("co-worker")
if coworker is not None:
is_list = coworker.startswith("[") and coworker.endswith("]") is_list = coworker.startswith("[") and coworker.endswith("]")
if is_list: if is_list:
coworker = coworker[1:-1].split(",")[0] coworker = coworker[1:-1].split(",")[0]