Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chat UI Update #58

Merged
merged 5 commits into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 20 additions & 6 deletions app.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
import streamlit as st
from dotenv import find_dotenv, load_dotenv
from streamlit_theme import st_theme

from llm.prompts import INTRODUCTION_MESSAGE
from utils import (
AUTHORS,
LOGO_TEXT_DARK_URL,
LOGO_TEXT_LIGHT_URL,
LOGO_URL,
QUERY_SUGGESTIONS,
WARNING_MESSAGE,
generate_response,
initialize_clients,
load_config,
WARNING_MESSAGE,
QUERY_SUGGESTIONS,
AUTHORS,
LOGO_URL,
LOGO_TEXT_URL,
)

# Load environment variables from the .env file.
Expand All @@ -26,8 +28,20 @@
qdrant_client = initialize_clients()
config = load_config()

# Determine the theme and set the appropriate logo
theme = st_theme()["base"]
print(f"orginal theme: {theme}")
if theme == "dark":
logo_url = LOGO_TEXT_DARK_URL
print(theme)
print("changed logo: ", logo_url)
else:
logo_url = LOGO_TEXT_LIGHT_URL
print(theme)
print("changed logo: ", logo_url)

# Display the logo and set up the sidebar with useful information and links.
st.logo(LOGO_TEXT_URL, icon_image=LOGO_URL)
st.logo(logo_url, icon_image=LOGO_URL)
with st.sidebar:
st.subheader("💡 Query Suggestions")
with st.container(border=True, height=200):
Expand Down
18 changes: 18 additions & 0 deletions assets/Legabot-Dark-Horizontal.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 15 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ pyyaml = "^6.0.1"
streamlit = "^1.32.2"
backoff = "^2.2.1"
langfuse = "^2.27.2"
st-theme = "^1.2.3"


[build-system]
Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ loguru==0.7.2
pyyaml==6.0.1
streamlit==1.35.0
backoff==2.2.1
langfuse==2.27.2
langfuse==2.27.2
st-theme ==1.2.3
7 changes: 4 additions & 3 deletions utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
from router.router_prompt import DEFAULT_ROUTER_RESPONSE

LOGO_URL = "assets/Legabot-Logomark.svg"
LOGO_TEXT_URL = "assets/Legabot-Light-Horizontal.svg"
LOGO_TEXT_LIGHT_URL = "assets/Legabot-Light-Horizontal.svg"
LOGO_TEXT_DARK_URL = "assets/Legabot-Dark-Horizontal.svg"
TEXT_URL = "assets/Legabot-Dark-Typography.svg"

WARNING_MESSAGE = """
Expand All @@ -35,8 +36,8 @@
"""

AUTHORS = """
**Attorney:** [Anja Berić](https://www.linkedin.com/in/anja-beric-150285vb/?originalSubdomain=rs)\n
**Research Engineer:** [Milutin Studen](https://www.linkedin.com/in/milutin-studen/)
[Anja Berić](https://www.linkedin.com/in/anja-beric-150285vb/?originalSubdomain=rs)\n
[Milutin Studen](https://www.linkedin.com/in/milutin-studen/)
"""


Expand Down