crewAI-examples icon indicating copy to clipboard operation
crewAI-examples copied to clipboard

How to change the correct language name

Open Beck221 opened this issue 1 year ago • 2 comments

In Class Crew, I can see there is a parameter named langague. And it's default value is 'en'. So if I want to change to support Chinese, what's the correct value for Chinese to define here? language: str = Field( default="en", description="Language used for the crew, defaults to English.", ) I tried to change it to 'zh' but it failed with below error. Could someone help look into this issue? crew = Crew( agents=[ city_selector_agent, local_expert_agent, travel_concierge_agent ], tasks=[identify_task, gather_task, plan_task], language='zh', verbose=True ) ERROR: 2024-08-28 16:12:22.267 Uncaught app exception Traceback (most recent call last): File "/home/beck_z/.conda/envs/beck_zb/lib/python3.11/site-packages/crewai/utilities/i18n.py", line 24, in load_translation with open(prompts_path, "r") as f: ^^^^^^^^^^^^^^^^^^^^^^^ FileNotFoundError: [Errno 2] No such file or directory: '/home/beck_z/.conda/envs/beck_zb/lib/python3.11/site-packages/crewai/utilities/../translations/zh.json'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/beck_z/.conda/envs/beck_zb/lib/python3.11/site-packages/streamlit/runtime/scriptrunner/exec_code.py", line 85, in exec_func_with_error_handling result = func() ^^^^^^ File "/home/beck_z/.conda/envs/beck_zb/lib/python3.11/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 576, in code_to_exec exec(code, module.dict) File "/home/beck_z/crewAI-examples/trip_planner/trip_planner_chn.py", line 126, in main() File "/home/beck_z/crewAI-examples/trip_planner/trip_planner_chn.py", line 117, in main result = trip_crew.run() ^^^^^^^^^^^^^^^ File "/home/beck_z/crewAI-examples/trip_planner/trip_planner_chn.py", line 56, in run result = crew.kickoff() ^^^^^^^^^^^^^^ File "/home/beck_z/.conda/envs/beck_zb/lib/python3.11/site-packages/crewai/crew.py", line 182, in kickoff agent.i18n = I18N(language=self.language) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/beck_z/.conda/envs/beck_zb/lib/python3.11/site-packages/pydantic/main.py", line 171, in init self.pydantic_validator.validate_python(data, self_instance=self) File "/home/beck_z/.conda/envs/beck_zb/lib/python3.11/site-packages/crewai/utilities/i18n.py", line 27, in load_translation raise ValidationError( ^^^^^^^^^^^^^^^^ TypeError: No constructor defined

Beck221 avatar Aug 28 '24 16:08 Beck221

FileNotFoundError: [Errno 2] No such file or directory: '/home/beck_z/.conda/envs/beck_zb/lib/python3.11/site-packages/crewai/utilities/../translations/zh.json

This file is missing

theCyberTech avatar Sep 03 '24 06:09 theCyberTech

This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Oct 04 '24 02:10 github-actions[bot]

This issue was closed because it has been stale for 5 days with no activity.

github-actions[bot] avatar Oct 10 '24 02:10 github-actions[bot]