Skip to content

Commit 8842864

Browse files
committed
feat: Add start page configuration with welcome messages in English and German
1 parent c3d7f18 commit 8842864

File tree

4 files changed

+23
-19
lines changed

4 files changed

+23
-19
lines changed

config_example.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,10 @@ milvus_settings:
4444

4545
# Optional. If set up, implement e.g., cron job to run /app/src/chatbot_log/log_cleanup.py
4646
log_settings:
47-
delete_logs_days: 90 # Number of days to keep logs before deletion
47+
delete_logs_days: 90 # Number of days to keep logs before deletion
48+
49+
start_page:
50+
welcome_message_english: "Welcome to our chatbot! How can I assist you today?"
51+
welcome_message_german: "Willkommen bei unserem Chatbot! Wie kann ich Ihnen heute helfen?"
52+
53+

src/config/core_config.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
MilvusSettings,
1818
ModelConfig,
1919
SearchConfig,
20+
StartPageConfig,
2021
)
2122

2223

@@ -37,6 +38,7 @@ class Settings(BaseSettings):
3738
embedding: EmbeddingSettings
3839
milvus_settings: MilvusSettings
3940
language: Literal["Deutsch", "English"]
41+
start_page: StartPageConfig
4042
legal: Optional[Legal] = (
4143
None # Optional legal information (e.g., data protection, imprint)
4244
)

src/config/models.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,12 @@ class MilvusSettings(BaseModel):
7676
host: Optional[str] = None
7777
port: int = 19530
7878
token: Optional[str] = "root:Milvus"
79+
80+
81+
class StartPageConfig(BaseModel):
82+
"""
83+
Configuration for the start page.
84+
"""
85+
86+
welcome_message_english: str
87+
welcome_message_german: str

start.py

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -21,27 +21,14 @@ def initialize_app():
2121

2222

2323
def display_welcome_message():
24-
start_message = """
25-
## Welcome to ask.UOS!
26-
### ask.UOS is a chatbot powered by OpenAI's GPT-4.
27-
### With this first **experimental** release, we are excited to assist with general questions about applying to the University!
2824

29-
We take precautions to ensure a low rate of inaccurate answers. However, for your safety and to ensure the reliability of any information you receive, we recommend using human oversight in your decision-making processes, as this helps confirm that the information is safe, accurate, and appropriate for your needs.
30-
If you're ever unsure about an answer, please check the provided sources. You can also refer directly to the [university's website]({}).
25+
if st.session_state["chosen_language"] == "Deutsch":
26+
start_message = settings.start_page.welcome_message_german
27+
else:
28+
start_message = settings.start_page.welcome_message_english
3129

32-
If you need personal assistance regarding studying at the university, you can visit the [StudiOS]({}) (Studierenden-Information Osnabrück) or [ZSB]({}) (Zentrale Studienberatung Osnabrück) website.
33-
34-
Please note that the University of Osnabrück cannot be held liable for any actions, losses, or damages that may arise from the use of the chatbot.
35-
36-
While interacting with the Chatbot, avoid sharing personal information. If you're interested, please follow the links to find more information about our [data protection policies]({}) and [imprint]({}).
37-
"""
38-
39-
translated_start_message = session_state["_"](start_message)
4030
st.markdown(
41-
translated_start_message.format(
42-
"https://www.uni-osnabrueck.de/startseite/",
43-
"https://www.uni-osnabrueck.de/universitaet/organisation/studierenden-information-osnabrueck-studios/",
44-
"https://www.zsb-os.de/",
31+
start_message.format(
4532
settings.legal.data_protection,
4633
settings.legal.imprint,
4734
)

0 commit comments

Comments
 (0)