Dspy.ChainOfThought (dspy v0.1.0)

View Source

Chain of Thought reasoning module.

Extends basic prediction with step-by-step reasoning by adding a reasoning field to the signature and encouraging the model to show its work before generating the final answer.

Summary

Functions

Create a new ChainOfThought module.

Callback implementation for Dspy.Module.parameters/1.

Types

t()

@type t() :: %Dspy.ChainOfThought{
  examples: [Dspy.Example.t()],
  max_retries: non_neg_integer(),
  reasoning_field: atom(),
  signature: Dspy.Signature.t()
}

Functions

new(signature, opts \\ [])

Create a new ChainOfThought module.

parameters(module)

Callback implementation for Dspy.Module.parameters/1.

update_parameters(module, parameters)

Callback implementation for Dspy.Module.update_parameters/2.