> Markdown version of [Component Interfaces](https://vaadin.com/docs/latest/flow/ai-support/component-interfaces). Section index: [llms.txt](https://vaadin.com/docs/latest/flow/llms.txt)

# Component Interfaces

The orchestrator’s builder accepts both standard Vaadin components and custom implementations of the AI interfaces. This allows you to swap in custom UI components without changing the orchestrator wiring.

## <a id="ai-input"></a>AI Input

`AIInput` defines the contract for text input components. It has a single method:

- `addSubmitListener(SerializableConsumer<String>)` — registers a listener that receives the submitted text.

The builder accepts either a [`MessageInput`](https://vaadin.com/docs/latest/components/message-input.md) directly or any `AIInput` implementation.

## <a id="ai-message-list"></a>AI Message List

`AIMessageList` defines the contract for displaying messages. Key methods:

- `addMessage(String text, String userName, List<AIAttachment> attachments)` — creates and adds a message, returning an `AIMessage` handle.

- `addAttachmentClickListener(AttachmentClickCallback)` — registers a handler for attachment click events.

- `showTypingIndicator(String userName)` / `hideTypingIndicator(String userName)` — show and hide an indication that the given participant is working on a response (new in undefined). The orchestrator calls the first when a turn starts and adds the assistant message only when the first part of the response arrives, so an implementation that wants to show progress before that overrides it. The second is called before the assistant message is added, and when a turn ends without a response. Both are `default` no-ops, so a custom implementation that doesn’t override them keeps working.

The builder accepts either a [`MessageList`](https://vaadin.com/docs/latest/components/message-list.md) directly or any `AIMessageList` implementation. With a `MessageList`, the orchestrator adds and removes only its own entry among the list’s [typing users](https://vaadin.com/docs/latest/components/message-list.md#typing-indicator). When the application has bound the typing users to a signal, they can’t be set, and the orchestrator leaves the indicator to the application.

## <a id="ai-message"></a>AI Message

`AIMessage` represents a single message. It is returned by `AIMessageList.addMessage()` and supports:

- `getText()` / `setText(String)` — read or replace the message text.

- `appendText(String)` — append a token during streaming. The orchestrator calls this as tokens arrive from the LLM.

- `getTime()` / `setTime(Instant)` — message timestamp.

- `getUserName()` — the sender display name.

## <a id="ai-file-receiver"></a>AI File Receiver

`AIFileReceiver` defines the contract for file upload components. It has a single method:

- `takeAttachments()` — returns all pending attachments and clears the internal state. The orchestrator calls this when the user submits a message.

The builder accepts [`UploadManager`](https://vaadin.com/docs/latest/components/upload.md), [`Upload`](https://vaadin.com/docs/latest/components/upload.md), or any `AIFileReceiver` implementation.

The orchestrator installs its own in-memory upload handler on [`UploadManager`](https://vaadin.com/docs/latest/components/upload.md) or [`Upload`](https://vaadin.com/docs/latest/components/upload.md). The component must not have an upload handler already set.
