Skip to main content

Pure Graph of Thoughts

Project description

Pure Graph of Thoughts

This is the official implementation of Pure Graph of Thoughts, a new implementation of the Graph of Thoughts concepts.

Graph of Thoughts was originally introduced in the paper Graph of Thoughts: Solving Elaborate Problems with Large Language Models. The official implementation of the paper's proposed API can be found here: https://github.com/spcl/graph-of-thoughts.

The pure_graph_of_thoughts package does not conform the API proposed by the original paper nor is it a fork of it. It aims for a more automation-friendly implementation of the general concept of Graph of Thoughts, where both construction and traversal of a graph can be handled iteratively.

Some key differences and restrictions:

  • Operations and thoughts are represented independently of their graph structure.
  • As a user-facing API, operations can be defined in a declarative way over a typed and validated data structure (DSL).
  • There is a strict distinction between a prompt operation executed by a language model and a code execution operation.
  • To simplify parsing logic and to ensure consistent results, the JSON format is used for communication with the language model.
  • The scoring is now part of an operation involving a prompt, rather than being a standalone operation that can be added arbitrarily. While this simplifies the automation process, it restricts the user's possibility of adding a validation operation.

Setup Guide

To run this code, Python 3.11 or newer is required. The latest version of the package can be installed from PyPI:

pip install pure-graph-of-thoughts

Alternatively, the package can be installed from source.

Optional Dependencies

The project comes with optional dependencies which are required for some features.

Graph Visualization

To visualize the graphs by using pure_graph_of_thoughts.visualization, the optional visualization dependencies are required.

pip install pure-graph-of-thoughts[visualization]

For a cleaner, hierarchical visualization, add dot-visualization.

pip install pure-graph-of-thoughts[visualization,dot-visualization]

Be aware that dot-visualization requires the GraphViz library to be installed.

Examples

An example task definition is provided together with a notebook that shows the graph construction and execution. To run the notebook, the optional notebooks dependencies are required.

pip install pure-graph-of-thoughts[notebooks]

Be aware that the examples are not part of the distributed package on PyPI.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pure_graph_of_thoughts-1.2.0.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

pure_graph_of_thoughts-1.2.0-py3-none-any.whl (40.0 kB view details)

Uploaded Python 3

File details

Details for the file pure_graph_of_thoughts-1.2.0.tar.gz.

File metadata

File hashes

Hashes for pure_graph_of_thoughts-1.2.0.tar.gz
Algorithm Hash digest
SHA256 411acb839024f354b1a78628e51aedadc54c5b7a4edef264b55e1664eb8c4a52
MD5 a5da48d9ef20eed8c47b7b70924273b0
BLAKE2b-256 fe2ad9ae159ea86f39bea263d4f221f14e9f2290a845cfb4ee06acbf66fada50

See more details on using hashes here.

Provenance

The following attestation bundles were made for pure_graph_of_thoughts-1.2.0.tar.gz:

Publisher: publish.yml on mriesen/pure-graph-of-thoughts

Attestations:

File details

Details for the file pure_graph_of_thoughts-1.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pure_graph_of_thoughts-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 566ee7c8f174c132a518c988d9c2593d02f502a390f51925a43f7415f0a38031
MD5 d957440521323ca9c644b63cf6ec899e
BLAKE2b-256 7a4ace0d2566273f5b362cf25783eb3b3660cc455ccf70e7f4178f0fe6d19d1a

See more details on using hashes here.

Provenance

The following attestation bundles were made for pure_graph_of_thoughts-1.2.0-py3-none-any.whl:

Publisher: publish.yml on mriesen/pure-graph-of-thoughts

Attestations:

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page