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.

pygraphviz on Windows

The Python package pygraphviz (included in dot-visualization) may cause installation problems on Windows. Installing it separately with the following options (including the GraphViz headers) resolves the problem:

python -m pip install --config-settings="--global-option=build_ext" --config-settings="--global-option=-IC:\Program Files\Graphviz\include" --config-settings="--global-option=-LC:\Program Files\Graphviz\lib" pygraphviz

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.3.0.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pure_graph_of_thoughts-1.3.0-py3-none-any.whl (40.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pure_graph_of_thoughts-1.3.0.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pure_graph_of_thoughts-1.3.0.tar.gz
Algorithm Hash digest
SHA256 1166bb137c1456943c6e42971bb3c1e3656f2e8b4c9f0bf0caa6d9e0be4974f8
MD5 97d28edec55fcccdf4f219697d57c649
BLAKE2b-256 f6eaba56d5ed6c143d1fce2f32c0d3f66e55dbe0e721d29c9cbb2d25b162f5cc

See more details on using hashes here.

Provenance

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

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

File hashes

Hashes for pure_graph_of_thoughts-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c2965e41d1d324b0d7b0e1bb66f7be2489a5a294f317c9d0729009e4b9ce3518
MD5 93ed843f1e04d947df77ab6e39e70bc9
BLAKE2b-256 a6c60791adcab5d6f047ddaa5ec2152a8b95189eeec9ccb367b7ce9592b04dff

See more details on using hashes here.

Provenance

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

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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