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 comments that open ai can be swapped out

Stefan Krawczyk7801cbe85910
diff --git a/docs/getting_started/simple-example.rst b/docs/getting_started/simple-example.rst
index 5ca96e55..8350084b 100644
--- a/docs/getting_started/simple-example.rst
+++ b/docs/getting_started/simple-example.rst
@@ -51,6 +51,7 @@ We define two actions:
.. code-block:: python
+ # Note: you can replace this with your favorite LLM Client
client = openai.Client()
@action(reads=[], writes=["prompt", "chat_history"])
@@ -145,11 +146,11 @@ If you want to copy/paste, you can open up the following code block and add to a
import uuid
- import openai
+ import openai # replace with your LLM library
from burr.core import action, State, ApplicationBuilder
- client = openai.Client()
+ client = openai.Client() # replace this if not using OpenAI
@action(reads=[], writes=["prompt", "chat_history"])
def human_input(state: State, prompt: str) -> State:
diff --git a/examples/simple-chatbot-intro/application.py b/examples/simple-chatbot-intro/application.py
index 418524a3..7516eac2 100644
--- a/examples/simple-chatbot-intro/application.py
+++ b/examples/simple-chatbot-intro/application.py
@@ -1,6 +1,6 @@
from typing import Tuple
-import openai
+import openai # replace this with your favorite LLM client library
from burr.core import ApplicationBuilder, State, action, when
@@ -23,7 +23,7 @@ def human_input(state: State, prompt: str) -> Tuple[dict, State]:
def ai_response(state: State) -> Tuple[dict, State]:
"""Queries OpenAI with the chat. You could easily use langchain, etc... to handle this,
but we wanted to keep it simple to demonstrate"""
- client = openai.Client()
+ client = openai.Client() # replace this with your favorite LLM client library
content = (
client.chat.completions.create(
model="gpt-3.5-turbo",
diff --git a/examples/simple-chatbot-intro/notebook.ipynb b/examples/simple-chatbot-intro/notebook.ipynb
index 641ef57e..5fa24b11 100644
--- a/examples/simple-chatbot-intro/notebook.ipynb
+++ b/examples/simple-chatbot-intro/notebook.ipynb
@@ -30,7 +30,7 @@
"import uuid\n",
"from typing import Tuple\n",
"\n",
- "import openai\n",
+ "import openai # replace with your favorite LLM client library\n",
"\n",
"from burr.core import action, State, ApplicationBuilder, when, persistence"
]
@@ -79,7 +79,7 @@
"def ai_response(state: State) -> Tuple[dict, State]:\n",
" \"\"\"Queries OpenAI with the chat. You could easily use langchain, etc... to handle this,\n",
" but we wanted to keep it simple to demonstrate\"\"\"\n",
- " client = openai.Client()\n",
+ " client = openai.Client() # replace with your favorite LLM client library\n",
" content = client.chat.completions.create(\n",
" model=\"gpt-3.5-turbo\",\n",
" messages=state[\"chat_history\"],\n",