Skip to content

Commit

Permalink
Updates in-codebase links to work with new examples structure
Browse files Browse the repository at this point in the history
  • Loading branch information
elijahbenizzy committed Mar 30, 2024
1 parent faadfec commit e7dd8d2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ environment variable to be set, but you can still see how it works if you don't
Next, start coding / running examples:

```bash
git clone https://github.com/dagworks-inc/burr && cd burr/examples/counter
git clone https://github.com/dagworks-inc/burr && cd burr/examples/hello-world-counter
python application.py
```
You'll see the counter example running in the terminal, along with the trace being tracked in the UI.
Expand Down
10 changes: 7 additions & 3 deletions burr/tracking/server/examples/chatbot.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
import functools
import importlib
from typing import List, Literal

import pydantic
from fastapi import FastAPI
from starlette.requests import Request

from burr.core import Application
from burr.examples.gpt import application as chat_application

chat_application = importlib.import_module(
"burr.examples.multi-modal-chatbot.application"
) # noqa: F401


class ChatItem(pydantic.BaseModel):
Expand All @@ -17,7 +21,7 @@ class ChatItem(pydantic.BaseModel):

@functools.lru_cache(maxsize=128)
def _get_application(project_id: str, app_id: str) -> Application:
app = chat_application.application(use_hamilton=False, app_id=app_id, project_id=project_id)
app = chat_application.application(app_id=app_id, project_id=project_id)
return app


Expand Down Expand Up @@ -45,7 +49,7 @@ async def create_new_application(request: Request, project_id: str, app_id: str)
In a better chatbot you'd want to either have the frontend store this and create on demand or return
the actual application model"""
# side-effect creates the logging so it exists
chat_application.application(use_hamilton=False, app_id=app_id, project_id=project_id)
chat_application.application(app_id=app_id, project_id=project_id)
return app_id # just return it for now


Expand Down

0 comments on commit e7dd8d2

Please sign in to comment.