Skip to main content

Module message

Module message 

Source
Expand description

OpenAI-compatible chat message types.

Structs§

FunctionCall
ImagePart
One picture attached to a message (#346).
Message
ToolCall

Enums§

Role

Constants§

MAX_PICTURE_BYTES
What one picture may weigh on the wire: the request body and every later turn’s history.
MAX_UPLOAD_BYTES
What may be attached (#499). A camera photo is far over the wire limit and is exactly what someone wants to send; the original is kept on disk and a copy under MAX_PICTURE_BYTES is what the request carries. This is the absolute ceiling — past it the refusal stands, because a 200 MB file is not a picture anyone meant to attach.
PICTURE_TYPES
The picture types a message may carry, and how big one may be once decoded.

Functions§

data_url
Bytes to a data: URL — the other half of [decode_base64], and the only encoder this build has. Hand-rolled for the same reason: one picture per attach, not a hot path.