LangChain.ChatModels.ReasoningOptions (LangChain v0.6.0)

Copy Markdown View Source

Embedded schema for OpenAI reasoning configuration options.

Used with gpt-5 and o-series models only.

Fields

  • effort - Constrains effort on reasoning. Supported values: :none, :minimal, :low, :medium, :high, :xhigh
  • generate_summary - (Deprecated) A summary of the reasoning performed. Use summary instead.
  • summary - A summary of the reasoning performed. Supported values: :auto, :concise, :detailed

Summary

Functions

Creates a changeset for ReasoningOptions.

Creates a new ReasoningOptions struct.

Creates a new ReasoningOptions struct, raising on error.

Converts the ReasoningOptions to a map suitable for API requests. Returns nil if no options are set.

Returns the list of valid effort values.

Returns the list of valid summary values.

Types

t()

@type t() :: %LangChain.ChatModels.ReasoningOptions{
  effort: term(),
  generate_summary: term(),
  summary: term()
}

Functions

changeset(reasoning, attrs)

@spec changeset(t(), map()) :: Ecto.Changeset.t()

Creates a changeset for ReasoningOptions.

new(attrs \\ %{})

@spec new(map()) :: {:ok, t()} | {:error, Ecto.Changeset.t()}

Creates a new ReasoningOptions struct.

new!(attrs \\ %{})

@spec new!(map()) :: t() | no_return()

Creates a new ReasoningOptions struct, raising on error.

to_api_map(reasoning)

@spec to_api_map(t() | nil) :: map() | nil

Converts the ReasoningOptions to a map suitable for API requests. Returns nil if no options are set.

valid_efforts()

Returns the list of valid effort values.

Different models allow different reasoning effort values. Consult the OpenAI docs.

valid_summaries()

Returns the list of valid summary values.