claude/json/encode
Values
pub fn content_block_param(
block: content.ContentBlockParam,
) -> json.Json
Encode a ContentBlockParam for the API request.
pub fn create_params(
model model: String,
max_tokens max_tokens: Int,
messages messages: List(message.MessageParam),
tools tools: tool.Registry,
system system: option.Option(String),
tool_choice tc: option.Option(tool.ToolChoice),
thinking thinking: option.Option(Int),
stream stream: Bool,
) -> json.Json
Encode the full Messages API request body.
Only includes optional fields when they have values. Does not include an empty tools array. Includes stream: true only when stream is True.
pub fn message_param(msg: message.MessageParam) -> json.Json
Encode a MessageParam for the API request.
pub fn tool_choice(choice: tool.ToolChoice) -> json.Json
Encode a ToolChoice for the API request.