Skip to content

Commit

Permalink
Show chat model in assistant's reply, not user's
Browse files Browse the repository at this point in the history
  • Loading branch information
paulovcmedeiros committed Mar 8, 2024
1 parent 138814d commit e4f9e64
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pyrobbot/app/app_page_templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,10 @@ def render_chat_history(self):
continue
with st.chat_message(role, avatar=self.avatars.get(role)):
with contextlib.suppress(KeyError):
st.caption(f"{message['chat_model']}, {message['timestamp']}")
if role == "assistant":
st.caption(message["chat_model"])
else:
st.caption(message["timestamp"])
st.markdown(message["content"])
with contextlib.suppress(KeyError):
if audio := message.get("reply_audio_file_path"):
Expand Down Expand Up @@ -403,7 +406,6 @@ def _render_chatbot_page(self): # noqa: PLR0915
"name": self.chat_obj.username,
"content": prompt,
"timestamp": time_now,
"chat_model": self.chat_obj.model,
}
)

Expand All @@ -418,6 +420,7 @@ def _render_chatbot_page(self): # noqa: PLR0915
"name": self.chat_obj.assistant_name,
"content": reply["text"],
"reply_audio_file_path": reply["audio"],
"chat_model": self.chat_obj.model,
}
)

Expand Down

0 comments on commit e4f9e64

Please sign in to comment.