Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to change the correct language name #156

Open
Beck221 opened this issue Aug 28, 2024 · 1 comment
Open

How to change the correct language name #156

Beck221 opened this issue Aug 28, 2024 · 1 comment

Comments

@Beck221
Copy link

Beck221 commented Aug 28, 2024

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

@theCyberTech
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants