Skip to content

Commit 3271e99

Browse files
authored
feat(ui): client routing (#754)
1 parent 1bf925c commit 3271e99

38 files changed

+621
-301
lines changed

package-lock.json

Lines changed: 38 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/ragbits-chat/CHANGELOG.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@
66
- Add persistent user settings (#719)
77
- Send chat options under `user_settings` key (#721)
88
- Add feedback indicator to messages, allow `extensions` in chat messages (#722)
9-
- Added unit tests for UI's core components (#717)
10-
- Added share functionality with informative modal (#726)
11-
- Added persisent chat history to the default UI using IndexedDB (#732)
12-
- Redesigned history UI, allowed enabling of client side history using config (#744)
9+
- Add unit tests for UI's core components (#717)
10+
- Add share functionality with informative modal (#726)
11+
- Add persisent chat history to the default UI using IndexedDB (#732)
12+
- Redesign history UI, allowed enabling of client side history using config (#744)
1313
- Allow parallel conversations in the UI (#749)
14-
- Added missing typography plugin for TailwindCSS (#750)
14+
- Add missing typography plugin for TailwindCSS (#750)
15+
- Add client routing with ability for plugins to define custom routes (#754)
1516

1617
## 1.1.0 (2025-07-09)
1718

packages/ragbits-chat/src/ragbits/chat/api.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,12 +116,6 @@ async def validation_exception_handler(request: Request, exc: RequestValidationE
116116
def setup_routes(self) -> None:
117117
"""Defines API routes."""
118118

119-
@self.app.get("/", response_class=HTMLResponse)
120-
async def root() -> HTMLResponse:
121-
index_file = self.dist_dir / "index.html"
122-
with open(str(index_file)) as file:
123-
return HTMLResponse(content=file.read())
124-
125119
@self.app.post("/api/chat", response_class=StreamingResponse)
126120
async def chat_message(request: ChatMessageRequest) -> StreamingResponse:
127121
return await self._handle_chat_message(request)
@@ -157,6 +151,12 @@ async def config() -> JSONResponse:
157151

158152
return JSONResponse(content=config_dict)
159153

154+
@self.app.get("/{full_path:path}", response_class=HTMLResponse)
155+
async def root() -> HTMLResponse:
156+
index_file = self.dist_dir / "index.html"
157+
with open(str(index_file)) as file:
158+
return HTMLResponse(content=file.read())
159+
160160
async def _handle_chat_message(self, request: ChatMessageRequest) -> StreamingResponse: # noqa: PLR0915
161161
"""Handle chat message requests with metrics tracking."""
162162
start_time = time.time()

packages/ragbits-chat/src/ragbits/chat/ui-build/assets/ChatHistory-BLTizy3O.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

packages/ragbits-chat/src/ragbits/chat/ui-build/assets/ChatHistory-NXX7RG8Q.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/ragbits-chat/src/ragbits/chat/ui-build/assets/ChatOptionsForm-C8LwDjQM.js renamed to packages/ragbits-chat/src/ragbits/chat/ui-build/assets/ChatOptionsForm-DDr1JqBA.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/ragbits-chat/src/ragbits/chat/ui-build/assets/FeedbackForm-B_MfDPWV.js renamed to packages/ragbits-chat/src/ragbits/chat/ui-build/assets/FeedbackForm-C9qDJNN_.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)