Skip to content

Subset: Modules

Composable program modules and predictors.

URI: Modules

Identifier and Mapping Information

Schema Source

Classes in subset

Class Description
Aggregator Aggregation helper (``dspy
BestOfN Sample N candidates and select the highest-rewarded (``dspy
ChainOfThought Predictor that injects a free-form rationale field (``dspy
CodeAct Code-acting agent (``dspy
CodeInterpreter Sandboxed code interpreter (``dspy
FinalOutput Sentinel produced by CodeInterpreter to indicate program termination
Interpreter Abstract code interpreter used by ProgramOfThought and CodeAct
KNN K-nearest-neighbor demo selector (``dspy
Module Base class for DSPy programs (``dspy
MultiChainComparison Generates N chains and selects the best (``dspy
Parallel Run modules in parallel across batched inputs (``dspy
Predict Basic input-to-output predictor (``dspy
Predictor Module that wraps a Signature + LM and produces a Prediction
ProgramOfThought Tool-using predictor that emits and executes Python code (``dspy
PythonInterpreter Local in-process Python REPL (``dspy
ReAct Reasoning + Acting agent with tool use (``dspy
ReActV2 Next-generation ReAct agent (``dspy
Refine Iterative refinement loop (``dspy
RLM Reinforcement-learning model wrapper (``dspy