Skip to content

Commit

Permalink
A little animation in initial greeting
Browse files Browse the repository at this point in the history
  • Loading branch information
paulovcmedeiros committed Nov 8, 2023
1 parent 6245e90 commit 89ad445
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion gpt_buddy_bot/app/app_page_templates.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Utilities for creating pages in a streamlit app."""
import pickle
import sys
import time
import uuid
from abc import ABC, abstractmethod

Expand Down Expand Up @@ -143,7 +144,15 @@ def render(self):
self.render_chat_history()
else:
with st.chat_message("assistant", avatar=self.avatars["assistant"]):
st.markdown(self.chat_obj.initial_greeting)
with st.empty():
st.markdown("▌")
greeting = ""
for word in self.chat_obj.initial_greeting.split():
greeting += f"{word} "
st.markdown(greeting + "▌")
time.sleep(0.1)
st.markdown(greeting)

self.chat_history.append(
{
"role": "assistant",
Expand Down

0 comments on commit 89ad445

Please sign in to comment.