Class AiOrchestrator.Builder
java.lang.Object
com.vaadin.flow.component.ai.orchestrator.AiOrchestrator.Builder
- Enclosing class:
AiOrchestrator
Builder for AiOrchestrator.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the orchestrator.withAiName(String aiName) Sets the display name for AI assistant messages in the message list.withFileReceiver(AiFileReceiver fileReceiver) Sets the file receiver component for file uploads.withFileReceiver(com.vaadin.flow.component.upload.UploadManager uploadManager) Sets the file receiver component using a Flow UploadManager component.Sets the input component.withInput(com.vaadin.flow.component.messages.MessageInput messageInput) Sets the input component using a Flow MessageInput component.withMessageList(AiMessageList messageList) Sets the message list component.withMessageList(com.vaadin.flow.component.messages.MessageList messageList) Sets the message list component using a Flow MessageList component.Sets the objects containing vendor-specific tool-annotated methods that will be available to the LLM.withUserName(String userName) Sets the display name for user messages in the message list.
-
Method Details
-
withMessageList
Sets the message list component.- Parameters:
messageList- the message list- Returns:
- this builder
-
withMessageList
public AiOrchestrator.Builder withMessageList(com.vaadin.flow.component.messages.MessageList messageList) Sets the message list component using a Flow MessageList component.- Parameters:
messageList- the Flow MessageList component- Returns:
- this builder
-
withInput
Sets the input component.- Parameters:
input- the input component- Returns:
- this builder
-
withInput
public AiOrchestrator.Builder withInput(com.vaadin.flow.component.messages.MessageInput messageInput) Sets the input component using a Flow MessageInput component.- Parameters:
messageInput- the Flow MessageInput component- Returns:
- this builder
-
withFileReceiver
Sets the file receiver component for file uploads.- Parameters:
fileReceiver- the file receiver- Returns:
- this builder
-
withFileReceiver
public AiOrchestrator.Builder withFileReceiver(com.vaadin.flow.component.upload.UploadManager uploadManager) Sets the file receiver component using a Flow UploadManager component.- Parameters:
uploadManager- the Flow UploadManager component- Returns:
- this builder
-
withTools
Sets the objects containing vendor-specific tool-annotated methods that will be available to the LLM.For LangChain4j, use
@dev.langchain4j.agent.tool.Tool. For Spring AI, use@org.springframework.ai.tool.annotation.Tool.- Parameters:
tools- the objects containing tool methods- Returns:
- this builder
-
withUserName
Sets the display name for user messages in the message list.This name is shown as the author of messages sent by the user. If not set, defaults to "You".
- Parameters:
userName- the display name for user messages, notnull- Returns:
- this builder
-
withAiName
Sets the display name for AI assistant messages in the message list.This name is shown as the author of messages generated by the AI. If not set, defaults to "Assistant".
- Parameters:
aiName- the display name for AI messages, notnull- Returns:
- this builder
-
build
Builds the orchestrator.- Returns:
- the configured orchestrator
-