Module message

Source

Structs§

Audio
Audio content containing audio data and metadata about it.
Document
Document content containing document data and metadata about it.
Image
Image content containing image data and metadata about it.
Text
Basic text content.
ToolCall
Describes a tool call with an id and function to call, generally produced by a provider.
ToolFunction
Describes a tool function to call with a name and arguments, generally produced by a provider.
ToolResult
Tool result content containing information about a tool call and it’s resulting content.

Enums§

AssistantContent
Describes responses from a provider which is either text or a tool call.
AudioMediaType
Describes the audio media type of the content. Not every provider supports every media type. Convertible to and from MIME type strings.
ContentFormat
Describes the format of the content, which can be base64 or string.
DocumentMediaType
Describes the document media type of the content. Not every provider supports every media type. Includes also programming languages as document types for providers who support code running. Convertible to and from MIME type strings.
ImageDetail
Describes the detail of the image content, which can be low, high, or auto (open-ai specific).
ImageMediaType
Describes the image media type of the content. Not every provider supports every media type. Convertible to and from MIME type strings.
MediaType
Helper enum that tracks the media type of the content.
Message
A message represents a run of input (user) and output (assistant). Each message type (based on it’s role) can contain a atleast one bit of content such as text, images, audio, documents, or tool related information. While each message type can contain multiple content, most often, you’ll only see one content type per message (an image w/ a description, etc).
MessageError
Error type to represent issues with converting messages to and from specific provider messages.
ToolResultContent
Describes the content of a tool result, which can be text or an image.
UserContent
Describes the content of a message, which can be text, a tool result, an image, audio, or a document. Dependent on provider supporting the content type. Multimedia content is generally base64 (defined by it’s format) encoded but additionally supports urls (for some providers).

Traits§

MimeType
Trait for converting between MIME types and media types.