Class AiOrchestratorI18n
java.lang.Object
com.vaadin.flow.component.ai.orchestrator.AiOrchestratorI18n
- All Implemented Interfaces:
Serializable
The texts the
AiOrchestrator shows in the message list on its own,
such as the message that replaces the assistant's answer when a turn fails.
Use to localize them; any text left null falls back to the built-in
English default.
The names shown as the authors of the messages are not part of this class.
Set them with AiOrchestrator.Builder.withUserName(String) and
AiOrchestrator.Builder.withAssistantName(String).
- Since:
- 25.4
- Author:
- Vaadin Ltd
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the message shown as the assistant's message when a turn fails for a reason other than a timeout.Gets the message shown as the assistant's message when the LLM does not finish its answer in time.setErrorMessage(String errorMessage) Sets the message shown as the assistant's message when a turn fails for a reason other than a timeout.setTimeoutErrorMessage(String timeoutErrorMessage) Sets the message shown as the assistant's message when the LLM does not finish its answer in time.
-
Constructor Details
-
AiOrchestratorI18n
public AiOrchestratorI18n()
-
-
Method Details
-
getErrorMessage
Gets the message shown as the assistant's message when a turn fails for a reason other than a timeout.- Returns:
- the error message, or
nullwhen the built-in default is used
-
setErrorMessage
Sets the message shown as the assistant's message when a turn fails for a reason other than a timeout. The message replaces any part of the answer that was already shown. When the answer was complete but theAiControllercould not apply it, the message is shown after the answer instead.The default is
"An error occurred. Please try again.".- Parameters:
errorMessage- the error message, ornullto use the built-in default- Returns:
- this instance, for chaining
-
getTimeoutErrorMessage
Gets the message shown as the assistant's message when the LLM does not finish its answer in time.- Returns:
- the timeout error message, or
nullwhen the built-in default is used
-
setTimeoutErrorMessage
Sets the message shown as the assistant's message when the LLM does not finish its answer in time. The message replaces any part of the answer that was already shown.The default is
"Request timed out. Please try again.".- Parameters:
timeoutErrorMessage- the timeout error message, ornullto use the built-in default- Returns:
- this instance, for chaining
-