Build applications that make decisions (chatbots, agents, simulations, etc...). Monitor, trace, persist, and execute on your own infrastructure.
Python aiburrchatbot-frameworkdagsgenerative-aigraphshacktoberfestllmopsllmsmlopspersistent-data-structurestate-machinestate-managementvisibility
Updates notebook + fixes render
elijahbenizzy6d69bae0b019
diff --git a/examples/email-assistant/notebook.ipynb b/examples/email-assistant/notebook.ipynbindex e33f01a4..42601ca4 100644--- a/examples/email-assistant/notebook.ipynb+++ b/examples/email-assistant/notebook.ipynb@@ -37,7 +37,7 @@},{"cell_type": "code",- "execution_count": 1,+ "execution_count": null,"id": "b59e926f-058d-4bac-b97e-ff173d3be7a4","metadata": {},"outputs": [],@@ -47,163 +47,10 @@},{"cell_type": "code",- "execution_count": 2,+ "execution_count": null,"id": "c7aba1b3-5886-4255-b2f5-b40627896196","metadata": {},- "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 8.1.0 (20230707.0739)\n",- " -->\n",- "<!-- Pages: 1 -->\n",- "<svg width=\"555pt\" height=\"477pt\"\n",- " viewBox=\"0.00 0.00 555.44 477.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 473)\">\n",- "<polygon fill=\"white\" stroke=\"none\" points=\"-4,4 -4,-473 551.44,-473 551.44,4 -4,4\"/>\n",- "<!-- process_input -->\n",- "<g id=\"node1\" class=\"node\">\n",- "<title>process_input</title>\n",- "<path fill=\"none\" stroke=\"black\" d=\"M349.13,-402C349.13,-402 282.13,-402 282.13,-402 276.13,-402 270.13,-396 270.13,-390 270.13,-390 270.13,-378 270.13,-378 270.13,-372 276.13,-366 282.13,-366 282.13,-366 349.13,-366 349.13,-366 355.13,-366 361.13,-372 361.13,-378 361.13,-378 361.13,-390 361.13,-390 361.13,-396 355.13,-402 349.13,-402\"/>\n",- "<text text-anchor=\"middle\" x=\"315.63\" y=\"-378.95\" font-family=\"Times,serif\" font-size=\"14.00\">process_input</text>\n",- "</g>\n",- "<!-- determine_clarifications -->\n",- "<g id=\"node4\" class=\"node\">\n",- "<title>determine_clarifications</title>\n",- "<path fill=\"none\" stroke=\"black\" d=\"M377.63,-335C377.63,-335 253.63,-335 253.63,-335 247.63,-335 241.63,-329 241.63,-323 241.63,-323 241.63,-311 241.63,-311 241.63,-305 247.63,-299 253.63,-299 253.63,-299 377.63,-299 377.63,-299 383.63,-299 389.63,-305 389.63,-311 389.63,-311 389.63,-323 389.63,-323 389.63,-329 383.63,-335 377.63,-335\"/>\n",- "<text text-anchor=\"middle\" x=\"315.63\" y=\"-311.95\" font-family=\"Times,serif\" font-size=\"14.00\">determine_clarifications</text>\n",- "</g>\n",- "<!-- process_input->determine_clarifications -->\n",- "<g id=\"edge5\" class=\"edge\">\n",- "<title>process_input->determine_clarifications</title>\n",- "<path fill=\"none\" stroke=\"black\" d=\"M315.63,-365.58C315.63,-359.61 315.63,-352.76 315.63,-346.15\"/>\n",- "<polygon fill=\"black\" stroke=\"black\" points=\"319.13,-346.47 315.63,-336.47 312.13,-346.47 319.13,-346.47\"/>\n",- "</g>\n",- "<!-- input__email_to_respond -->\n",- "<g id=\"node2\" class=\"node\">\n",- "<title>input__email_to_respond</title>\n",- "<ellipse fill=\"none\" stroke=\"black\" stroke-dasharray=\"5,2\" cx=\"198.63\" cy=\"-451\" rx=\"101.51\" ry=\"18\"/>\n",- "<text text-anchor=\"middle\" x=\"198.63\" y=\"-445.95\" font-family=\"Times,serif\" font-size=\"14.00\">input: email_to_respond</text>\n",- "</g>\n",- "<!-- input__email_to_respond->process_input -->\n",- "<g id=\"edge1\" class=\"edge\">\n",- "<title>input__email_to_respond->process_input</title>\n",- "<path fill=\"none\" stroke=\"black\" d=\"M228.45,-433.43C242.58,-425.58 259.68,-416.08 274.97,-407.59\"/>\n",- "<polygon fill=\"black\" stroke=\"black\" points=\"276.18,-410.37 283.22,-402.45 272.78,-404.25 276.18,-410.37\"/>\n",- "</g>\n",- "<!-- input__response_instructions -->\n",- "<g id=\"node3\" class=\"node\">\n",- "<title>input__response_instructions</title>\n",- "<ellipse fill=\"none\" stroke=\"black\" stroke-dasharray=\"5,2\" cx=\"432.63\" cy=\"-451\" rx=\"114.82\" ry=\"18\"/>\n",- "<text text-anchor=\"middle\" x=\"432.63\" y=\"-445.95\" font-family=\"Times,serif\" font-size=\"14.00\">input: response_instructions</text>\n",- "</g>\n",- "<!-- input__response_instructions->process_input -->\n",- "<g id=\"edge2\" class=\"edge\">\n",- "<title>input__response_instructions->process_input</title>\n",- "<path fill=\"none\" stroke=\"black\" d=\"M402.5,-433.26C388.37,-425.41 371.32,-415.94 356.09,-407.48\"/>\n",- "<polygon fill=\"black\" stroke=\"black\" points=\"358.32,-404.16 347.88,-402.36 354.92,-410.28 358.32,-404.16\"/>\n",- "</g>\n",- "<!-- clarify_instructions -->\n",- "<g id=\"node5\" class=\"node\">\n",- "<title>clarify_instructions</title>\n",- "<path fill=\"none\" stroke=\"black\" d=\"M188.13,-252.5C188.13,-252.5 91.13,-252.5 91.13,-252.5 85.13,-252.5 79.13,-246.5 79.13,-240.5 79.13,-240.5 79.13,-228.5 79.13,-228.5 79.13,-222.5 85.13,-216.5 91.13,-216.5 91.13,-216.5 188.13,-216.5 188.13,-216.5 194.13,-216.5 200.13,-222.5 200.13,-228.5 200.13,-228.5 200.13,-240.5 200.13,-240.5 200.13,-246.5 194.13,-252.5 188.13,-252.5\"/>\n",- "<text text-anchor=\"middle\" x=\"139.63\" y=\"-229.45\" font-family=\"Times,serif\" font-size=\"14.00\">clarify_instructions</text>\n",- "</g>\n",- "<!-- determine_clarifications->clarify_instructions -->\n",- "<g id=\"edge6\" class=\"edge\">\n",- "<title>determine_clarifications->clarify_instructions</title>\n",- "<path fill=\"none\" stroke=\"black\" stroke-dasharray=\"5,2\" d=\"M241.16,-302.38C193.53,-293.67 140.63,-284 140.63,-284 135.84,-278.38 134.22,-270.92 134.15,-263.54\"/>\n",- "<polygon fill=\"black\" stroke=\"black\" points=\"137.71,-263.91 135.03,-253.66 130.73,-263.34 137.71,-263.91\"/>\n",- "<text text-anchor=\"middle\" x=\"226.13\" y=\"-270.7\" font-family=\"Times,serif\" font-size=\"14.00\">len(clarification_questions) > 0</text>\n",- "</g>\n",- "<!-- formulate_draft -->\n",- "<g id=\"node7\" class=\"node\">\n",- "<title>formulate_draft</title>\n",- "<path fill=\"none\" stroke=\"black\" d=\"M311.38,-185.5C311.38,-185.5 233.88,-185.5 233.88,-185.5 227.88,-185.5 221.88,-179.5 221.88,-173.5 221.88,-173.5 221.88,-161.5 221.88,-161.5 221.88,-155.5 227.88,-149.5 233.88,-149.5 233.88,-149.5 311.38,-149.5 311.38,-149.5 317.38,-149.5 323.38,-155.5 323.38,-161.5 323.38,-161.5 323.38,-173.5 323.38,-173.5 323.38,-179.5 317.38,-185.5 311.38,-185.5\"/>\n",- "<text text-anchor=\"middle\" x=\"272.63\" y=\"-162.45\" font-family=\"Times,serif\" font-size=\"14.00\">formulate_draft</text>\n",- "</g>\n",- "<!-- determine_clarifications->formulate_draft -->\n",- "<g id=\"edge7\" class=\"edge\">\n",- "<title>determine_clarifications->formulate_draft</title>\n",- "<path fill=\"none\" stroke=\"black\" d=\"M315.43,-298.75C315.02,-289.4 314,-277.7 311.63,-267.5 305.77,-242.34 294.67,-215.12 285.81,-195.6\"/>\n",- "<polygon fill=\"black\" stroke=\"black\" points=\"288.68,-194.47 281.29,-186.88 282.33,-197.43 288.68,-194.47\"/>\n",- "</g>\n",- "<!-- clarify_instructions->formulate_draft -->\n",- "<g id=\"edge8\" class=\"edge\">\n",- "<title>clarify_instructions->formulate_draft</title>\n",- "<path fill=\"none\" stroke=\"black\" d=\"M175.27,-216.08C191.22,-208.29 210.22,-199 227.18,-190.71\"/>\n",- "<polygon fill=\"black\" stroke=\"black\" points=\"228.44,-193.5 235.89,-185.97 225.37,-187.21 228.44,-193.5\"/>\n",- "</g>\n",- "<!-- input__clarification_inputs -->\n",- "<g id=\"node6\" class=\"node\">\n",- "<title>input__clarification_inputs</title>\n",- "<ellipse fill=\"none\" stroke=\"black\" stroke-dasharray=\"5,2\" cx=\"106.63\" cy=\"-317\" rx=\"106.63\" ry=\"18\"/>\n",- "<text text-anchor=\"middle\" x=\"106.63\" y=\"-311.95\" font-family=\"Times,serif\" font-size=\"14.00\">input: clarification_inputs</text>\n",- "</g>\n",- "<!-- input__clarification_inputs->clarify_instructions -->\n",- "<g id=\"edge3\" class=\"edge\">\n",- "<title>input__clarification_inputs->clarify_instructions</title>\n",- "<path fill=\"none\" stroke=\"black\" d=\"M110.51,-298.57C112.89,-289.16 116.31,-277.47 120.63,-267.5 121.43,-265.63 122.33,-263.74 123.28,-261.86\"/>\n",- "<polygon fill=\"black\" stroke=\"black\" points=\"126.58,-264.13 128.34,-253.68 120.45,-260.75 126.58,-264.13\"/>\n",- "</g>\n",- "<!-- process_feedback -->\n",- "<g id=\"node8\" class=\"node\">\n",- "<title>process_feedback</title>\n",- "<path fill=\"none\" stroke=\"black\" d=\"M283.63,-103C283.63,-103 195.63,-103 195.63,-103 189.63,-103 183.63,-97 183.63,-91 183.63,-91 183.63,-79 183.63,-79 183.63,-73 189.63,-67 195.63,-67 195.63,-67 283.63,-67 283.63,-67 289.63,-67 295.63,-73 295.63,-79 295.63,-79 295.63,-91 295.63,-91 295.63,-97 289.63,-103 283.63,-103\"/>\n",- "<text text-anchor=\"middle\" x=\"239.63\" y=\"-79.95\" font-family=\"Times,serif\" font-size=\"14.00\">process_feedback</text>\n",- "</g>\n",- "<!-- formulate_draft->process_feedback -->\n",- "<g id=\"edge9\" class=\"edge\">\n",- "<title>formulate_draft->process_feedback</title>\n",- "<path fill=\"none\" stroke=\"black\" d=\"M261.34,-149.32C258.57,-144.64 255.78,-139.48 253.63,-134.5 250.79,-127.95 248.35,-120.67 246.33,-113.78\"/>\n",- "<polygon fill=\"black\" stroke=\"black\" points=\"249.52,-113.16 243.51,-104.43 242.76,-115 249.52,-113.16\"/>\n",- "</g>\n",- "<!-- process_feedback->formulate_draft -->\n",- "<g id=\"edge10\" class=\"edge\">\n",- "<title>process_feedback->formulate_draft</title>\n",- "<path fill=\"none\" stroke=\"black\" stroke-dasharray=\"5,2\" d=\"M246.77,-103.43C251.05,-113.87 256.58,-127.36 261.43,-139.19\"/>\n",- "<polygon fill=\"black\" stroke=\"black\" points=\"258.43,-140.11 265.47,-148.03 264.91,-137.45 258.43,-140.11\"/>\n",- "<text text-anchor=\"middle\" x=\"308\" y=\"-121.2\" font-family=\"Times,serif\" font-size=\"14.00\">len(feedback) > 0</text>\n",- "</g>\n",- "<!-- final_result -->\n",- "<g id=\"node10\" class=\"node\">\n",- "<title>final_result</title>\n",- "<path fill=\"none\" stroke=\"black\" d=\"M266.38,-36C266.38,-36 212.88,-36 212.88,-36 206.88,-36 200.88,-30 200.88,-24 200.88,-24 200.88,-12 200.88,-12 200.88,-6 206.88,0 212.88,0 212.88,0 266.38,0 266.38,0 272.38,0 278.38,-6 278.38,-12 278.38,-12 278.38,-24 278.38,-24 278.38,-30 272.38,-36 266.38,-36\"/>\n",- "<text text-anchor=\"middle\" x=\"239.63\" y=\"-12.95\" font-family=\"Times,serif\" font-size=\"14.00\">final_result</text>\n",- "</g>\n",- "<!-- process_feedback->final_result -->\n",- "<g id=\"edge11\" class=\"edge\">\n",- "<title>process_feedback->final_result</title>\n",- "<path fill=\"none\" stroke=\"black\" d=\"M239.63,-66.58C239.63,-60.61 239.63,-53.76 239.63,-47.15\"/>\n",- "<polygon fill=\"black\" stroke=\"black\" points=\"243.13,-47.47 239.63,-37.47 236.13,-47.47 243.13,-47.47\"/>\n",- "</g>\n",- "<!-- input__feedback -->\n",- "<g id=\"node9\" class=\"node\">\n",- "<title>input__feedback</title>\n",- "<ellipse fill=\"none\" stroke=\"black\" stroke-dasharray=\"5,2\" cx=\"135.63\" cy=\"-167.5\" rx=\"68.24\" ry=\"18\"/>\n",- "<text text-anchor=\"middle\" x=\"135.63\" y=\"-162.45\" font-family=\"Times,serif\" font-size=\"14.00\">input: feedback</text>\n",- "</g>\n",- "<!-- input__feedback->process_feedback -->\n",- "<g id=\"edge4\" class=\"edge\">\n",- "<title>input__feedback->process_feedback</title>\n",- "<path fill=\"none\" stroke=\"black\" d=\"M156.92,-150.02C171.9,-138.42 192.18,-122.73 208.9,-109.78\"/>\n",- "<polygon fill=\"black\" stroke=\"black\" points=\"210.51,-112.19 216.28,-103.3 206.23,-106.65 210.51,-112.19\"/>\n",- "</g>\n",- "</g>\n",- "</svg>\n"- ],- "text/plain": [- "<graphviz.graphs.Digraph at 0x1065c4fd0>"- ]- },- "execution_count": 2,- "metadata": {},- "output_type": "execute_result"- }- ],+ "outputs": [],"source": ["app = email_assistant_application()\n","app.visualize(include_conditions=True, include_state=False)"@@ -221,24 +68,10 @@},{"cell_type": "code",- "execution_count": 3,+ "execution_count": null,"id": "6ab6da4d-3011-4fc3-847e-93f948667073","metadata": {},- "outputs": [- {- "data": {- "text/markdown": [- "[Link to UI](http://localhost:7241/project/demo:email_assistant/a053f4c9-1973-4ef1-94ac-b0c2db19be7f)"- ],- "text/plain": [- "<IPython.core.display.Markdown object>"- ]- },- "execution_count": 3,- "metadata": {},- "output_type": "execute_result"- }- ],+ "outputs": [],"source": ["from IPython.display import Markdown\n","url = f\"[Link to UI](http://localhost:7241/project/demo:email_assistant/{app.uid})\"\n",@@ -259,7 +92,7 @@},{"cell_type": "code",- "execution_count": 4,+ "execution_count": null,"id": "8f724b1e-e282-4e8d-9c13-8e218ee04e87","metadata": {},"outputs": [],@@ -309,7 +142,7 @@},{"cell_type": "code",- "execution_count": 5,+ "execution_count": null,"id": "1c8badad-496f-4d0e-848d-beee0b836243","metadata": {},"outputs": [@@ -320,107 +153,6 @@"The email assistant wants more information:\n","\n"]- },- {- "name": "stdin",- "output_type": "stream",- "text": [- "1. Can you please provide some specific features or achievements about the Hamilton and Burr libraries that you would like highlighted? Wide usage, large number of enterprise customers, pluggable, lightweight\n",- "2. Are there any particular benefits or testimonials from users of Hamilton and Burr libraries that we can share? let's hold off on that\n",- "3. What level of engagement, if any, are you willing to have with this organization beyond this instance of promotion? let's avoid taht\n"- ]- },- {- "name": "stdout",- "output_type": "stream",- "text": [- "here's a draft!: \n",- " Subject: Re: DAGWorks's Feature in Your 8th Annual Edition on Artificial Intelligence\n",- "\n",- "Dear [Someone],\n",- "\n",- "Thank you for your last email and the opportunity to feature DAGWorks in your forthcoming 8th annual edition on Artificial Intelligence. Your outreach is appreciated and has certainly sparked some interest given the proven positive results you've suggested.\n",- "\n",- "In the spirit of establishing a mutual understanding, we're particularly proud of our standout tools Hamilton and Burr. Both libraries have been recognized for their wide usage, tailor-made features for enterprises, and their pluggability and lightweight nature. This recognition has been supported by a large number of enterprise customers, cementing their position as formidable tools in the AI field.\n",- "\n",- "Without necessarily engaging in a full-fledged partnership, it would be interesting to consider how these libraries could be highlighted in your edition. This could help promote our tooling even further and potentially draw in more users in the AI community.\n",- "\n",- "However, let me be frank in stating the nature of our engagement. While we're interested to understand the potential visibility this placement could provide for DAGWorks, at this time, we are not looking to make a financial commitment to your organization.\n",- "\n",- "Despite this, I'd like to hear more about how this feature can bring added value to our organization and particularly these libraries. Please feel free to share any further details that can help us gauge this opportunity.\n",- "\n",- "Looking forward to hearing from you,\n",- "\n",- "Best wishes,\n",- "Elijah,\n",- "DAGWorks.\n",- " \n",- " \n",- " What feedback do you have? If you have no feedback then we'll finish it up.\n"- ]- },- {- "name": "stdin",- "output_type": "stream",- "text": [- "Write feedback or leave blank to continue (if you're happy) Make it slightly less formal\n"- ]- },- {- "name": "stdout",- "output_type": "stream",- "text": [- "here's a draft!: \n",- " Subject: Re: DAGWorks's Feature in Your 8th Annual Edition on Artificial Intelligence\n",- "\n",- "Hey [Someone],\n",- "\n",- "Thanks for reaching out. It's good to hear you're interested in featuring DAGWorks in your upcoming AI edition. You've definitely caught our attention with the promise of those impressive results and I'd like to explore the terms a bit before committing to anything.\n",- "\n",- "Hamilton and Burr - our pride and joy - are two OS libraries that have established a pretty solid name in the AI world. They're widely used, customizable, lightweight, and packed with enterprise features. True gems for AI practitioners!\n",- "\n",- "I’m curious about the potential to put a spotlight on these two in your edition. What better way to get the word out, right? But let's keep it real, while I fancy the idea of a wider audience, we're playing it cautiously and not currently looking to splash any cash. \n",- "\n",- "That being said, I'm all ears to hear more on how this feature might benefit DAGWorks, especially with regards to Hamilton and Burr. Can you spill some beans about what we might expect?\n",- "\n",- "Eager to hear back from you,\n",- "\n",- "Best,\n",- "Elijah,\n",- "DAGWorks. \n",- " \n",- " What feedback do you have? If you have no feedback then we'll finish it up.\n"- ]- },- {- "name": "stdin",- "output_type": "stream",- "text": [- "Write feedback or leave blank to continue (if you're happy) \n"- ]- },- {- "name": "stdout",- "output_type": "stream",- "text": [- "final result is: Subject: Re: DAGWorks's Feature in Your 8th Annual Edition on Artificial Intelligence\n",- "\n",- "Hey [Someone],\n",- "\n",- "Thanks for reaching out. It's good to hear you're interested in featuring DAGWorks in your upcoming AI edition. You've definitely caught our attention with the promise of those impressive results and I'd like to explore the terms a bit before committing to anything.\n",- "\n",- "Hamilton and Burr - our pride and joy - are two OS libraries that have established a pretty solid name in the AI world. They're widely used, customizable, lightweight, and packed with enterprise features. True gems for AI practitioners!\n",- "\n",- "I’m curious about the potential to put a spotlight on these two in your edition. What better way to get the word out, right? But let's keep it real, while I fancy the idea of a wider audience, we're playing it cautiously and not currently looking to splash any cash. \n",- "\n",- "That being said, I'm all ears to hear more on how this feature might benefit DAGWorks, especially with regards to Hamilton and Burr. Can you spill some beans about what we might expect?\n",- "\n",- "Eager to hear back from you,\n",- "\n",- "Best,\n",- "Elijah,\n",- "DAGWorks.\n"- ]}],"source": [@@ -463,6 +195,14 @@" print(\"final result is:\", state[\"current_draft\"])\n"," break"]+ },+ {+ "cell_type": "code",+ "execution_count": null,+ "id": "bb34de1f-e9f1-4a49-9204-924b23e783a2",+ "metadata": {},+ "outputs": [],+ "source": []}],"metadata": {diff --git a/examples/email-assistant/statemachine.png b/examples/email-assistant/statemachine.pngindex fa137358..758677f8 100644Binary files a/examples/email-assistant/statemachine.png and b/examples/email-assistant/statemachine.png differ