utils
Classes
CodeForm
Bases: BaseModel
Form for code related operations.
Used by:
- Code Reference routers utils Classes UtilsClient Functions
MarkdownForm
Bases: BaseModel
Form for markdown to HTML conversion.
Used by:
- Code Reference routers utils Classes UtilsClient Functions get_html_from_markdown
ChatForm
Bases: BaseModel
Form structure for chat data, mirroring the backend definition.
Note: The actual PDF endpoint uses ChatTitleMessagesForm from models.chats,
but this class exists in the backend utils.py router file.
Attributes
messages
The list of messages in the chat.
Dict Fields
role(str, required): The role of the message sender. Valid values are "user", "assistant", or "system".content(str or list[dict], required): The content of the message. Can be a string or a list of content blocks with "type" and "text" fields.timestamp(float, optional): UNIX timestamp when the message was created.model(str, optional): Model identifier for assistant messages, only applicable when role is "assistant".