Proto.Content_blockContent blocks for Claude messages wire format.
This module defines the wire format types for content blocks that can appear in Claude messages, including text, tool use, tool results, and thinking blocks.
module Text : sig ... endPlain text content blocks.
module Tool_use : sig ... endTool invocation requests from the assistant.
module Tool_result : sig ... endResults from tool invocations.
module Thinking : sig ... endAssistant's internal reasoning blocks.
type t = | Text of Text.t| Tool_use of Tool_use.t| Tool_result of Tool_result.t| Thinking of Thinking.tThe type of content blocks, which can be text, tool use, tool result, or thinking.
*)jsont is the Jsont codec for content blocks. Use Jsont.Json.encode jsont and Jsont.Json.decode jsont for serialization. Use Jsont.pp_value jsont () for pretty-printing.
val text : string -> ttext s creates a text content block.
val tool_use : id:string -> name:string -> input:Jsont.json -> ttool_use ~id ~name ~input creates a tool use content block.
val tool_result :
tool_use_id:string ->
?content:Jsont.json ->
?is_error:bool ->
unit ->
ttool_result ~tool_use_id ?content ?is_error () creates a tool result content block. Content can be a string or an array of content blocks.
val thinking : thinking:string -> signature:string -> tthinking ~thinking ~signature creates a thinking content block.