Skip to content

stephenc222/example-tree-of-thoughts-prompting

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tree of Thoughts in Python

This is the companion code repository for my blog post on implementing a Tree of Thoughts in Python.

Introduction

In this tutorial, I will walk through the implementation of a Tree of Thoughts in Python. The Tree of Thoughts is a conceptual framework that helps in exploring and evolving ideas systematically. I will use the Anthropic API to generate responses and build our tree.

Setup

To get started, follow these steps:

  1. Clone the repository:

    git clone git@github.com:stephenc222/example-tree-of-thoughts-prompting.git
    cd example-tree-of-thoughts-prompting
  2. Set up your environment variables:

    • Create a .env file in the root directory of the project.

    • Add your Anthropic API key to the .env file:

      ANTHROPIC_API_KEY=YOUR_ANTHROPIC_API_KEY
  3. Install the required dependencies:

    pip3 install python-dotenv anthropic

Usage

To run the Tree of Thoughts implementation, execute the following command:

python3 app.py

About

Example project demonstrating Tree of Thoughts (ToT) prompting technique.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages