Skip to content

Commit e4f9e64

Browse files
Show chat model in assistant's reply, not user's
1 parent 138814d commit e4f9e64

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

pyrobbot/app/app_page_templates.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,10 @@ def render_chat_history(self):
259259
continue
260260
with st.chat_message(role, avatar=self.avatars.get(role)):
261261
with contextlib.suppress(KeyError):
262-
st.caption(f"{message['chat_model']}, {message['timestamp']}")
262+
if role == "assistant":
263+
st.caption(message["chat_model"])
264+
else:
265+
st.caption(message["timestamp"])
263266
st.markdown(message["content"])
264267
with contextlib.suppress(KeyError):
265268
if audio := message.get("reply_audio_file_path"):
@@ -403,7 +406,6 @@ def _render_chatbot_page(self): # noqa: PLR0915
403406
"name": self.chat_obj.username,
404407
"content": prompt,
405408
"timestamp": time_now,
406-
"chat_model": self.chat_obj.model,
407409
}
408410
)
409411

@@ -418,6 +420,7 @@ def _render_chatbot_page(self): # noqa: PLR0915
418420
"name": self.chat_obj.assistant_name,
419421
"content": reply["text"],
420422
"reply_audio_file_path": reply["audio"],
423+
"chat_model": self.chat_obj.model,
421424
}
422425
)
423426

0 commit comments

Comments
 (0)