Update app.py
Browse files
app.py
CHANGED
|
@@ -172,7 +172,7 @@ def can_submit() -> bool:
|
|
| 172 |
|
| 173 |
def render_sidebar() -> None:
|
| 174 |
with st.sidebar:
|
| 175 |
-
st.markdown("# Let's talk!")
|
| 176 |
st.markdown("# **Step 1. Type in the chat box to start a conversation**")
|
| 177 |
|
| 178 |
st.success(
|
|
@@ -184,7 +184,7 @@ def render_sidebar() -> None:
|
|
| 184 |
|
| 185 |
st.markdown(
|
| 186 |
"🚫 Please avoid greetings and start the conversation with a question "
|
| 187 |
-
"or a statement about a politically polarizing topic.
|
| 188 |
"**Note: the chatbot's knowledge only goes up to late August 2025.**"
|
| 189 |
)
|
| 190 |
|
|
@@ -224,6 +224,7 @@ def get_assistant_response() -> str:
|
|
| 224 |
completion = st.session_state.client.chat.completions.create(
|
| 225 |
model=st.session_state.user_data["MODEL_PATH"],
|
| 226 |
messages=st.session_state.messages,
|
|
|
|
| 227 |
stream=False,
|
| 228 |
)
|
| 229 |
return completion.choices[0].message.content or ""
|
|
|
|
| 172 |
|
| 173 |
def render_sidebar() -> None:
|
| 174 |
with st.sidebar:
|
| 175 |
+
st.markdown("# **Let's talk!**")
|
| 176 |
st.markdown("# **Step 1. Type in the chat box to start a conversation**")
|
| 177 |
|
| 178 |
st.success(
|
|
|
|
| 184 |
|
| 185 |
st.markdown(
|
| 186 |
"🚫 Please avoid greetings and start the conversation with a question "
|
| 187 |
+
"or a statement about a politically polarizing topic.\n"
|
| 188 |
"**Note: the chatbot's knowledge only goes up to late August 2025.**"
|
| 189 |
)
|
| 190 |
|
|
|
|
| 224 |
completion = st.session_state.client.chat.completions.create(
|
| 225 |
model=st.session_state.user_data["MODEL_PATH"],
|
| 226 |
messages=st.session_state.messages,
|
| 227 |
+
max_tokens=512,
|
| 228 |
stream=False,
|
| 229 |
)
|
| 230 |
return completion.choices[0].message.content or ""
|