Skip to main content

context_usage_from_control_response

Function context_usage_from_control_response 

Source
pub fn context_usage_from_control_response(
    frame: &Value,
) -> Option<AgentContextUsage>
Expand description

The usage in a get_context_usage answer, or None for any other frame, an error answer (a CLI without the request) or one missing isAutoCompactEnabled. Shape: {type: control_response, response: {subtype: success, request_id, response: {model, maxTokens, autoCompactThreshold?, isAutoCompactEnabled, ...}}}.