API reference: @salmonui/chat/conversation
ConversationApiinterface
import type { ConversationApi } from '@salmonui/chat/conversation';interface ConversationApi {
scrollToBottom(options?: {
readonly behavior?: ScrollBehavior;
}): void;
scrollToMessage(id: string, options?: {
readonly focus?: boolean;
}): boolean;
focus(): void;
send(text: string): void;
stop(): void;
regenerate(id: string): void;
readonly element: HTMLDivElement | null;
}
| Name | Signature | Description |
|---|---|---|
scrollToBottom | scrollToBottom(options?: {
readonly behavior?: ScrollBehavior;
}): void; | Scrolls to the latest message. |
scrollToMessage | scrollToMessage(id: string, options?: {
readonly focus?: boolean;
}): boolean; | Scrolls a message into view (mounted or virtualized) and returns whether it exists. |
focus | focus(): void; | Focuses the composer input. |
send | send(text: string): void; | Sends |
stop | stop(): void; | Aborts a pending adapter response. |
regenerate | regenerate(id: string): void; | Assistant variant: runs the adapter again for response |
element | readonly element: HTMLDivElement | null; | The root element. |