Skip to main content

mo.ui.chat

Create an AI-powered chat interface with conversation history.

Signature

Parameters

Callable
required
Function that takes messages and config, returns response
list[str]
Suggested prompts displayed to user
Callable
Callback when new message is sent
bool
default:"False"
Show temperature/tokens controls
ChatModelConfigDict
Default model configuration
bool | list[str]
default:"False"
Allow file attachments (True for all types, or list of extensions)
int
Maximum height in pixels
bool
default:"False"
Whether chat is disabled

Examples

ChatMessage Structure

Messages have:
  • role: “user” or “assistant”
  • content: Message text
  • attachments: List of attached files
  • timestamp: When message was sent
Use chat.value to access the full conversation history.