Arcana::AI::Chat::Response
Constructors
Parse from an OpenAI-compatible JSON response body.
Instance methods
Prompt caching tokens. cache_read_tokens is also OpenAI's usage.prompt_tokens_details.cached_tokens (the part of prompt_tokens served from the cache).
Prompt caching tokens. cache_read_tokens is also OpenAI's usage.prompt_tokens_details.cached_tokens (the part of prompt_tokens served from the cache).
Retries the call needed (rate limits, server or network errors)
and the time spent waiting between tries. See RetryPolicy.
Retries the call needed (rate limits, server or network errors)
and the time spent waiting between tries. See RetryPolicy.
Server-side tool results (e.g. web_search results).
Chain-of-thought / reasoning fields, when the model supports them.
thinking_content — the raw reasoning text if the provider
surfaces it (Anthropic extended thinking, Gemini with
includeThoughts). OpenAI o-series never surfaces the reasoning
itself, so this stays nil for OpenAI even when reasoning ran.
reasoning_tokens — the token count the model spent on
reasoning, when reported (OpenAI's
completion_tokens_details.reasoning_tokens, Anthropic's cached
thinking budget). Useful for cost tracking.
Chain-of-thought / reasoning fields, when the model supports them.
thinking_content — the raw reasoning text if the provider
surfaces it (Anthropic extended thinking, Gemini with
includeThoughts). OpenAI o-series never surfaces the reasoning
itself, so this stays nil for OpenAI even when reasoning ran.
reasoning_tokens — the token count the model spent on
reasoning, when reported (OpenAI's
completion_tokens_details.reasoning_tokens, Anthropic's cached
thinking budget). Useful for cost tracking.
Find the first tool call matching a given function name.
Did the model return any tool calls? This response with the retry record of the call that produced it.