mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-10 08:38:30 +00:00
Feat: Add Ruff to improve linting/formatting (#588)
* fix: fix test actually running * fix: fix test to not send request to openai * fix: fix linting to remove cli files * fix: exclude only files that breaks black * fix: Fix all Ruff checkings on the code and Fix Test with repeated name * fix: Change linter name on yml file * feat: update pre-commit * feat: remove need for isort on the code * feat: remove black linter * feat: update tests yml to try to fix the tests gh action
This commit is contained in:
committed by
GitHub
parent
04b4191de5
commit
aeba64feaf
@@ -21,14 +21,14 @@ class I18N(BaseModel):
|
||||
self._prompts = json.load(f)
|
||||
else:
|
||||
dir_path = os.path.dirname(os.path.realpath(__file__))
|
||||
prompts_path = os.path.join(dir_path, f"../translations/en.json")
|
||||
prompts_path = os.path.join(dir_path, "../translations/en.json")
|
||||
|
||||
with open(prompts_path, "r") as f:
|
||||
self._prompts = json.load(f)
|
||||
except FileNotFoundError:
|
||||
raise Exception(f"Prompt file '{self.prompt_file}' not found.")
|
||||
except json.JSONDecodeError:
|
||||
raise Exception(f"Error decoding JSON from the prompts file.")
|
||||
raise Exception("Error decoding JSON from the prompts file.")
|
||||
|
||||
if not self._prompts:
|
||||
self._prompts = {}
|
||||
@@ -47,5 +47,5 @@ class I18N(BaseModel):
|
||||
def retrieve(self, kind, key) -> str:
|
||||
try:
|
||||
return self._prompts[kind][key]
|
||||
except:
|
||||
except Exception as _:
|
||||
raise Exception(f"Prompt for '{kind}':'{key}' not found.")
|
||||
|
||||
Reference in New Issue
Block a user