Skip to main content

decode_ollama_response

Function decode_ollama_response 

Source
pub fn decode_ollama_response(
    runner: Symbol,
    model: &str,
    body: &[u8],
    include_raw: bool,
) -> Result<Expr>
Expand description

Decodes a non-streamed Ollama JSON response body into a canonical model-response transcript attributed to runner and model.

Extracts the response text and any token-usage counts; when include_raw is set, the original JSON is also attached as a raw-provider-response field.