crewAI icon indicating copy to clipboard operation
crewAI copied to clipboard

Multilingual support

Open abdalladorrah opened this issue 1 year ago • 4 comments

Hello, i tried to use crewAI to generate Arabic content , although the llm understand and generate Arabic text, but the core of crewAI does not support that, and it leads to nothing response.

I need an arabian version how can I get that? I can help in translation and supporting Arabic if it in my range of knowledge Thanks

abdalladorrah avatar Apr 29 '24 11:04 abdalladorrah

Hello, i tried to use crewAI to generate Arabic content , although the llm understand and generate Arabic text, but the core of crewAI does not support that, and it leads to nothing response.

I need an arabian version how can I get that? I can help in translation and supporting Arabic if it in my range of knowledge Thanks

I have the same problem as you... Is there any way to get around that with crewai??

atb29 avatar May 06 '24 19:05 atb29

Hello, i tried to use crewAI to generate Arabic content , although the llm understand and generate Arabic text, but the core of crewAI does not support that, and it leads to nothing response. I need an arabian version how can I get that? I can help in translation and supporting Arabic if it in my range of knowledge Thanks

I have the same problem as you... Is there any way to get around that with crewai??

there is update in crewAI website about language, but i am still in search for how to use it

abdalladorrah avatar May 12 '24 09:05 abdalladorrah

We are shipping in this new version I'm writing new docs for it, but you will be bale to provide your own translations now! I'll make sure to add the link to the docs here once it's done

joaomdmoura avatar May 12 '24 16:05 joaomdmoura

you

Is it the file of en.json located in translation folder?

abdalladorrah avatar May 12 '24 20:05 abdalladorrah

There is an "en.json" file inside "C:\myproject\crew\venv\Lib\site-packages\crewai\translations", I copied that file into the same folder and changed its name to "tr.json" and translated the values to Turkish. Later changed the below part in the i18n.py file by adding "utf-8" encoding so it does not throw an exception when it sees a special character:

 try:
            if self.language_file:
                with open(self.language_file, "r", encoding='utf-8') as f:
                    self._translations = json.load(f)
            else:
                dir_path = os.path.dirname(os.path.realpath(__file__))
                prompts_path = os.path.join(
                    dir_path, f"../translations/{self.language}.json"
                )

                with open(prompts_path, "r", encoding='utf-8') as f:
                    self._translations = json.load(f)

Even though the project started without a problem, it failed when using a tool. This approach might work with other languages, other translations or other crew.ai implementations. In my opinion, because these translation JSONs include crew.ai's inner working prompts, they should be tested thoroughly and later added by crew.ai. I prefer using English prompts with "answer in " sentences in all agent and task prompts for now because it works without a problem and LLMs perform better with English prompts.

cbarkinozer avatar Jul 04 '24 12:07 cbarkinozer

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 Aug 17 '24 12:08 github-actions[bot]

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

github-actions[bot] avatar Aug 23 '24 12:08 github-actions[bot]