chats
Classes
ChatModel
Bases: BaseModel
Represents a chat conversation in the Open WebUI system.
This model stores the core chat data including the conversation history, metadata, and status flags like archived or pinned.
Attributes
chat
The full chat content and history.
Contains the messages, model configuration, and other conversation state. This dictionary represents the complete chat structure used throughout the Open WebUI system.
Dict Fields
title(str, optional): The title of the chat conversationname(str, optional): Alternative name for the chatdescription(str, optional): Description of the chattags(list[str], optional): List of tag names associated with this chathistory(dict, required): Contains the conversation history with:currentId(str, required): ID of the current message in the conversationmessages(dict[str, object], required): Map of message IDs to message objects
models(list[str], optional): List of model IDs used in this chatparams(dict, optional): Model parameters and configurationoptions(dict, optional): Additional chat options and settingstimestamp(int, optional): Creation timestamp (Unix epoch)originalChatId(str, optional): ID of the original chat if this is a clonebranchPointMessageId(str, optional): Message ID where branching occurred for cloned chats
The chat dictionary is the core data structure that stores all conversation state,
message history, and metadata. It's used for creating, updating, and managing chats.
share_id
ID of the shared version of this chat, if shared.
If set, this points to a separate read-only copy of the chat accessible via sharing.
meta
Additional metadata for the chat.
The meta dictionary stores various metadata about the chat, primarily used for organizational and filtering purposes. This field is used extensively throughout the Open WebUI system for tagging, searching, and managing chats.
Dict Fields
tags(list[str], optional): List of tag identifiers associated with this chat for categorization and filtering. Tags are used throughout the system for organizing chats and enabling tag-based search functionality. When chats are archived, tags may be automatically cleaned up if no other chats use them. Tag names are normalized to lowercase with spaces replaced by underscores (e.g., "my tag" becomes "my_tag").
The meta field is preserved when chats are cloned, shared, or imported, maintaining the organizational structure. It plays a crucial role in the chat management system, particularly in tag-based operations.
ChatForm
Bases: BaseModel
Form for creating or updating a chat.
- Code Reference models chats Classes ChatImportForm
- Code Reference routers chats Classes ChatsClient Functions
Attributes
chat
The chat content.
Contains the full conversation state including messages, metadata, and configuration. This dictionary represents the complete chat structure used throughout the Open WebUI system.
Dict Fields
title(str, optional): The title of the chat conversationname(str, optional): Alternative name for the chatdescription(str, optional): Description of the chattags(list[str], optional): List of tag names associated with this chathistory(dict, required): Contains the conversation history with:currentId(str, required): ID of the current message in the conversationmessages(dict[str, object], required): Map of message IDs to message objects
models(list[str], optional): List of model IDs used in this chatparams(dict, optional): Model parameters and configurationoptions(dict, optional): Additional chat options and settingstimestamp(int, optional): Creation timestamp (Unix epoch)originalChatId(str, optional): ID of the original chat if this is a clonebranchPointMessageId(str, optional): Message ID where branching occurred for cloned chats
The chat dictionary is the core data structure that stores all conversation state,
message history, and metadata. It's used for creating, updating, and managing chats.
ChatImportForm
Bases: ChatForm
Form for importing a chat, including metadata and timestamps.
This form extends ChatForm to include additional metadata and timestamps
for chat import operations. The chat attribute contains the complete
conversation state including messages, metadata, and configuration.
- Code Reference models chats Classes ChatsImportForm Attributes chats
Attributes
meta
Metadata for the chat import operation.
Dict Fields
tags(list[str], optional): List of tag names associated with this chat for categorization and filtering
The meta dictionary stores additional metadata about the chat, primarily used for organizational purposes. The most common and well-documented key is 'tags', which allows chats to be categorized and filtered.
ChatsImportForm
Bases: BaseModel
Form for importing multiple chats at once.
- Code Reference routers chats Classes ChatsClient Functions import_chats
Attributes
ChatTitleMessagesForm
Bases: BaseModel
Form containing a title and messages, used for utility operations like PDF generation.
- Code Reference routers utils Classes UtilsClient Functions download_chat_as_pdf
Attributes
messages
List of message objects from the chat history.
Dict Fields
role(str, required): The role of the message sender, typically 'user' or 'assistant'content(str, required): The text content of the messagetimestamp(float, optional): UNIX timestamp (seconds since epoch) when the message was createdmodel(str, optional): The model identifier used for generating assistant messages (e.g., 'gpt-4', 'claude-3')
This list contains the complete conversation history in chronological order, used for PDF generation and other export operations. Each message represents one turn in the conversation between user and assistant.
ChatTitleForm
ChatResponse
Bases: BaseModel
Response model for chat operations.
Attributes
chat
The full chat content and history.
Contains the messages, model configuration, and other conversation state. This dictionary represents the complete chat structure used throughout the Open WebUI system.
Dict Fields
title(str, optional): The title of the chat conversationname(str, optional): Alternative name for the chatdescription(str, optional): Description of the chattags(list[str], optional): List of tag names associated with this chathistory(dict, required): Contains the conversation history with:currentId(str, required): ID of the current message in the conversationmessages(dict[str, object], required): Map of message IDs to message objects
models(list[str], optional): List of model IDs used in this chatparams(dict, optional): Model parameters and configurationoptions(dict, optional): Additional chat options and settingstimestamp(int, optional): Creation timestamp (Unix epoch)originalChatId(str, optional): ID of the original chat if this is a clonebranchPointMessageId(str, optional): Message ID where branching occurred for cloned chats
The chat dictionary is the core data structure that stores all conversation state,
message history, and metadata. It's used for creating, updating, and managing chats.
meta
Additional metadata for the chat.
The meta dictionary stores various metadata about the chat, primarily used for organizational and filtering purposes. This field is used extensively throughout the Open WebUI system for tagging, searching, and managing chats.
Dict Fields
tags(list[str], optional): List of tag identifiers associated with this chat for categorization and filtering. Tags are used throughout the system for organizing chats and enabling tag-based search functionality. When chats are archived, tags may be automatically cleaned up if no other chats use them. Tag names are normalized to lowercase with spaces replaced by underscores (e.g., "my tag" becomes "my_tag").
The meta field is preserved when chats are cloned, shared, or imported, maintaining the organizational structure. It plays a crucial role in the chat management system, particularly in tag-based operations.
ChatTitleIdResponse
Bases: BaseModel
Lightweight chat response containing only essential metadata.
Used for list views to reduce payload size.
- Code Reference routers chats Classes ChatsClient Functions
TagForm
Bases: BaseModel
Form for adding a tag to a chat.
- Code Reference models chats Classes TagFilterForm
- Code Reference routers chats Classes ChatsClient Functions
TagFilterForm
Bases: TagForm
Form for filtering chats by tag.
- Code Reference routers chats Classes ChatsClient Functions get_by_tags
MessageForm
Bases: BaseModel
Form for updating a specific message content.
- Code Reference routers chats Classes ChatsClient Functions update_message
EventForm
Bases: BaseModel
Form for sending an event related to a specific message.
Used to trigger socket events for a message.
- Code Reference routers chats Classes ChatsClient Functions send_message_event
Attributes
data
The data payload for the event.
Contains event-specific data that varies based on the event type. This dictionary holds the actual content and metadata for the event being triggered.
Dict Fields
content(str, optional): Text content for message-related events (used in 'message' and 'replace' event types)embeds(list, optional): List of embed objects for embed-related eventsfiles(list, optional): List of file objects for file-related eventsstatus(dict, optional): Status information for status-related eventstype(str, optional): Additional type specification for certain event typessource(dict, optional): Source information for source/citation eventscitation(dict, optional): Citation information for source/citation events
The data structure is event-type specific:
- For 'message' events: contains content field with additional message text
- For 'replace' events: contains content field with replacement message text
- For 'embeds' events: contains embeds field with list of embed objects
- For 'files' events: contains files field with list of file objects
- For 'status' events: contains status information in the data object
- For 'source'/'citation' events: contains source/citation data with optional type field
Event types discovered in backend code: - 'status': Updates message status information - 'message': Appends content to existing messages - 'replace': Replaces entire message content - 'embeds': Adds embed objects to messages - 'files': Adds file objects to messages - 'source'/'citation': Handles source and citation data
The data field is passed through the event emission system and processed based on the event type.
CloneForm
Bases: BaseModel
Form for cloning a chat.
- Code Reference routers chats Classes ChatsClient Functions clone
ChatFolderIdForm
Bases: BaseModel
Form for moving a chat to a folder.
- Code Reference routers chats Classes ChatsClient Functions update_folder