Sycophant.Reasoning (sycophant v0.5.0)

Copy Markdown

Reasoning output from an LLM response.

When a model supports extended thinking (e.g. with the :reasoning_effort parameter), the chain-of-thought is available in response.reasoning.content as a list of Content.Thinking structs. Each thinking block may carry :text (raw chain-of-thought), :summary (condensed summary), or both, depending on the provider.

The :encrypted_content field carries an opaque blob for multi-turn reasoning continuity (Anthropic redacted_thinking, OpenAI encrypted_content).

Each entry in :content maps directly to a Content.Thinking part, and :encrypted_content maps to a Content.RedactedThinking part when building assistant messages for multi-turn conversations.

Examples

iex> alias Sycophant.Message.Content.Thinking
iex> %Sycophant.Reasoning{content: [%Thinking{text: "Let me think..."}]}
#Sycophant.Reasoning<%{content: [%{text: "Let me think..."}]}>

Summary

Types

t()

@type t() :: %Sycophant.Reasoning{
  __type__: binary(),
  content: [
    %Sycophant.Message.Content.Thinking{
      __type__: binary(),
      id: nil | binary(),
      signature: nil | binary(),
      summary: nil | binary(),
      text: nil | binary(),
      type: binary()
    }
  ],
  encrypted_content: nil | binary(),
  id: nil | binary()
}

Functions

t()