Module Message.Content_part

module Cache_control : sig ... end

Anthropic-style prompt-cache annotation. Attach to a content part and successive identical-prefix requests will hit the cache, yielding a non-zero usage.prompt_tokens_details.cached_tokens.

module Text : sig ... end
module Image_url : sig ... end
module File : sig ... end
module Input_audio : sig ... end
module Video_url : sig ... end
type t =
  1. | Text of Text.t
  2. | Image_url of Image_url.t
  3. | File of File.t
  4. | Input_audio of Input_audio.t
  5. | Video_url of Video_url.t
include Sexplib0.Sexpable.S with type t := t
val t_of_sexp : Sexplib0__.Sexp.t -> t
val sexp_of_t : t -> Sexplib0__.Sexp.t
val text : ?cache_control:Cache_control.t -> string -> t
val image_base64 : ?cache_control:Cache_control.t -> mime_type:string -> data:string -> unit -> t

mime_type should be e.g. "image/jpeg", "image/png", "image/webp", "image/gif"

val file : ?cache_control:Cache_control.t -> filename:string -> file_data:string -> unit -> t

file_data can be either a URL (for publicly accessible files) or a data URL like "data:application/pdf;base64,..." for local files

val audio : ?cache_control:Cache_control.t -> format:string -> data:string -> unit -> t

data is base64-encoded audio bytes (no data: prefix); format is e.g. "wav", "mp3".

val video_url : ?cache_control:Cache_control.t -> url:string -> unit -> t
val video_base64 : ?cache_control:Cache_control.t -> mime_type:string -> data:string -> unit -> t