agents.reasoning_and_critique.tot.orchestratorΒΆ

Tree of Thoughts Orchestrator using MultiAgent.

This module implements the Tree of Thoughts algorithm using a multi-agent approach with MultiAgent coordinating the Candidate Generator and Solution Scorer agents.

ClassesΒΆ

TOTResult

Result from Tree of Thoughts execution.

TreeOfThoughtsOrchestrator

Orchestrates Tree of Thoughts algorithm using multiple agents.

FunctionsΒΆ

create_tot_solver([beam_width, max_iterations])

Factory function to create a Tree of Thoughts solver.

Module ContentsΒΆ

class agents.reasoning_and_critique.tot.orchestrator.TOTResult(/, **data)ΒΆ

Bases: pydantic.BaseModel

Result from Tree of Thoughts execution.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:

data (Any)

class agents.reasoning_and_critique.tot.orchestrator.TreeOfThoughtsOrchestrator(name='tot_orchestrator', engine=None, beam_width=5, max_iterations=3, temperature_generate=0.7, temperature_score=0.3)ΒΆ

Orchestrates Tree of Thoughts algorithm using multiple agents.

Initialize the Tree of Thoughts orchestrator.

Parameters:
  • name (str) – Name for the orchestrator

  • engine (haive.core.engine.aug_llm.AugLLMConfig | None) – LLM configuration for the coordinator

  • beam_width (int) – Number of top solutions to keep at each iteration

  • max_iterations (int) – Maximum number of expansion iterations

  • temperature_generate (float) – Temperature for candidate generation

  • temperature_score (float) – Temperature for solution scoring

async solve(problem, initial_seed=None, context='')ΒΆ

Solve a problem using Tree of Thoughts.

Parameters:
  • problem (str) – The problem to solve

  • initial_seed (str | None) – Optional initial solution seed

  • context (str) – Additional context or constraints

Returns:

TOTResult with the best solution found

Return type:

TOTResult

async agents.reasoning_and_critique.tot.orchestrator.create_tot_solver(beam_width=5, max_iterations=3, **kwargs)ΒΆ

Factory function to create a Tree of Thoughts solver.

Parameters:
  • beam_width (int) – Number of solutions to keep at each iteration

  • max_iterations (int) – Maximum iterations to perform

  • **kwargs – Additional arguments for the orchestrator

Returns:

Configured TreeOfThoughtsOrchestrator instance

Return type:

TreeOfThoughtsOrchestrator