mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-26 16:48:13 +00:00
address i18n
This commit is contained in:
@@ -743,6 +743,7 @@ class Agent(BaseAgent):
|
|||||||
self.agent_executor = self.executor_class(
|
self.agent_executor = self.executor_class(
|
||||||
llm=cast(BaseLLM, self.llm),
|
llm=cast(BaseLLM, self.llm),
|
||||||
task=task,
|
task=task,
|
||||||
|
i18n=self.i18n,
|
||||||
agent=self,
|
agent=self,
|
||||||
crew=self.crew,
|
crew=self.crew,
|
||||||
tools=parsed_tools,
|
tools=parsed_tools,
|
||||||
|
|||||||
@@ -104,6 +104,7 @@ class CrewAgentExecutorFlow(Flow[AgentReActState], CrewAgentExecutorMixin):
|
|||||||
request_within_rpm_limit: Callable[[], bool] | None = None,
|
request_within_rpm_limit: Callable[[], bool] | None = None,
|
||||||
callbacks: list[Any] | None = None,
|
callbacks: list[Any] | None = None,
|
||||||
response_model: type[BaseModel] | None = None,
|
response_model: type[BaseModel] | None = None,
|
||||||
|
i18n: I18N | None = None,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Initialize the flow-based agent executor.
|
"""Initialize the flow-based agent executor.
|
||||||
|
|
||||||
@@ -127,7 +128,7 @@ class CrewAgentExecutorFlow(Flow[AgentReActState], CrewAgentExecutorMixin):
|
|||||||
callbacks: Optional callbacks list.
|
callbacks: Optional callbacks list.
|
||||||
response_model: Optional Pydantic model for structured outputs.
|
response_model: Optional Pydantic model for structured outputs.
|
||||||
"""
|
"""
|
||||||
self._i18n: I18N = get_i18n()
|
self._i18n: I18N = i18n or get_i18n()
|
||||||
self.llm = llm
|
self.llm = llm
|
||||||
self.task = task
|
self.task = task
|
||||||
self.agent = agent
|
self.agent = agent
|
||||||
@@ -286,7 +287,9 @@ class CrewAgentExecutorFlow(Flow[AgentReActState], CrewAgentExecutorMixin):
|
|||||||
|
|
||||||
except OutputParserError as e:
|
except OutputParserError as e:
|
||||||
# Store error context for recovery
|
# Store error context for recovery
|
||||||
self._last_parser_error = e
|
self._last_parser_error = e or OutputParserError(
|
||||||
|
error="Unknown parser error"
|
||||||
|
)
|
||||||
return "parser_error"
|
return "parser_error"
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|||||||
Reference in New Issue
Block a user