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:
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pure_graph_of_thoughts-1.4.0.tar.gz.
File metadata
- Download URL: pure_graph_of_thoughts-1.4.0.tar.gz
- Upload date:
- Size: 3.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6f444c0c14c9005c8c89c23a53a1fd868b138573cb3b33c87afe2ca1c2e41262
|
|
| MD5 |
03fc4280aa7e4655c29229ab1e2b3388
|
|
| BLAKE2b-256 |
c759bf84d6fdb38a65ff7f16d65303e7fb2adeb9b9c2f83b4cb677fa0f7d9000
|
Provenance
The following attestation bundles were made for pure_graph_of_thoughts-1.4.0.tar.gz:
Publisher:
publish.yml on mriesen/pure-graph-of-thoughts
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pure_graph_of_thoughts-1.4.0.tar.gz -
Subject digest:
6f444c0c14c9005c8c89c23a53a1fd868b138573cb3b33c87afe2ca1c2e41262 - Sigstore transparency entry: 1205642840
- Sigstore integration time:
-
Permalink:
mriesen/pure-graph-of-thoughts@f4048a324558112cd728eedc51c5fb764fb7dd98 -
Branch / Tag:
refs/tags/v1.4.0 - Owner: https://github.com/mriesen
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f4048a324558112cd728eedc51c5fb764fb7dd98 -
Trigger Event:
release
-
Statement type:
File details
Details for the file pure_graph_of_thoughts-1.4.0-py3-none-any.whl.
File metadata
- Download URL: pure_graph_of_thoughts-1.4.0-py3-none-any.whl
- Upload date:
- Size: 40.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
da517d789f5e1089e6ee3af3c059043ed678508ef47bf1be6438c011d9b6e678
|
|
| MD5 |
5d33ded84582fff5ad21cb86f2148a69
|
|
| BLAKE2b-256 |
f954e5273556051ddd5923e3ef98900f75d165d2d009b2c099fa53986839bee2
|
Provenance
The following attestation bundles were made for pure_graph_of_thoughts-1.4.0-py3-none-any.whl:
Publisher:
publish.yml on mriesen/pure-graph-of-thoughts
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pure_graph_of_thoughts-1.4.0-py3-none-any.whl -
Subject digest:
da517d789f5e1089e6ee3af3c059043ed678508ef47bf1be6438c011d9b6e678 - Sigstore transparency entry: 1205642841
- Sigstore integration time:
-
Permalink:
mriesen/pure-graph-of-thoughts@f4048a324558112cd728eedc51c5fb764fb7dd98 -
Branch / Tag:
refs/tags/v1.4.0 - Owner: https://github.com/mriesen
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f4048a324558112cd728eedc51c5fb764fb7dd98 -
Trigger Event:
release
-
Statement type: