Skip to content

armgit / burr

Public Imported from GitHub
0

Build applications that make decisions (chatbots, agents, simulations, etc...). Monitor, trace, persist, and execute on your own infrastructure.

Adds collab links for notebooks

Stefan Krawczyk71977bf331b9
diff --git a/examples/conversational-rag/README.md b/examples/conversational-rag/README.md
index 8938d238..ba240639 100644
--- a/examples/conversational-rag/README.md
+++ b/examples/conversational-rag/README.md
@@ -37,8 +37,13 @@ You'll then have a text terminal where you can interact. Type exit to stop.
![Application Image](statemachine.png)
# Video Walkthrough via Notebook
+Open the notebook <a target="_blank" href="https://colab.research.google.com/github/dagworks-inc/burr/blob/main/examples/conversational-rag/notebook.ipynb">
+ <img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/>
+</a>
+
Watch the video walkthrough with the notebook (1.5x+ speed recommended):
+
<a href="http://www.youtube.com/watch?feature=player_embedded&v=t54DCiOH270" target="_blank">
<img src="http://img.youtube.com/vi/t54DCiOH270/hqdefault.jpg" alt="Watch the video" border="10" />
</a>
diff --git a/examples/conversational-rag/notebook.ipynb b/examples/conversational-rag/notebook.ipynb
index 7488e8de..016e2f30 100644
--- a/examples/conversational-rag/notebook.ipynb
+++ b/examples/conversational-rag/notebook.ipynb
@@ -2,16 +2,42 @@
"cells": [
{
"cell_type": "markdown",
+ "id": "1622e1563a35aa32",
+ "metadata": {
+ "collapsed": false,
+ "jupyter": {
+ "outputs_hidden": false
+ }
+ },
"source": [
"# Conversational RAG Example"
- ],
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "9069a73d207fd136",
"metadata": {
- "collapsed": false
+ "collapsed": false,
+ "jupyter": {
+ "outputs_hidden": false
+ }
},
- "id": "1622e1563a35aa32"
+ "outputs": [],
+ "source": [
+ "!pip install burr"
+ ]
},
{
"cell_type": "code",
+ "execution_count": 8,
+ "id": "initial_id",
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2024-03-26T20:47:37.515883Z",
+ "start_time": "2024-03-26T20:47:35.314767Z"
+ }
+ },
"outputs": [],
"source": [
"# Importing the necessary libraries\n",
@@ -23,21 +49,16 @@
"from burr.core.action import action\n",
"from application import PrintStepHook # local import from application.py\n",
"from burr.tracking import LocalTrackingClient"
- ],
- "metadata": {
- "ExecuteTime": {
- "end_time": "2024-03-26T20:47:37.515883Z",
- "start_time": "2024-03-26T20:47:35.314767Z"
- }
- },
- "id": "initial_id",
- "execution_count": 8
+ ]
},
{
"cell_type": "markdown",
"id": "8f1d578469a918b1",
"metadata": {
- "collapsed": false
+ "collapsed": false,
+ "jupyter": {
+ "outputs_hidden": false
+ }
},
"source": [
"# Load your \"chain\" or conversational RAG \"pipeline\"\n",
@@ -54,7 +75,10 @@
"end_time": "2024-03-26T20:47:42.057246Z",
"start_time": "2024-03-26T20:47:40.500075Z"
},
- "collapsed": false
+ "collapsed": false,
+ "jupyter": {
+ "outputs_hidden": false
+ }
},
"outputs": [
{
@@ -253,7 +277,10 @@
"cell_type": "markdown",
"id": "82b3515afd2de6e4",
"metadata": {
- "collapsed": false
+ "collapsed": false,
+ "jupyter": {
+ "outputs_hidden": false
+ }
},
"source": [
"# Create the actions that will constitute our application\n",
@@ -270,7 +297,10 @@
"end_time": "2024-03-26T20:47:42.065785Z",
"start_time": "2024-03-26T20:47:42.059539Z"
},
- "collapsed": false
+ "collapsed": false,
+ "jupyter": {
+ "outputs_hidden": false
+ }
},
"outputs": [],
"source": [
@@ -309,7 +339,10 @@
"cell_type": "markdown",
"id": "9579b47aac2c53a0",
"metadata": {
- "collapsed": false
+ "collapsed": false,
+ "jupyter": {
+ "outputs_hidden": false
+ }
},
"source": [
"# Create the application\n",
@@ -328,7 +361,10 @@
"end_time": "2024-03-26T20:50:25.642660Z",
"start_time": "2024-03-26T20:50:25.616245Z"
},
- "collapsed": false
+ "collapsed": false,
+ "jupyter": {
+ "outputs_hidden": false
+ }
},
"outputs": [],
"source": [
@@ -393,7 +429,10 @@
"end_time": "2024-03-26T20:48:39.379712Z",
"start_time": "2024-03-26T20:48:38.701659Z"
},
- "collapsed": false
+ "collapsed": false,
+ "jupyter": {
+ "outputs_hidden": false
+ }
},
"outputs": [
{
@@ -479,7 +518,10 @@
"cell_type": "markdown",
"id": "430bab287b6ad9a",
"metadata": {
- "collapsed": false
+ "collapsed": false,
+ "jupyter": {
+ "outputs_hidden": false
+ }
},
"source": [
"# Let's run the app. \n",
@@ -496,7 +538,10 @@
"end_time": "2024-03-26T20:50:38.782857Z",
"start_time": "2024-03-26T20:50:28.797204Z"
},
- "collapsed": false
+ "collapsed": false,
+ "jupyter": {
+ "outputs_hidden": false
+ }
},
"outputs": [
{
@@ -542,7 +587,10 @@
"end_time": "2024-03-26T20:50:44.662755Z",
"start_time": "2024-03-26T20:50:41.919782Z"
},
- "collapsed": false
+ "collapsed": false,
+ "jupyter": {
+ "outputs_hidden": false
+ }
},
"outputs": [
{
@@ -584,7 +632,10 @@
"cell_type": "markdown",
"id": "36ec2f4908c2dde2",
"metadata": {
- "collapsed": false
+ "collapsed": false,
+ "jupyter": {
+ "outputs_hidden": false
+ }
},
"source": [
"# Let's now run the app to completion\n",
@@ -602,7 +653,10 @@
"end_time": "2024-03-26T20:52:21.364028Z",
"start_time": "2024-03-26T20:50:52.382808Z"
},
- "collapsed": false
+ "collapsed": false,
+ "jupyter": {
+ "outputs_hidden": false
+ }
},
"outputs": [
{
@@ -677,7 +731,10 @@
"cell_type": "markdown",
"id": "169946a65f977df9",
"metadata": {
- "collapsed": false
+ "collapsed": false,
+ "jupyter": {
+ "outputs_hidden": false
+ }
},
"source": [
"# Reloading from prior state\n",
@@ -708,7 +765,10 @@
"end_time": "2024-03-26T20:52:37.419848Z",
"start_time": "2024-03-26T20:52:37.393869Z"
},
- "collapsed": false
+ "collapsed": false,
+ "jupyter": {
+ "outputs_hidden": false
+ }
},
"outputs": [
{
@@ -806,7 +866,10 @@
"end_time": "2024-03-26T20:54:24.035153Z",
"start_time": "2024-03-26T20:53:19.237522Z"
},
- "collapsed": false
+ "collapsed": false,
+ "jupyter": {
+ "outputs_hidden": false
+ }
},
"outputs": [
{
@@ -898,7 +961,10 @@
"end_time": "2024-03-26T21:04:56.748649Z",
"start_time": "2024-03-26T21:04:56.742019Z"
},
- "collapsed": false
+ "collapsed": false,
+ "jupyter": {
+ "outputs_hidden": false
+ }
},
"outputs": [],
"source": [
@@ -953,7 +1019,10 @@
"end_time": "2024-03-26T21:05:41.246005Z",
"start_time": "2024-03-26T21:05:02.855430Z"
},
- "collapsed": false
+ "collapsed": false,
+ "jupyter": {
+ "outputs_hidden": false
+ }
},
"outputs": [
{
@@ -1043,7 +1112,10 @@
"execution_count": null,
"id": "fe401e84026db9bb",
"metadata": {
- "collapsed": false
+ "collapsed": false,
+ "jupyter": {
+ "outputs_hidden": false
+ }
},
"outputs": [],
"source": []
diff --git a/examples/email-assistant/README.md b/examples/email-assistant/README.md
index 40b55e8a..0a961fca 100644
--- a/examples/email-assistant/README.md
+++ b/examples/email-assistant/README.md
@@ -28,3 +28,7 @@ This simulates an interactive web app. The notebook is the best way to get start
Note we will be adding two things to this demo:
1. An integration with the burr web app
2. a standalone server example with a walkthrough
+
+Open the notebook <a target="_blank" href="https://colab.research.google.com/github/dagworks-inc/burr/blob/main/examples/email-assistant/notebook.ipynb">
+ <img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/>
+</a>
diff --git a/examples/email-assistant/notebook.ipynb b/examples/email-assistant/notebook.ipynb
index 42601ca4..4983c59b 100644
--- a/examples/email-assistant/notebook.ipynb
+++ b/examples/email-assistant/notebook.ipynb
@@ -1,5 +1,20 @@
{
"cells": [
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "40392f86b8ad9a3f",
+ "metadata": {
+ "collapsed": false,
+ "jupyter": {
+ "outputs_hidden": false
+ }
+ },
+ "outputs": [],
+ "source": [
+ "!pip install burr"
+ ]
+ },
{
"cell_type": "markdown",
"id": "99997759-30e1-4290-a62f-d606687b0319",
@@ -150,8 +165,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
- "The email assistant wants more information:\n",
- "\n"
+ "The email assistant wants more information:\n"
]
}
],
@@ -221,7 +235,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
- "version": "3.11.6"
+ "version": "3.10.4"
}
},
"nbformat": 4,
diff --git a/examples/hello-world-counter/README.md b/examples/hello-world-counter/README.md
index 013c3a0d..33810b9e 100644
--- a/examples/hello-world-counter/README.md
+++ b/examples/hello-world-counter/README.md
@@ -7,6 +7,9 @@ We have three files:
- [application.py](application.py) -- This contains a mainline to run the counter as well as a function to export the counter (for later use)
- [requirements.txt](requirements.txt) -- Just the requirements. All this needs is Burr/Streamlit
- [streamlit_app.py](streamlit_app.py) -- This contains a simple Streamlit app to interact with the counter.
+- [notebook.ipynb](notebook.ipynb) -- A notebook that shows the counter app too. Open the notebook <a target="_blank" href="https://colab.research.google.com/github/dagworks-inc/burr/blob/main/examples/hello-world-counter/notebook.ipynb">
+ <img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/>
+</a>
To run just the application, you can run:
diff --git a/examples/hello-world-counter/notebook.ipynb b/examples/hello-world-counter/notebook.ipynb
index 1ecdbc4a..c434a4c2 100644
--- a/examples/hello-world-counter/notebook.ipynb
+++ b/examples/hello-world-counter/notebook.ipynb
@@ -1,14 +1,32 @@
{
"cells": [
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "e9dbe2a53575403a",
+ "metadata": {
+ "collapsed": false,
+ "jupyter": {
+ "outputs_hidden": false
+ }
+ },
+ "outputs": [],
+ "source": [
+ "!pip install burr"
+ ]
+ },
{
"cell_type": "code",
"execution_count": 26,
"id": "initial_id",
"metadata": {
- "collapsed": true,
"ExecuteTime": {
"end_time": "2024-03-27T00:11:36.093767Z",
"start_time": "2024-03-27T00:11:36.088301Z"
+ },
+ "collapsed": true,
+ "jupyter": {
+ "outputs_hidden": true
}
},
"outputs": [],
@@ -24,6 +42,18 @@
},
{
"cell_type": "code",
+ "execution_count": 27,
+ "id": "64c67b15363653e9",
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2024-03-27T00:11:36.548223Z",
+ "start_time": "2024-03-27T00:11:36.539358Z"
+ },
+ "collapsed": false,
+ "jupyter": {
+ "outputs_hidden": false
+ }
+ },
"outputs": [],
"source": [
"@action(reads=[\"counter\"], writes=[\"counter\"])\n",
@@ -43,24 +73,67 @@
"# change the app_id to start from scratch\n",
"persister = SQLLitePersister(\"demos.db\", \"counter\")\n",
"persister.initialize()"
- ],
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 28,
+ "id": "f43d7208a78b363e",
"metadata": {
- "collapsed": false,
"ExecuteTime": {
- "end_time": "2024-03-27T00:11:36.548223Z",
- "start_time": "2024-03-27T00:11:36.539358Z"
+ "end_time": "2024-03-27T00:11:37.753610Z",
+ "start_time": "2024-03-27T00:11:37.490638Z"
+ },
+ "collapsed": false,
+ "jupyter": {
+ "outputs_hidden": false
}
},
- "id": "64c67b15363653e9",
- "execution_count": 27
- },
- {
- "cell_type": "code",
"outputs": [
{
"data": {
- "image/svg+xml": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n<!-- Generated by graphviz version 9.0.0 (20230911.1827)\n -->\n<!-- Pages: 1 -->\n<svg width=\"152pt\" height=\"111pt\"\n viewBox=\"0.00 0.00 152.25 111.00\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 107)\">\n<polygon fill=\"white\" stroke=\"none\" points=\"-4,4 -4,-107 148.25,-107 148.25,4 -4,4\"/>\n<!-- counter -->\n<g id=\"node1\" class=\"node\">\n<title>counter</title>\n<path fill=\"none\" stroke=\"black\" d=\"M44.5,-103C44.5,-103 12,-103 12,-103 6,-103 0,-97 0,-91 0,-91 0,-79 0,-79 0,-73 6,-67 12,-67 12,-67 44.5,-67 44.5,-67 50.5,-67 56.5,-73 56.5,-79 56.5,-79 56.5,-91 56.5,-91 56.5,-97 50.5,-103 44.5,-103\"/>\n<text text-anchor=\"middle\" x=\"28.25\" y=\"-79.95\" font-family=\"Times,serif\" font-size=\"14.00\">counter</text>\n</g>\n<!-- counter&#45;&gt;counter -->\n<g id=\"edge1\" class=\"edge\">\n<title>counter&#45;&gt;counter</title>\n<path fill=\"none\" stroke=\"black\" stroke-dasharray=\"5,2\" d=\"M56.7,-91.28C66.55,-91.35 74.5,-89.25 74.5,-85 74.5,-82.61 71.98,-80.9 68.03,-79.87\"/>\n<polygon fill=\"black\" stroke=\"black\" points=\"68.51,-76.4 58.21,-78.87 67.8,-83.37 68.51,-76.4\"/>\n<text text-anchor=\"middle\" x=\"109.38\" y=\"-79.95\" font-family=\"Times,serif\" font-size=\"14.00\">counter &lt; 10</text>\n</g>\n<!-- result -->\n<g id=\"node2\" class=\"node\">\n<title>result</title>\n<path fill=\"none\" stroke=\"black\" d=\"M43.25,-36C43.25,-36 13.25,-36 13.25,-36 7.25,-36 1.25,-30 1.25,-24 1.25,-24 1.25,-12 1.25,-12 1.25,-6 7.25,0 13.25,0 13.25,0 43.25,0 43.25,0 49.25,0 55.25,-6 55.25,-12 55.25,-12 55.25,-24 55.25,-24 55.25,-30 49.25,-36 43.25,-36\"/>\n<text text-anchor=\"middle\" x=\"28.25\" y=\"-12.95\" font-family=\"Times,serif\" font-size=\"14.00\">result</text>\n</g>\n<!-- counter&#45;&gt;result -->\n<g id=\"edge2\" class=\"edge\">\n<title>counter&#45;&gt;result</title>\n<path fill=\"none\" stroke=\"black\" d=\"M28.25,-66.58C28.25,-60.75 28.25,-54.09 28.25,-47.64\"/>\n<polygon fill=\"black\" stroke=\"black\" points=\"31.75,-47.98 28.25,-37.98 24.75,-47.98 31.75,-47.98\"/>\n</g>\n</g>\n</svg>\n",
- "text/plain": "<graphviz.graphs.Digraph at 0x1083289d0>"
+ "image/svg+xml": [
+ "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n",
+ "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n",
+ " \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n",
+ "<!-- Generated by graphviz version 9.0.0 (20230911.1827)\n",
+ " -->\n",
+ "<!-- Pages: 1 -->\n",
+ "<svg width=\"152pt\" height=\"111pt\"\n",
+ " viewBox=\"0.00 0.00 152.25 111.00\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
+ "<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 107)\">\n",
+ "<polygon fill=\"white\" stroke=\"none\" points=\"-4,4 -4,-107 148.25,-107 148.25,4 -4,4\"/>\n",
+ "<!-- counter -->\n",
+ "<g id=\"node1\" class=\"node\">\n",
+ "<title>counter</title>\n",
+ "<path fill=\"none\" stroke=\"black\" d=\"M44.5,-103C44.5,-103 12,-103 12,-103 6,-103 0,-97 0,-91 0,-91 0,-79 0,-79 0,-73 6,-67 12,-67 12,-67 44.5,-67 44.5,-67 50.5,-67 56.5,-73 56.5,-79 56.5,-79 56.5,-91 56.5,-91 56.5,-97 50.5,-103 44.5,-103\"/>\n",
+ "<text text-anchor=\"middle\" x=\"28.25\" y=\"-79.95\" font-family=\"Times,serif\" font-size=\"14.00\">counter</text>\n",
+ "</g>\n",
+ "<!-- counter&#45;&gt;counter -->\n",
+ "<g id=\"edge1\" class=\"edge\">\n",
+ "<title>counter&#45;&gt;counter</title>\n",
+ "<path fill=\"none\" stroke=\"black\" stroke-dasharray=\"5,2\" d=\"M56.7,-91.28C66.55,-91.35 74.5,-89.25 74.5,-85 74.5,-82.61 71.98,-80.9 68.03,-79.87\"/>\n",
+ "<polygon fill=\"black\" stroke=\"black\" points=\"68.51,-76.4 58.21,-78.87 67.8,-83.37 68.51,-76.4\"/>\n",
+ "<text text-anchor=\"middle\" x=\"109.38\" y=\"-79.95\" font-family=\"Times,serif\" font-size=\"14.00\">counter &lt; 10</text>\n",
+ "</g>\n",
+ "<!-- result -->\n",
+ "<g id=\"node2\" class=\"node\">\n",
+ "<title>result</title>\n",
+ "<path fill=\"none\" stroke=\"black\" d=\"M43.25,-36C43.25,-36 13.25,-36 13.25,-36 7.25,-36 1.25,-30 1.25,-24 1.25,-24 1.25,-12 1.25,-12 1.25,-6 7.25,0 13.25,0 13.25,0 43.25,0 43.25,0 49.25,0 55.25,-6 55.25,-12 55.25,-12 55.25,-24 55.25,-24 55.25,-30 49.25,-36 43.25,-36\"/>\n",
+ "<text text-anchor=\"middle\" x=\"28.25\" y=\"-12.95\" font-family=\"Times,serif\" font-size=\"14.00\">result</text>\n",
+ "</g>\n",
+ "<!-- counter&#45;&gt;result -->\n",
+ "<g id=\"edge2\" class=\"edge\">\n",
+ "<title>counter&#45;&gt;result</title>\n",
+ "<path fill=\"none\" stroke=\"black\" d=\"M28.25,-66.58C28.25,-60.75 28.25,-54.09 28.25,-47.64\"/>\n",
+ "<polygon fill=\"black\" stroke=\"black\" points=\"31.75,-47.98 28.25,-37.98 24.75,-47.98 31.75,-47.98\"/>\n",
+ "</g>\n",
+ "</g>\n",
+ "</svg>\n"
+ ],
+ "text/plain": [
+ "<graphviz.graphs.Digraph at 0x1083289d0>"
+ ]
},
"execution_count": 28,
"metadata": {},
@@ -88,19 +161,22 @@
" .build()\n",
")\n",
"app.visualize(include_conditions=True)"
- ],
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 29,
+ "id": "a63802fa10f73ca8",
"metadata": {
- "collapsed": false,
"ExecuteTime": {
- "end_time": "2024-03-27T00:11:37.753610Z",
- "start_time": "2024-03-27T00:11:37.490638Z"
+ "end_time": "2024-03-27T00:11:38.483852Z",
+ "start_time": "2024-03-27T00:11:38.463109Z"
+ },
+ "collapsed": false,
+ "jupyter": {
+ "outputs_hidden": false
}
},
- "id": "f43d7208a78b363e",
- "execution_count": 28
- },
- {
- "cell_type": "code",
"outputs": [
{
"name": "stdout",
@@ -123,23 +199,28 @@
"source": [
"action_obj, result, state = app.run(halt_after=[\"result\"])\n",
"print(state[\"counter\"])"
- ],
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 30,
+ "id": "42ba7f71fd68f013",
"metadata": {
- "collapsed": false,
"ExecuteTime": {
- "end_time": "2024-03-27T00:11:38.483852Z",
- "start_time": "2024-03-27T00:11:38.463109Z"
+ "end_time": "2024-03-27T00:11:41.692154Z",
+ "start_time": "2024-03-27T00:11:41.687049Z"
+ },
+ "collapsed": false,
+ "jupyter": {
+ "outputs_hidden": false
}
},
- "id": "a63802fa10f73ca8",
- "execution_count": 29
- },
- {
- "cell_type": "code",
"outputs": [
{
"data": {
- "text/plain": "{'counter': 10, '__SEQUENCE_ID': 10, '__PRIOR_STEP': 'result'}"
+ "text/plain": [
+ "{'counter': 10, '__SEQUENCE_ID': 10, '__PRIOR_STEP': 'result'}"
+ ]
},
"execution_count": 30,
"metadata": {},
@@ -148,44 +229,39 @@
],
"source": [
"app.state.get_all()"
- ],
- "metadata": {
- "collapsed": false,
- "ExecuteTime": {
- "end_time": "2024-03-27T00:11:41.692154Z",
- "start_time": "2024-03-27T00:11:41.687049Z"
- }
- },
- "id": "42ba7f71fd68f013",
- "execution_count": 30
+ ]
},
{
"cell_type": "code",
- "outputs": [],
- "source": [],
+ "execution_count": null,
+ "id": "e6b6f52d6ebe9eb2",
"metadata": {
- "collapsed": false
+ "collapsed": false,
+ "jupyter": {
+ "outputs_hidden": false
+ }
},
- "id": "e6b6f52d6ebe9eb2"
+ "outputs": [],
+ "source": []
}
],
"metadata": {
"kernelspec": {
- "display_name": "Python 3",
+ "display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
- "version": 2
+ "version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
- "pygments_lexer": "ipython2",
- "version": "2.7.6"
+ "pygments_lexer": "ipython3",
+ "version": "3.10.4"
}
},
"nbformat": 4,
diff --git a/examples/llm-adventure-game/README.md b/examples/llm-adventure-game/README.md
index 33bbb106..d2e00f30 100644
--- a/examples/llm-adventure-game/README.md
+++ b/examples/llm-adventure-game/README.md
@@ -7,4 +7,8 @@ How to run:
OPENAI_API_KEY=<your key> python application.py
```
+Open the notebook <a target="_blank" href="https://colab.research.google.com/github/dagworks-inc/burr/blob/main/examples/llm-adventure-game/notebook.ipynb">
+ <img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/>
+</a>
+
![State Machine](statemachine.png)
diff --git a/examples/llm-adventure-game/notebook.ipynb b/examples/llm-adventure-game/notebook.ipynb
index 9618de44..b66e7521 100644
--- a/examples/llm-adventure-game/notebook.ipynb
+++ b/examples/llm-adventure-game/notebook.ipynb
@@ -1,5 +1,20 @@
{
"cells": [
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "4f3d7770f0dd01d8",
+ "metadata": {
+ "collapsed": false,
+ "jupyter": {
+ "outputs_hidden": false
+ }
+ },
+ "outputs": [],
+ "source": [
+ "!pip install burr"
+ ]
+ },
{
"cell_type": "markdown",
"id": "00d77a51-a6ec-40d6-ae20-01f5ab2e6981",
@@ -175,7 +190,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
- "version": "3.11.6"
+ "version": "3.10.4"
}
},
"nbformat": 4,
diff --git a/examples/multi-modal-chatbot/README.md b/examples/multi-modal-chatbot/README.md
index 56116d19..9e680641 100644
--- a/examples/multi-modal-chatbot/README.md
+++ b/examples/multi-modal-chatbot/README.md
@@ -21,11 +21,14 @@ 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 three files:
+We have a few files:
- [application.py](application.py) -- This contains a mainline to generate the graph portrayal.
- [requirements.txt](requirements.txt) -- Just the requirements. All this needs is Burr/Streamlit/openai
- [simple_streamlit_app.py](simple_streamlit_app.py) -- This contains a more sophisticated Streamlit app to interact with.
+- [notebook.ipynb](notebook.ipynb) -- A notebook that helps exercise things. <a target="_blank" href="https://colab.research.google.com/github/dagworks-inc/burr/blob/main/examples/multi-modal-chatbot/notebook.ipynb">
+ <img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/>
+</a>
- [streamlit_app.py](streamlit_app.py) -- This contains a simple Streamlit app to interact with that is more
sophisticated than the simple version. It contains a more sophisticated UI that also visualizes the Burr application.
You must have your `OPENAI_API_KEY` set in your environment. You can do this by running.
diff --git a/examples/multi-modal-chatbot/notebook.ipynb b/examples/multi-modal-chatbot/notebook.ipynb
index c89cf9e2..8ebcbef0 100644
--- a/examples/multi-modal-chatbot/notebook.ipynb
+++ b/examples/multi-modal-chatbot/notebook.ipynb
@@ -1,5 +1,15 @@
{
"cells": [
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "142d4e4f-af46-4353-bcb2-d802c8e04ec5",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "!pip install burr"
+ ]
+ },
{
"cell_type": "markdown",
"id": "0ebb856d-fdb0-412c-8eaf-27af91a35ce3",
@@ -90,7 +100,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
- "version": "3.11.6"
+ "version": "3.10.4"
}
},
"nbformat": 4,
diff --git a/examples/other-examples/cowsay/README.md b/examples/other-examples/cowsay/README.md
index 2fe0194e..f9fac261 100644
--- a/examples/other-examples/cowsay/README.md
+++ b/examples/other-examples/cowsay/README.md
@@ -7,6 +7,9 @@ We have three files:
- [application.py](application.py) -- This contains a mainline to run the cowsay app as well as a function to export the app (for later use)
- [requirements.txt](requirements.txt) -- Just the requirements. All this needs is Burr/Streamlit/cowsay
- [streamlit_app.py](streamlit_app.py) -- This contains a simple Streamlit app to interact with the cow
+- [notebook.ipynb](notebook.ipynb) -- A notebook that helps show things. <a target="_blank" href="https://colab.research.google.com/github/dagworks-inc/burr/blob/main/examples/other-examples/cowsay/notebook.ipynb">
+ <img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/>
+</a>
To run just the application, you can run:
diff --git a/examples/other-examples/cowsay/notebook.ipynb b/examples/other-examples/cowsay/notebook.ipynb
index 3f4e8b26..b86df33d 100644
--- a/examples/other-examples/cowsay/notebook.ipynb
+++ b/examples/other-examples/cowsay/notebook.ipynb
@@ -1,14 +1,27 @@
{
"cells": [
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "f514e2d9-b31a-42bb-94c8-4476e4abb305",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "!pip install burr"
+ ]
+ },
{
"cell_type": "code",
"execution_count": 1,
"id": "initial_id",
"metadata": {
- "collapsed": true,
"ExecuteTime": {
"end_time": "2024-03-27T00:12:50.561804Z",
"start_time": "2024-03-27T00:12:50.531039Z"
+ },
+ "collapsed": true,
+ "jupyter": {
+ "outputs_hidden": true
}
},
"outputs": [],
@@ -26,6 +39,18 @@
},
{
"cell_type": "code",
+ "execution_count": 3,
+ "id": "9f5b9bfc78851a59",
+ "metadata": {
+ "ExecuteTime": {
+ "end_time": "2024-03-27T00:13:03.529875Z",
+ "start_time": "2024-03-27T00:13:03.524449Z"
+ },
+ "collapsed": false,
+ "jupyter": {
+ "outputs_hidden": false
+ }
+ },
"outputs": [],
"source": [
"# create some hooks!\n",
@@ -43,19 +68,22 @@
" def post_run_step(self, *, state: \"State\", action: \"Action\", **future_kwargs):\n",
" if action.name != \"cow_should_say\": # no need to print if we're not saying anything\n",
" time.sleep(self.sleep_time)"
- ],
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "id": "5b29e9de2ca536b9",
"metadata": {
- "collapsed": false,
"ExecuteTime": {
- "end_time": "2024-03-27T00:13:03.529875Z",
- "start_time": "2024-03-27T00:13:03.524449Z"
+ "end_time": "2024-03-27T00:13:12.756137Z",
+ "start_time": "2024-03-27T00:13:12.750764Z"
+ },
+ "collapsed": false,
+ "jupyter": {
+ "outputs_hidden": false
}
},
- "id": "9f5b9bfc78851a59",
- "execution_count": 3
- },
- {
- "cell_type": "code",
"outputs": [],
"source": [
"# instantiate actions\n",
@@ -70,19 +98,22 @@
"def cow_should_speak(state: State) -> Tuple[dict, State]:\n",
" result = {\"cow_should_speak\": random.randint(0, 3) == 0}\n",
" return result, state.update(**result)\n"
- ],
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "id": "271b868317fbbdf4",
"metadata": {
- "collapsed": false,
"ExecuteTime": {
- "end_time": "2024-03-27T00:13:12.756137Z",
- "start_time": "2024-03-27T00:13:12.750764Z"
+ "end_time": "2024-03-27T00:14:10.836543Z",
+ "start_time": "2024-03-27T00:14:10.829258Z"
+ },
+ "collapsed": false,
+ "jupyter": {
+ "outputs_hidden": false
}
},
- "id": "5b29e9de2ca536b9",
- "execution_count": 4
- },
- {
- "cell_type": "code",
"outputs": [],
"source": [
"# build application\n",
@@ -110,24 +141,86 @@
" .with_hooks(*hooks)\n",
" .build()\n",
")"
- ],
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "id": "794bc0abda9e48ad",
"metadata": {
- "collapsed": false,
"ExecuteTime": {
- "end_time": "2024-03-27T00:14:10.836543Z",
- "start_time": "2024-03-27T00:14:10.829258Z"
+ "end_time": "2024-03-27T00:14:29.829383Z",
+ "start_time": "2024-03-27T00:14:29.511355Z"
+ },
+ "collapsed": false,
+ "jupyter": {
+ "outputs_hidden": false
}
},
- "id": "271b868317fbbdf4",
- "execution_count": 5
- },
- {
- "cell_type": "code",
"outputs": [
{
"data": {
- "image/svg+xml": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n<!-- Generated by graphviz version 9.0.0 (20230911.1827)\n -->\n<!-- Pages: 1 -->\n<svg width=\"192pt\" height=\"209pt\"\n viewBox=\"0.00 0.00 192.02 209.00\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 205)\">\n<polygon fill=\"white\" stroke=\"none\" points=\"-4,4 -4,-205 188.02,-205 188.02,4 -4,4\"/>\n<!-- say_nothing -->\n<g id=\"node1\" class=\"node\">\n<title>say_nothing</title>\n<path fill=\"none\" stroke=\"black\" d=\"M89.27,-201C89.27,-201 31.27,-201 31.27,-201 25.27,-201 19.27,-195 19.27,-189 19.27,-189 19.27,-177 19.27,-177 19.27,-171 25.27,-165 31.27,-165 31.27,-165 89.27,-165 89.27,-165 95.27,-165 101.27,-171 101.27,-177 101.27,-177 101.27,-189 101.27,-189 101.27,-195 95.27,-201 89.27,-201\"/>\n<text text-anchor=\"middle\" x=\"60.27\" y=\"-177.95\" font-family=\"Times,serif\" font-size=\"14.00\">say_nothing</text>\n</g>\n<!-- cow_should_speak -->\n<g id=\"node3\" class=\"node\">\n<title>cow_should_speak</title>\n<path fill=\"none\" stroke=\"black\" d=\"M107.65,-118.5C107.65,-118.5 12.9,-118.5 12.9,-118.5 6.9,-118.5 0.9,-112.5 0.9,-106.5 0.9,-106.5 0.9,-94.5 0.9,-94.5 0.9,-88.5 6.9,-82.5 12.9,-82.5 12.9,-82.5 107.65,-82.5 107.65,-82.5 113.65,-82.5 119.65,-88.5 119.65,-94.5 119.65,-94.5 119.65,-106.5 119.65,-106.5 119.65,-112.5 113.65,-118.5 107.65,-118.5\"/>\n<text text-anchor=\"middle\" x=\"60.27\" y=\"-95.45\" font-family=\"Times,serif\" font-size=\"14.00\">cow_should_speak</text>\n</g>\n<!-- say_nothing&#45;&gt;cow_should_speak -->\n<g id=\"edge4\" class=\"edge\">\n<title>say_nothing&#45;&gt;cow_should_speak</title>\n<path fill=\"none\" stroke=\"black\" d=\"M58.99,-164.74C58.7,-159.97 58.42,-154.78 58.27,-150 58.04,-142.67 58.04,-140.83 58.27,-133.5 58.31,-132.3 58.35,-131.08 58.41,-129.85\"/>\n<polygon fill=\"black\" stroke=\"black\" points=\"61.88,-130.45 58.91,-120.27 54.89,-130.07 61.88,-130.45\"/>\n</g>\n<!-- say_hello -->\n<g id=\"node2\" class=\"node\">\n<title>say_hello</title>\n<path fill=\"none\" stroke=\"black\" d=\"M82.15,-36C82.15,-36 38.4,-36 38.4,-36 32.4,-36 26.4,-30 26.4,-24 26.4,-24 26.4,-12 26.4,-12 26.4,-6 32.4,0 38.4,0 38.4,0 82.15,0 82.15,0 88.15,0 94.15,-6 94.15,-12 94.15,-12 94.15,-24 94.15,-24 94.15,-30 88.15,-36 82.15,-36\"/>\n<text text-anchor=\"middle\" x=\"60.27\" y=\"-12.95\" font-family=\"Times,serif\" font-size=\"14.00\">say_hello</text>\n</g>\n<!-- say_hello&#45;&gt;cow_should_speak -->\n<g id=\"edge2\" class=\"edge\">\n<title>say_hello&#45;&gt;cow_should_speak</title>\n<path fill=\"none\" stroke=\"black\" d=\"M93.05,-36.42C97.97,-40.53 102.37,-45.38 105.27,-51 108.63,-57.52 108.63,-60.98 105.27,-67.5 104.09,-69.78 102.67,-71.94 101.06,-73.97\"/>\n<polygon fill=\"black\" stroke=\"black\" points=\"98.65,-71.43 94.11,-81 103.63,-76.35 98.65,-71.43\"/>\n</g>\n<!-- cow_should_speak&#45;&gt;say_nothing -->\n<g id=\"edge3\" class=\"edge\">\n<title>cow_should_speak&#45;&gt;say_nothing</title>\n<path fill=\"none\" stroke=\"black\" stroke-dasharray=\"5,2\" d=\"M60.27,-118.93C60.27,-128.95 60.27,-141.78 60.27,-153.25\"/>\n<polygon fill=\"black\" stroke=\"black\" points=\"56.77,-153.02 60.27,-163.02 63.77,-153.02 56.77,-153.02\"/>\n<text text-anchor=\"middle\" x=\"122.15\" y=\"-136.7\" font-family=\"Times,serif\" font-size=\"14.00\">not cow_should_speak</text>\n</g>\n<!-- cow_should_speak&#45;&gt;say_hello -->\n<g id=\"edge1\" class=\"edge\">\n<title>cow_should_speak&#45;&gt;say_hello</title>\n<path fill=\"none\" stroke=\"black\" stroke-dasharray=\"5,2\" d=\"M16.41,-82.17C10.87,-78.17 5.95,-73.33 2.52,-67.5 -4.42,-55.72 3.91,-45.49 16.2,-37.49\"/>\n<polygon fill=\"black\" stroke=\"black\" points=\"17.9,-40.55 24.87,-32.57 14.44,-34.46 17.9,-40.55\"/>\n<text text-anchor=\"middle\" x=\"54.65\" y=\"-54.2\" font-family=\"Times,serif\" font-size=\"14.00\">cow_should_speak</text>\n</g>\n</g>\n</svg>\n",
- "text/plain": "<graphviz.graphs.Digraph at 0x1107a98a0>"
+ "image/svg+xml": [
+ "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n",
+ "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n",
+ " \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n",
+ "<!-- Generated by graphviz version 9.0.0 (20230911.1827)\n",
+ " -->\n",
+ "<!-- Pages: 1 -->\n",
+ "<svg width=\"192pt\" height=\"209pt\"\n",
+ " viewBox=\"0.00 0.00 192.02 209.00\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
+ "<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 205)\">\n",
+ "<polygon fill=\"white\" stroke=\"none\" points=\"-4,4 -4,-205 188.02,-205 188.02,4 -4,4\"/>\n",
+ "<!-- say_nothing -->\n",
+ "<g id=\"node1\" class=\"node\">\n",
+ "<title>say_nothing</title>\n",
+ "<path fill=\"none\" stroke=\"black\" d=\"M89.27,-201C89.27,-201 31.27,-201 31.27,-201 25.27,-201 19.27,-195 19.27,-189 19.27,-189 19.27,-177 19.27,-177 19.27,-171 25.27,-165 31.27,-165 31.27,-165 89.27,-165 89.27,-165 95.27,-165 101.27,-171 101.27,-177 101.27,-177 101.27,-189 101.27,-189 101.27,-195 95.27,-201 89.27,-201\"/>\n",
+ "<text text-anchor=\"middle\" x=\"60.27\" y=\"-177.95\" font-family=\"Times,serif\" font-size=\"14.00\">say_nothing</text>\n",
+ "</g>\n",
+ "<!-- cow_should_speak -->\n",
+ "<g id=\"node3\" class=\"node\">\n",
+ "<title>cow_should_speak</title>\n",
+ "<path fill=\"none\" stroke=\"black\" d=\"M107.65,-118.5C107.65,-118.5 12.9,-118.5 12.9,-118.5 6.9,-118.5 0.9,-112.5 0.9,-106.5 0.9,-106.5 0.9,-94.5 0.9,-94.5 0.9,-88.5 6.9,-82.5 12.9,-82.5 12.9,-82.5 107.65,-82.5 107.65,-82.5 113.65,-82.5 119.65,-88.5 119.65,-94.5 119.65,-94.5 119.65,-106.5 119.65,-106.5 119.65,-112.5 113.65,-118.5 107.65,-118.5\"/>\n",
+ "<text text-anchor=\"middle\" x=\"60.27\" y=\"-95.45\" font-family=\"Times,serif\" font-size=\"14.00\">cow_should_speak</text>\n",
+ "</g>\n",
+ "<!-- say_nothing&#45;&gt;cow_should_speak -->\n",
+ "<g id=\"edge4\" class=\"edge\">\n",
+ "<title>say_nothing&#45;&gt;cow_should_speak</title>\n",
+ "<path fill=\"none\" stroke=\"black\" d=\"M58.99,-164.74C58.7,-159.97 58.42,-154.78 58.27,-150 58.04,-142.67 58.04,-140.83 58.27,-133.5 58.31,-132.3 58.35,-131.08 58.41,-129.85\"/>\n",
+ "<polygon fill=\"black\" stroke=\"black\" points=\"61.88,-130.45 58.91,-120.27 54.89,-130.07 61.88,-130.45\"/>\n",
+ "</g>\n",
+ "<!-- say_hello -->\n",
+ "<g id=\"node2\" class=\"node\">\n",
+ "<title>say_hello</title>\n",
+ "<path fill=\"none\" stroke=\"black\" d=\"M82.15,-36C82.15,-36 38.4,-36 38.4,-36 32.4,-36 26.4,-30 26.4,-24 26.4,-24 26.4,-12 26.4,-12 26.4,-6 32.4,0 38.4,0 38.4,0 82.15,0 82.15,0 88.15,0 94.15,-6 94.15,-12 94.15,-12 94.15,-24 94.15,-24 94.15,-30 88.15,-36 82.15,-36\"/>\n",
+ "<text text-anchor=\"middle\" x=\"60.27\" y=\"-12.95\" font-family=\"Times,serif\" font-size=\"14.00\">say_hello</text>\n",
+ "</g>\n",
+ "<!-- say_hello&#45;&gt;cow_should_speak -->\n",
+ "<g id=\"edge2\" class=\"edge\">\n",
+ "<title>say_hello&#45;&gt;cow_should_speak</title>\n",
+ "<path fill=\"none\" stroke=\"black\" d=\"M93.05,-36.42C97.97,-40.53 102.37,-45.38 105.27,-51 108.63,-57.52 108.63,-60.98 105.27,-67.5 104.09,-69.78 102.67,-71.94 101.06,-73.97\"/>\n",
+ "<polygon fill=\"black\" stroke=\"black\" points=\"98.65,-71.43 94.11,-81 103.63,-76.35 98.65,-71.43\"/>\n",
+ "</g>\n",
+ "<!-- cow_should_speak&#45;&gt;say_nothing -->\n",
+ "<g id=\"edge3\" class=\"edge\">\n",
+ "<title>cow_should_speak&#45;&gt;say_nothing</title>\n",
+ "<path fill=\"none\" stroke=\"black\" stroke-dasharray=\"5,2\" d=\"M60.27,-118.93C60.27,-128.95 60.27,-141.78 60.27,-153.25\"/>\n",
+ "<polygon fill=\"black\" stroke=\"black\" points=\"56.77,-153.02 60.27,-163.02 63.77,-153.02 56.77,-153.02\"/>\n",
+ "<text text-anchor=\"middle\" x=\"122.15\" y=\"-136.7\" font-family=\"Times,serif\" font-size=\"14.00\">not cow_should_speak</text>\n",
+ "</g>\n",
+ "<!-- cow_should_speak&#45;&gt;say_hello -->\n",
+ "<g id=\"edge1\" class=\"edge\">\n",
+ "<title>cow_should_speak&#45;&gt;say_hello</title>\n",
+ "<path fill=\"none\" stroke=\"black\" stroke-dasharray=\"5,2\" d=\"M16.41,-82.17C10.87,-78.17 5.95,-73.33 2.52,-67.5 -4.42,-55.72 3.91,-45.49 16.2,-37.49\"/>\n",
+ "<polygon fill=\"black\" stroke=\"black\" points=\"17.9,-40.55 24.87,-32.57 14.44,-34.46 17.9,-40.55\"/>\n",
+ "<text text-anchor=\"middle\" x=\"54.65\" y=\"-54.2\" font-family=\"Times,serif\" font-size=\"14.00\">cow_should_speak</text>\n",
+ "</g>\n",
+ "</g>\n",
+ "</svg>\n"
+ ],
+ "text/plain": [
+ "<graphviz.graphs.Digraph at 0x1107a98a0>"
+ ]
},
"execution_count": 6,
"metadata": {},
@@ -136,19 +229,22 @@
],
"source": [
"app.visualize(include_conditions=True)"
- ],
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "id": "2facfb753233cd7d",
"metadata": {
- "collapsed": false,
"ExecuteTime": {
- "end_time": "2024-03-27T00:14:29.829383Z",
- "start_time": "2024-03-27T00:14:29.511355Z"
+ "end_time": "2024-03-27T00:16:40.234406Z",
+ "start_time": "2024-03-27T00:16:32.211734Z"
+ },
+ "collapsed": false,
+ "jupyter": {
+ "outputs_hidden": false
}
},
- "id": "794bc0abda9e48ad",
- "execution_count": 6
- },
- {
- "cell_type": "code",
"outputs": [
{
"name": "stdout",
@@ -202,19 +298,22 @@
"for i in range(0, 4):\n",
" # step through 4 times\n",
" a_obj, result, state = app.step()"
- ],
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 16,
+ "id": "fed65721e7cc457a",
"metadata": {
- "collapsed": false,
"ExecuteTime": {
- "end_time": "2024-03-27T00:16:40.234406Z",
- "start_time": "2024-03-27T00:16:32.211734Z"
+ "end_time": "2024-03-27T00:17:18.640978Z",
+ "start_time": "2024-03-27T00:17:10.619878Z"
+ },
+ "collapsed": false,
+ "jupyter": {
+ "outputs_hidden": false
}
},
- "id": "2facfb753233cd7d",
- "execution_count": 11
- },
- {
- "cell_type": "code",
"outputs": [
{
"name": "stdout",
@@ -268,44 +367,39 @@
"for i in range(0, 4):\n",
" # step through 4 times\n",
" a_obj, result, state = app.step()"
- ],
- "metadata": {
- "collapsed": false,
- "ExecuteTime": {
- "end_time": "2024-03-27T00:17:18.640978Z",
- "start_time": "2024-03-27T00:17:10.619878Z"
- }
- },
- "id": "fed65721e7cc457a",
- "execution_count": 16
+ ]
},
{
"cell_type": "code",
- "outputs": [],
- "source": [],
+ "execution_count": null,
+ "id": "19095ae96e98fd83",
"metadata": {
- "collapsed": false
+ "collapsed": false,
+ "jupyter": {
+ "outputs_hidden": false
+ }
},
- "id": "19095ae96e98fd83"
+ "outputs": [],
+ "source": []
}
],
"metadata": {
"kernelspec": {
- "display_name": "Python 3",
+ "display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
- "version": 2
+ "version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
- "pygments_lexer": "ipython2",
- "version": "2.7.6"
+ "pygments_lexer": "ipython3",
+ "version": "3.10.4"
}
},
"nbformat": 4,
diff --git a/examples/simple-chatbot-intro/README.md b/examples/simple-chatbot-intro/README.md
index fad29c75..62dd8dfa 100644
--- a/examples/simple-chatbot-intro/README.md
+++ b/examples/simple-chatbot-intro/README.md
@@ -12,4 +12,6 @@ Run the notebook:
jupyter notebook
```
-Then open `blog.ipynb` and run the cells.
+Then open `notebook.ipynb` and run the cells. Or <a target="_blank" href="https://colab.research.google.com/github/dagworks-inc/burr/blob/main/examples/simple-chatbot-intro/notebook.ipynb">
+ <img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/>
+</a>
diff --git a/examples/simple-chatbot-intro/notebook.ipynb b/examples/simple-chatbot-intro/notebook.ipynb
index edcbf95f..82cae4de 100644
--- a/examples/simple-chatbot-intro/notebook.ipynb
+++ b/examples/simple-chatbot-intro/notebook.ipynb
@@ -17,7 +17,7 @@
},
"outputs": [],
"source": [
- "%pip install \"burr[start]\""
+ "!pip install \"burr[start]\""
]
},
{
@@ -456,7 +456,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
- "version": "3.11.6"
+ "version": "3.10.4"
}
},
"nbformat": 4,
diff --git a/examples/streaming-overview/README.md b/examples/streaming-overview/README.md
index cf90e0d6..a6a4531a 100644
--- a/examples/streaming-overview/README.md
+++ b/examples/streaming-overview/README.md
@@ -11,3 +11,8 @@ but it is built slightly differently (for streaming purposes).
Run `streamlit run streamlit_app.py` from the command line and you will see the chatbot in action.
Open up the burr UI `burr` and you can track the chatbot
+
+## Notebook
+The notebook also shows how things work. <a target="_blank" href="https://colab.research.google.com/github/dagworks-inc/burr/blob/main/examples/streaming-overview/notebook.ipynb">
+ <img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/>
+</a>
diff --git a/examples/streaming-overview/notebook.ipynb b/examples/streaming-overview/notebook.ipynb
index 5de1b095..b738e69c 100644
--- a/examples/streaming-overview/notebook.ipynb
+++ b/examples/streaming-overview/notebook.ipynb
@@ -1,5 +1,15 @@
{
"cells": [
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "1ce738e6-14b4-4892-9f2d-a1db94cfb29a",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "!pip install burr"
+ ]
+ },
{
"cell_type": "markdown",
"id": "2118a2f4-d969-4771-81d3-156b432d1dc8",
@@ -372,7 +382,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
- "version": "3.11.6"
+ "version": "3.10.4"
}
},
"nbformat": 4,
diff --git a/examples/test-case-creation/README.md b/examples/test-case-creation/README.md
index d430f6da..9bce2807 100644
--- a/examples/test-case-creation/README.md
+++ b/examples/test-case-creation/README.md
@@ -46,6 +46,10 @@ See [the notebook](./notebook.ipynb) for example usage.
In `test_application.py` you'll find examples tests for a simple action
that is found in `application.py`.
+## Notebook
+The notebook also shows how things work. <a target="_blank" href="https://colab.research.google.com/github/dagworks-inc/burr/blob/main/examples/test-case-creation/notebook.ipynb">
+ <img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/>
+</a>
## Future Work
We see many more improvements here:
diff --git a/examples/test-case-creation/notebook.ipynb b/examples/test-case-creation/notebook.ipynb
index 74876cde..96ed8d8d 100644
--- a/examples/test-case-creation/notebook.ipynb
+++ b/examples/test-case-creation/notebook.ipynb
@@ -1,5 +1,15 @@
{
"cells": [
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "af165506-cc16-485c-8875-f1ec55dd94b5",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "!pip install burr"
+ ]
+ },
{
"cell_type": "code",
"execution_count": 1,
diff --git a/examples/tracing-and-spans/README.md b/examples/tracing-and-spans/README.md
index 5bafb91f..252ebd9f 100644
--- a/examples/tracing-and-spans/README.md
+++ b/examples/tracing-and-spans/README.md
@@ -10,3 +10,7 @@ still building out capabilities to do this more automatically.
These traces are used in the Burr UI. E.G. as follows:
![tracing](tracing_screencap.png)
+
+The notebook also shows how things work. <a target="_blank" href="https://colab.research.google.com/github/dagworks-inc/burr/blob/main/examples/tracing-and-spans/notebook.ipynb">
+ <img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/>
+</a>
diff --git a/examples/tracing-and-spans/notebook.ipynb b/examples/tracing-and-spans/notebook.ipynb
index bcd167fa..1d847f26 100644
--- a/examples/tracing-and-spans/notebook.ipynb
+++ b/examples/tracing-and-spans/notebook.ipynb
@@ -1,5 +1,15 @@
{
"cells": [
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "e1fcc525-8149-451e-b9f6-f1656a406d39",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "!pip install burr"
+ ]
+ },
{
"cell_type": "markdown",
"id": "5f7d4516-c5e1-4889-abed-155645c41d9d",
@@ -339,7 +349,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
- "version": "3.11.6"
+ "version": "3.10.4"
}
},
"nbformat": 4,