This is an example of chatgpt-like bot. It is simplified, but demonstrates the core concepts nicely.
The core idea is that we:
We have both a hamilton and non-hamilton implementation of this for comparison. For the simplicity of this example, Hamilton is likely overkill. There are a few nodes that could leverage it well, but the rest are too simple to worry about putting in a DAG. As examples get more complex, we anticipate that Hamilton nodes will play a more important role.
The state machine this encapsulates takes the following form:
Note that it is currently wired up to handle errors in the state machine, but the actions do not respect that yet. Coming soon.
We have a few files:
OPENAI_API_KEY set in your environment. You can do this by running.streamlit run simple_streamlit_app.py & burr
This will open up both a streamlit app and a server at the same time. Interact with the app, and see interactions in the Burr UI.
Alternatively, run the more sophisticated streamlit app:
streamlit run streamlit_app.py
This streamlit app renders the statemachine as well as exposing the burr application showing you can build a more sophisticated UI around the Burr application.
To see a tracing example see this example.