Skip to content

Commit 5be9491

Browse files
authored
Ka-chatbot updates (#451)
- update readme - remove some unused images - address sec feedback. remove CORS allowlist for localhost.
1 parent 83e4f5b commit 5be9491

File tree

5 files changed

+35
-42
lines changed

5 files changed

+35
-42
lines changed

ka-chat-bot/README.md

Lines changed: 35 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -5,70 +5,74 @@ author: "Taiga Matsumoto"
55
date: 2025-05-26
66
---
77

8-
# Databricks Chatbot Application
8+
# Databricks Knowledge Assistant Chatbot Application
99

10-
Chat applications powered by Databricks' model serving endpoints. This project provides a foundation for creating interactive chat interfaces that leverage Databricks' powerful AI framework and model serving infrastructure.
10+
Chat applications powered by your Databricks Knowledge Assistant
1111

1212
## Features
1313

1414
- 🚀 Real-time chat interface
1515
- 💾 Chat history persistence
1616
- 🔄 Message regeneration capability
1717
- ⚡ Streaming responses
18-
- 🔒 Secure authentication
18+
- 🔒 On-behalf-of-user authentication
1919
- 🎯 Rate limiting and error handling
2020

2121
## Architecture
2222

2323
The application is built with:
2424
- FastAPI for the backend API
2525
- SQLite for chat history storage
26-
- Async/await patterns for efficient request handling
27-
- Dependency injection for clean code organization
26+
- React frontend
27+
2828

2929
## Getting Started
3030

3131
1. Clone the repository
32-
2. Install dependencies:
33-
```bash
34-
pip install -r requirements.txt
35-
```
36-
37-
3. Building the Frontend
32+
2. Create an .env file with the following:
33+
- `LOCAL_API_TOKEN`: your PAT used only for local development
34+
- `DATABRICKS_HOST`: your Databricks domain url (e.g. "[email protected]")
35+
- `SERVING_ENDPOINT_NAME`: your Knowledge Assistant's serving endpoint (e.g "ka-123-endpoint")
3836

39-
[1]. Navigate to the frontend directory:
37+
3. Install dependencies:
38+
```bash
39+
pip install -r requirements.txt
40+
```
4041

41-
```bash
42-
cd frontend
43-
```
42+
4. Build the frontend
4443

45-
[2]. Install dependencies:
44+
[1]. Navigate to the frontend directory:
4645

47-
```bash
48-
npm install
49-
```
46+
```bash
47+
cd frontend
48+
```
5049

51-
[3]. Build the production version:
50+
[2]. Install dependencies:
5251

53-
```bash
54-
npm run build
55-
```
52+
```bash
53+
npm install
54+
```
55+
[3a]. Generate a local build:
5656

57-
4. Run the application:
58-
```bash
59-
python main.py
60-
```
57+
```bash
58+
npm run build
59+
```
6160

62-
## Example Interface
61+
[3b]. Generate a production build for app deployment:
6362

64-
Here's how the chat interface looks like
63+
```bash
64+
npm run build:prod
65+
```
6566

66-
![Databricks Chat Interface](./utils/Databricks_chatbot_app.png)
67+
5. Run the server:
68+
```bash
69+
python main.py
70+
```
6771

6872
## Key Components
6973

74+
- `fronted/`: React frontend
7075
- `main.py`: FastAPI application entry point
7176
- `utils/`: Helper functions and utilities
7277
- `models.py`: Data models and schemas
7378
- `chat_database.py`: Database interactions
74-
- `token_minter.py`: Authentication handling

ka-chat-bot/frontend/src/assets/images/thumbs_down_icon.svg

Lines changed: 0 additions & 5 deletions
This file was deleted.

ka-chat-bot/frontend/src/assets/images/thumbs_up_icon.svg

Lines changed: 0 additions & 5 deletions
This file was deleted.

ka-chat-bot/main.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ async def get_response(self, path, scope):
6666
app.mount("/", ui_app)
6767
app.add_middleware(
6868
CORSMiddleware,
69-
allow_origins=["http://localhost:3000"],
7069
allow_credentials=True,
7170
allow_methods=["*"],
7271
allow_headers=["*"],
-462 KB
Binary file not shown.

0 commit comments

Comments
 (0)