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.

Language Models

The package language_models contains implementation of the language model API. the optional languagemodel dependencies are required.

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

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:

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.5.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.5.0-py3-none-any.whl (45.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pure_graph_of_thoughts-1.5.0.tar.gz
Algorithm Hash digest
SHA256 e259e8606d1d86dd710c4c178c0a1716bf29929cf7e0f0c51a2646675d1f63d7
MD5 4a9b8a3b99ee8ffa920805f7967fc8f0
BLAKE2b-256 7a9a3ef104893653a780a14964f989da30d5994354cc07f0594554f4c0ae9f31

See more details on using hashes here.

Provenance

The following attestation bundles were made for pure_graph_of_thoughts-1.5.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.5.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pure_graph_of_thoughts-1.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 13df544091b724128d7b28e1ca454cc72200c9e027c6c0639804625dc13ac88f
MD5 1ba60abc708a4a9bc48ccfd4adff476c
BLAKE2b-256 c3e5f0ebe15ae09fe40ca5f1179a8d721e50f7c2ac0936bdd8d87650b138585a

See more details on using hashes here.

Provenance

The following attestation bundles were made for pure_graph_of_thoughts-1.5.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