subhannadeem1 commited on
Commit
ebff71f
·
1 Parent(s): a02bef5

Update page1.py

Browse files
Files changed (1) hide show
  1. page1.py +6 -3
page1.py CHANGED
@@ -7,7 +7,10 @@ from langchain.memory import ConversationBufferMemory
7
  from langchain.memory.chat_message_histories import StreamlitChatMessageHistory
8
  from streamlit_chat import message
9
  import time
10
- import random
 
 
 
11
  def text():
12
  st.markdown("""
13
  <style>
@@ -43,7 +46,7 @@ def text():
43
 
44
  with st.chat_message("assistant").markdown(animated_output,unsafe_allow_html=True ):
45
  st.markdown(animated_output,unsafe_allow_html=True)
46
- apiKey = "AIzaSyAXkkcrrUBjPEgj93tZ9azy7zcS1wI1jUA"
47
  msgs = StreamlitChatMessageHistory(key="special_app_key")
48
 
49
  memory = ConversationBufferMemory(memory_key="history", chat_memory=msgs)
@@ -186,4 +189,4 @@ def text():
186
  # message_placeholder.markdown(full_response + "▌")
187
  # message_placeholder.markdown(full_response)
188
  # Add assistant response to chat history
189
- # st.session_state.messages.append({"role": "assistant", "content": full_response})
 
7
  from langchain.memory.chat_message_histories import StreamlitChatMessageHistory
8
  from streamlit_chat import message
9
  import time
10
+ import random
11
+ import os
12
+ api = os.environ.get("api_key")
13
+
14
  def text():
15
  st.markdown("""
16
  <style>
 
46
 
47
  with st.chat_message("assistant").markdown(animated_output,unsafe_allow_html=True ):
48
  st.markdown(animated_output,unsafe_allow_html=True)
49
+ apiKey = api
50
  msgs = StreamlitChatMessageHistory(key="special_app_key")
51
 
52
  memory = ConversationBufferMemory(memory_key="history", chat_memory=msgs)
 
189
  # message_placeholder.markdown(full_response + "▌")
190
  # message_placeholder.markdown(full_response)
191
  # Add assistant response to chat history
192
+ # st.session_state.messages.append({"role": "assistant", "content": full_response})