agents.reasoning_and_critique.tot.tot_multi_agent¶
Tree of Thoughts Multi-Agent Implementation.
This module implements Tree of Thoughts as a multi-agent system using MultiAgent. Each stage of the TOT algorithm is handled by a specialized agent.
Classes¶
Selection of best candidates for next iteration. |
|
Evaluation of a single candidate. |
|
Multiple candidate solutions. |
|
Final synthesized solution. |
|
Analysis of the problem to solve. |
|
Tree of Thoughts implemented as a multi-agent system. |
Functions¶
|
Main. |
|
Convenience function to solve a problem with TOT multi-agent. |
Module Contents¶
- class agents.reasoning_and_critique.tot.tot_multi_agent.BeamSelection(/, **data)¶
Bases:
pydantic.BaseModel
Selection of best candidates for next iteration.
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.tot_multi_agent.CandidateEvaluation(/, **data)¶
Bases:
pydantic.BaseModel
Evaluation of a single candidate.
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.tot_multi_agent.CandidateGeneration(/, **data)¶
Bases:
pydantic.BaseModel
Multiple candidate solutions.
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.tot_multi_agent.FinalSolution(/, **data)¶
Bases:
pydantic.BaseModel
Final synthesized solution.
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.tot_multi_agent.ProblemAnalysis(/, **data)¶
Bases:
pydantic.BaseModel
Analysis of the problem to solve.
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.tot_multi_agent.TreeOfThoughtsMultiAgent(max_depth=3, beam_width=3, threshold=0.8, expansion_count=5, temperature_config=None)¶
Tree of Thoughts implemented as a multi-agent system.
Initialize the TOT multi-agent system.
- Parameters:
max_depth (int) – Maximum search depth
beam_width (int) – Number of candidates to keep at each level
threshold (float) – Score threshold for accepting a solution
expansion_count (int) – Number of new candidates to generate
temperature_config (dict[str, float] | None) – Temperature settings for each agent
- async solve(problem)¶
Solve a problem using Tree of Thoughts multi-agent approach.
- async agents.reasoning_and_critique.tot.tot_multi_agent.main()¶
Main.
- async agents.reasoning_and_critique.tot.tot_multi_agent.solve_with_tot_multi_agent(problem, max_depth=3, beam_width=3, threshold=0.8)¶
Convenience function to solve a problem with TOT multi-agent.