Imp.Predict.ChainOfThought (Imp v0.5.0)

Copy Markdown View Source

Predict variant that asks for a :reasoning field before task outputs.

Summary

Functions

Builds a program that asks for :reasoning before the signature's outputs.

Functions

new(signature, opts \\ [])

Builds a program that asks for :reasoning before the signature's outputs.

Takes Imp.Predict.new/2's options and two of its own. An unknown option raises ArgumentError.

Options

  • :lm - The model the program calls. When absent, each call uses Imp.Settings' :lm.

  • :adapter - The adapter that renders the request and parses the reply. When absent, each call uses Imp.Settings' :adapter.

  • :demos (list of term/0) - Worked examples rendered before the inputs, as Imp.Example values or maps. The default value is [].

  • :config (keyword/0) - Request options sent with every call: sampling (:temperature, :max_tokens, :n, ...) and the other options the LM client takes. The default value is [].

  • :adapter_opts (keyword/0) - Options handed to the adapter's format/3 on every call, beside :demos: how a program passes rendering data, and how a host injects renderers without writing a second adapter module. The default value is [].

  • :metadata (map of term/0 keys and term/0 values) - Free-form metadata kept on the program. The default value is %{}.

  • :rationale_field - The reasoning field, as a field map, keyword list or Imp.Signature.Field; its name is always :reasoning. When absent or nil, a field of :rationale_field_type.

  • :rationale_field_type (term/0) - The type of the default reasoning field; :reasoning asks a model that reasons natively for its own reasoning. The default value is :string.