Fix issue #2528: Restore language option in crew configuration

Co-Authored-By: Joe Moura <joao@crewai.com>
This commit is contained in:
Devin AI
2025-04-07 10:29:21 +00:00
parent 918c0589eb
commit ebd0803c0c
4 changed files with 70 additions and 4 deletions

View File

@@ -191,6 +191,14 @@ class Crew(BaseModel):
default=None,
description="Path to the prompt json file to be used for the crew.",
)
language: Optional[str] = Field(
default="en",
description="Language used for the crew, defaults to English.",
)
language_file: Optional[str] = Field(
default=None,
description="Path to the language file to be used for the crew.",
)
output_log_file: Optional[Union[bool, str]] = Field(
default=None,
description="Path to the log file to be saved",
@@ -609,7 +617,7 @@ class Crew(BaseModel):
self._interpolate_inputs(inputs)
self._set_tasks_callbacks()
i18n = I18N(prompt_file=self.prompt_file)
i18n = I18N(prompt_file=self.prompt_file, language=self.language)
for agent in self.agents:
agent.i18n = i18n
@@ -751,7 +759,7 @@ class Crew(BaseModel):
return self._execute_tasks(self.tasks)
def _create_manager_agent(self):
i18n = I18N(prompt_file=self.prompt_file)
i18n = I18N(prompt_file=self.prompt_file, language=self.language)
if self.manager_agent is not None:
self.manager_agent.allow_delegation = True
manager = self.manager_agent