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 for PR feedback
elijahbenizzy63172976df3e
diff --git a/docs/examples/web-server.rst b/docs/examples/web-server.rstindex 782c9f81..268fb844 100644--- a/docs/examples/web-server.rst+++ b/docs/examples/web-server.rst@@ -3,4 +3,4 @@ Exposing in a Web Server========================Burr makes it natural to integrate with a web-server such as FastAPI. See the [example in the repository](https://github.com/DAGWorks-Inc/burr/tree/main/examples/web-server)-for the high-level concepts + some implementation tricks, and a fully-working, runnable demo:+for the high-level concepts + some implementation tricks. Run `burr` after `pip install "burr[start]"` and click `examples/email-assistant` to see example in action.diff --git a/examples/email-assistant/server.py b/examples/email-assistant/server.pyindex a4c03d50..256b43ba 100644--- a/examples/email-assistant/server.py+++ b/examples/email-assistant/server.py@@ -1,4 +1,9 @@import functools++"""+This module contains the FastAPI code that interacts with the Burr application.+"""+import importlibimport osfrom typing import Any, Dict, List, Literal, Optionaldiff --git a/examples/web-server/README.md b/examples/web-server/README.mdindex 584928e6..55984bf6 100644--- a/examples/web-server/README.md+++ b/examples/web-server/README.md@@ -1,9 +1,9 @@# Running Burr in a web serverBurr is meant to run interactive apps. This means running it as part of a web-service that-responds to requests, maanges state, and documents its capabilities. The interactive nature of Burr+responds to requests, manages state, and documents its capabilities. The interactive nature of Burr(moving in/out of programmatic control) means we want to think carefully about how to expose-our burr applications to the web.+our Burr applications to the web.In this tutorial we will use the [email assistant example](../email-assistant) as a walk-through.Our goal is to expose the email assistant in a web-server that a UI can easily be built on top of.@@ -183,8 +183,9 @@ in which the state is out of sync. To solve this, you can either:1. Use a locking method (either in the database) to ensure that only one server is running a given application at any point2. Use sticky sessions/sharding to ensure that a given user always hits the same server+3. Handle forking/resolution of state at the persistence layer with a custom implementation-Or possibly both.+Or possibly some combination of the above.#### Async@@ -205,7 +206,7 @@ While Burr does not operate at the data access layer, this can be easily handlesAny authentication system will tell you the user ID, which you can look in your DB to determine accessto your partition key.-## Wrapup+## Wrap-upIn this tutorial we showed how to integrate Burr into a web-server. We used FastAPI and Pydanticto create a simple but powerful API that allows users to interact with the email assistant, leveraging