Class AiOrchestratorI18n

java.lang.Object
com.vaadin.flow.component.ai.orchestrator.AiOrchestratorI18n
All Implemented Interfaces:
Serializable

public class AiOrchestratorI18n extends Object implements 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.5
Author:
Vaadin Ltd
See Also:
  • Constructor Details

    • AiOrchestratorI18n

      public AiOrchestratorI18n()
  • Method Details

    • getErrorMessage

      public String 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 null when the built-in default is used
    • setErrorMessage

      public AiOrchestratorI18n setErrorMessage(String errorMessage)
      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 the AiController could 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, or null to use the built-in default
      Returns:
      this instance, for chaining
    • getTimeoutErrorMessage

      public String 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 null when the built-in default is used
    • setTimeoutErrorMessage

      public AiOrchestratorI18n setTimeoutErrorMessage(String timeoutErrorMessage)
      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, or null to use the built-in default
      Returns:
      this instance, for chaining