tot#

Implementation of a Tree of Thought (ToT) chain based on the paper [Large Language Model Guided Tree-of-Thought](https://arxiv.org/pdf/2305.08291.pdf).

The Tree of Thought (ToT) chain uses a tree structure to explore the space of possible solutions to a problem.

Classes

tot.base.ToTChain

Chain implementing the Tree of Thought (ToT).

tot.checker.ToTChecker

Tree of Thought (ToT) checker.

tot.controller.ToTController([c])

Tree of Thought (ToT) controller.

tot.memory.ToTDFSMemory([stack])

Memory for the Tree of Thought (ToT) chain.

tot.prompts.CheckerOutputParser

Parse and check the output of the language model.

tot.prompts.JSONListOutputParser

Parse the output of a PROPOSE_PROMPT response.

tot.thought.Thought

A thought in the ToT.

tot.thought.ThoughtValidity(value[,Β names,Β ...])

Enum for the validity of a thought.

tot.thought_generation.BaseThoughtGenerationStrategy

Base class for a thought generation strategy.

tot.thought_generation.ProposePromptStrategy

Strategy that is sequentially using a "propose prompt".

tot.thought_generation.SampleCoTStrategy

Sample strategy from a Chain-of-Thought (CoT) prompt.

Functions

tot.prompts.get_cot_prompt()

Get the prompt for the Chain of Thought (CoT) chain.

tot.prompts.get_propose_prompt()

Get the prompt for the PROPOSE_PROMPT chain.