Module: braid.signatures

DSPy signatures for BRAID reasoning.

class braid.signatures.BraidPlanSignature(*, problem: str, grd: str)[source]

Bases: Signature

Signature for GRD planning phase.

This signature defines the input/output structure for generating a Guided Reasoning Diagram (GRD) from a problem statement.

BRAID Protocol Requirements: - Procedural Scaffolding: Describe HOW to solve, not WHAT the answer is - Atomicity: Keep each node under 15 tokens for optimal performance - No Answer Leakage: Never include computed values in the diagram

problem: str
grd: str
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class braid.signatures.BraidExecuteSignature(*, problem: str, grd: str, current_step: str, previous_results: str = '', step_result: str)[source]

Bases: Signature

Signature for GRD execution phase.

This signature defines the input/output structure for executing a Guided Reasoning Diagram step by step.

problem: str
grd: str
current_step: str
previous_results: str
step_result: str
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class braid.signatures.BraidReasoningSignature(*, problem: str, grd: str, reasoning_steps: str, answer: str)[source]

Bases: Signature

Complete BRAID reasoning signature combining planning and execution.

This is a convenience signature that can be used for end-to-end BRAID reasoning in a single call.

problem: str
grd: str
reasoning_steps: str
answer: str
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class braid.signatures.BraidStepSignature(*, step_description: str, context: str, step_output: str)[source]

Bases: Signature

Signature for executing a single step in a GRD.

Used internally by the BRAID module for step-by-step execution.

step_description: str
context: str
step_output: str
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].