Skip to content

Commit dec6efc

Browse files
authored
feat(ui): page title & favicon customization (#767)
1 parent 0899bcf commit dec6efc

File tree

24 files changed

+191
-88
lines changed

24 files changed

+191
-88
lines changed

examples/chat/chat.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
from ragbits.chat.interface import ChatInterface
3030
from ragbits.chat.interface.forms import FeedbackConfig, UserSettings
3131
from ragbits.chat.interface.types import ChatContext, ChatResponse, LiveUpdateType, Message
32-
from ragbits.chat.interface.ui_customization import HeaderCustomization, UICustomization
32+
from ragbits.chat.interface.ui_customization import HeaderCustomization, PageMetaCustomization, UICustomization
3333
from ragbits.core.llms import LiteLLM
3434

3535

@@ -84,6 +84,7 @@ class MyChat(ChatInterface):
8484
"You can ask me **anything**! "
8585
"I can provide information, answer questions, and assist you with various tasks."
8686
),
87+
meta=PageMetaCustomization(favicon="🔨", page_title="Change me!"),
8788
)
8889

8990
conversation_history = True

packages/ragbits-chat/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## Unreleased
44

55
- Autogenerate typescript types based on backend typing (#727)
6+
- Add ability to customize favicon and page title (#766)
67

78
## 1.2.1 (2025-08-04)
89

packages/ragbits-chat/src/ragbits/chat/interface/ui_customization.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,29 @@ class HeaderCustomization(BaseModel):
1919
"""Custom logo URL or content. The logo can also be served from 'static' directory inside 'ui-buid"""
2020

2121

22+
class PageMetaCustomization(BaseModel):
23+
"""
24+
Customization for the meta properites of the UI
25+
"""
26+
27+
favicon: str | None = Field(
28+
default=None,
29+
description=(
30+
"Custom favicon URL or content. If `None` logo is used."
31+
"The favicon can also be serverd from 'static' directory inside 'ui-build'"
32+
),
33+
)
34+
(
35+
"Custom favicon URL or content. If `None` logo is used."
36+
"The favicon can also be serverd from 'static' directory inside 'ui-build'"
37+
)
38+
page_title: str | None = Field(
39+
default=None,
40+
description="Custom title for the page displayed in the browser's bar. If `None` header title is used.",
41+
)
42+
"Custom title for the page displayed in the browser's bar. If `None` header title is used."
43+
44+
2245
class UICustomization(BaseModel):
2346
"""
2447
Customization for the UI.
@@ -30,3 +53,4 @@ class UICustomization(BaseModel):
3053
default=None, description="Custom welcome message to be displayed on the UI. It supports Markdown."
3154
)
3255
"""Custom welcome message to be displayed on the UI. It supports Markdown."""
56+
meta: PageMetaCustomization | None = Field(default=None, description="Custom meta properties customization")

packages/ragbits-chat/src/ragbits/chat/providers/model_provider.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,11 @@ def get_models(self) -> dict[str, type[BaseModel | Enum]]:
5757
Reference,
5858
StateUpdate,
5959
)
60-
from ragbits.chat.interface.ui_customization import HeaderCustomization, UICustomization
60+
from ragbits.chat.interface.ui_customization import (
61+
HeaderCustomization,
62+
PageMetaCustomization,
63+
UICustomization,
64+
)
6165

6266
self._models_cache = {
6367
# Enums
@@ -77,6 +81,7 @@ def get_models(self) -> dict[str, type[BaseModel | Enum]]:
7781
# Configuration models
7882
"HeaderCustomization": HeaderCustomization,
7983
"UICustomization": UICustomization,
84+
"PageMetaCustomization": PageMetaCustomization,
8085
"UserSettings": UserSettings,
8186
"FeedbackConfig": FeedbackConfig, # Current from types.py (not deprecated forms.py)
8287
# API response models

packages/ragbits-chat/src/ragbits/chat/ui-build/assets/ChatHistory-D-AE0LcG.js renamed to packages/ragbits-chat/src/ragbits/chat/ui-build/assets/ChatHistory-DuDSKeVe.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/ChatOptionsForm-D2-2zwqJ.js renamed to packages/ragbits-chat/src/ragbits/chat/ui-build/assets/ChatOptionsForm-p4X4E2d0.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-DFwtFn3g.js renamed to packages/ragbits-chat/src/ragbits/chat/ui-build/assets/FeedbackForm-DBhQTE7c.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)