Skip to main content

content_string

Function content_string 

Source
pub fn content_string(value: &Value) -> String
Expand description

Renders a JSON value as the text handed to the model (an initial input or a tool_result content string).

A JSON string renders as its bare text; anything else renders as canonical JSON. The canonical form matters: this text flows into the next model request, the request is hashed, and the hash must reproduce on replay, so the rendering cannot depend on map iteration order.