mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-10 16:48:30 +00:00
fix types and linter
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
from typing import Optional
|
||||
|
||||
from crewai.tools.base_tool import BaseTool
|
||||
from crewai.utilities import I18N
|
||||
from pydantic import BaseModel, Field
|
||||
from typing import Optional
|
||||
|
||||
i18n = I18N()
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import json
|
||||
import os
|
||||
from typing import Dict, Optional
|
||||
from typing import Dict, Optional, Union
|
||||
|
||||
from pydantic import BaseModel, Field, PrivateAttr, model_validator
|
||||
|
||||
@@ -41,8 +41,8 @@ class I18N(BaseModel):
|
||||
def errors(self, error: str) -> str:
|
||||
return self.retrieve("errors", error)
|
||||
|
||||
def tools(self, error: str) -> str:
|
||||
return self.retrieve("tools", error)
|
||||
def tools(self, tool: str) -> Union[str, Dict[str, str]]:
|
||||
return self.retrieve("tools", tool)
|
||||
|
||||
def retrieve(self, kind, key) -> str:
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user