Skip to content

Commit

Permalink
[feature] Add env var to show/hide Chat History Button
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian Seabock (Centific Technologies Inc) committed Jul 10, 2024
1 parent 6bc2752 commit ba8ac94
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ The interface allows for easy adaptation of the UI by modifying certain elements
- `UI_CHAT_DESCRIPTION`
- `UI_FAVICON`
- `UI_SHOW_SHARE_BUTTON`
- `UI_SHOW_CHAT_HISTORY_BUTTON`

Feel free to fork this repository and make your own modifications to the UX or backend logic. You can modify the source (`frontend/src`). For example, you may want to change aspects of the chat display, or expose some of the settings in `app.py` in the UI for users to try out different behaviors. After your code changes, you will need to rebuild the front-end via `start.sh` or `start.cmd`.

Expand Down Expand Up @@ -254,6 +255,7 @@ Note: settings starting with `AZURE_SEARCH` are only needed when using Azure Ope
|UI_CHAT_DESCRIPTION|This chatbot is configured to answer your questions| Description (chat window)
|UI_FAVICON|| Defaults to Contoso favicon. Configure the URL to your favicon to modify.
|UI_SHOW_SHARE_BUTTON|True|Share button (right-top)
|UI_SHOW_CHAT_HISTORY_BUTTON|True|Show chat history button (right-top)
|SANITIZE_ANSWER|False|Whether to sanitize the answer from Azure OpenAI. Set to True to remove any HTML tags from the response.|
|USE_PROMPTFLOW|False|Use existing Promptflow deployed endpoint. If set to `True` then both `PROMPTFLOW_ENDPOINT` and `PROMPTFLOW_API_KEY` also need to be set.|
|PROMPTFLOW_ENDPOINT||URL of the deployed Promptflow endpoint e.g. https://pf-deployment-name.region.inference.ml.azure.com/score|
Expand Down
1 change: 1 addition & 0 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ async def assets(path):
"chat_title": app_settings.ui.chat_title,
"chat_description": app_settings.ui.chat_description,
"show_share_button": app_settings.ui.show_share_button,
"show_chat_history_button": app_settings.ui.show_chat_history_button,
},
"sanitize_answer": app_settings.base_settings.sanitize_answer,
}
Expand Down
1 change: 1 addition & 0 deletions frontend/src/api/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ export type UI = {
logo?: string
chat_logo?: string
show_share_button?: boolean
show_chat_history_button?: boolean
}

export type FrontendSettings = {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/layout/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const Layout = () => {
}
}, [copyClicked])

useEffect(() => {}, [appStateContext?.state.isCosmosDBAvailable.status])
useEffect(() => { }, [appStateContext?.state.isCosmosDBAvailable.status])

useEffect(() => {
const handleResize = () => {
Expand Down
2 changes: 1 addition & 1 deletion static/assets/index-2e11eaf6.js.map

Large diffs are not rendered by default.

0 comments on commit ba8ac94

Please sign in to comment.