Update app.py
Browse files
app.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
# https://docs.streamlit.io/knowledge-base/tutorials/build-conversational-apps#build-a-chatgpt-like-app
|
| 2 |
|
| 3 |
import streamlit as st
|
| 4 |
-
|
| 5 |
|
| 6 |
from langchain.document_loaders import CSVLoader
|
| 7 |
from langchain_openai import OpenAIEmbeddings
|
|
@@ -97,9 +97,9 @@ if persist_directory :
|
|
| 97 |
# https://docs.streamlit.io/library/api-reference/chat/st.chat_message
|
| 98 |
# https://discuss.streamlit.io/t/streamlit-chat-avatars-not-working-on-cloud/46713/2
|
| 99 |
# thumbs, adventurer, big-smile, micah, bottts
|
| 100 |
-
|
| 101 |
# message(st.session_state["ai_history"][i], key=str(i), avatar_style="KaggleX.jpg")
|
| 102 |
-
|
| 103 |
-
st.chat_message(st.session_state["user_history"][i], is_user=True, key=str(i) + '_user', AvatarStyle="adventurer")
|
| 104 |
-
st.chat_message(st.session_state["ai_history"][i], key=str(i), AvatarStyle='bottts')
|
| 105 |
|
|
|
|
| 1 |
# https://docs.streamlit.io/knowledge-base/tutorials/build-conversational-apps#build-a-chatgpt-like-app
|
| 2 |
|
| 3 |
import streamlit as st
|
| 4 |
+
from streamlit_chat import message
|
| 5 |
|
| 6 |
from langchain.document_loaders import CSVLoader
|
| 7 |
from langchain_openai import OpenAIEmbeddings
|
|
|
|
| 97 |
# https://docs.streamlit.io/library/api-reference/chat/st.chat_message
|
| 98 |
# https://discuss.streamlit.io/t/streamlit-chat-avatars-not-working-on-cloud/46713/2
|
| 99 |
# thumbs, adventurer, big-smile, micah, bottts
|
| 100 |
+
message(st.session_state["user_history"][i], is_user=True, key=str(i) + '_user', avatar_style="adventurer")
|
| 101 |
# message(st.session_state["ai_history"][i], key=str(i), avatar_style="KaggleX.jpg")
|
| 102 |
+
message(st.session_state["ai_history"][i], key=str(i), avatar_style='bottts')
|
| 103 |
+
#st.chat_message(st.session_state["user_history"][i], is_user=True, key=str(i) + '_user', AvatarStyle="adventurer")
|
| 104 |
+
#st.chat_message(st.session_state["ai_history"][i], key=str(i), AvatarStyle='bottts')
|
| 105 |
|