Skip to main content

Module message

Module message 

Source
Expand description

Message types for LLM interactions.

Provides role-based messages compatible with OpenAI’s message format.

Structs§

ImageUrlContent
Image URL content with optional detail level.
Message
A message in a conversation.
ParseRoleError
Error returned when parsing an unknown message role string.

Enums§

ContentPart
A single content part in a multimodal message.
MessageContent
Content of a message — either plain text or a list of multimodal parts.
Role
Role of a message in a conversation.

Functions§

parse_messages_json
Parses a JSON string containing an array of message objects.
parse_messages_value
Parses a JSON value containing an array of message objects into typed messages.