captain-awesome commited on
Commit
6ad6f7e
1 Parent(s): 885ec28

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -2
app.py CHANGED
@@ -23,6 +23,7 @@ with st.sidebar:
23
  website_url = st.text_input("Website URL")
24
  openai_apikey = st.text_input("Enter your OpenAI API key")
25
 
 
26
  user_query = st.chat_input("Type your message here...")
27
  if user_query is not None and user_query !="":
28
  response = get_response(user_query)
@@ -30,7 +31,17 @@ if user_query is not None and user_query !="":
30
  st.session_state.chat_history .append(AIMessageMessage(content=response))
31
 
32
 
33
-
34
-
 
 
 
 
 
 
 
 
 
 
35
 
36
 
 
23
  website_url = st.text_input("Website URL")
24
  openai_apikey = st.text_input("Enter your OpenAI API key")
25
 
26
+ #user_input
27
  user_query = st.chat_input("Type your message here...")
28
  if user_query is not None and user_query !="":
29
  response = get_response(user_query)
 
31
  st.session_state.chat_history .append(AIMessageMessage(content=response))
32
 
33
 
34
+ #conversation
35
+ for message in st.session_state.chat_history:
36
+ if isinstance(message, AIMessage): # checking if the messsage is the instance of an AI message
37
+ with st.chat_message("AI"):
38
+ st.write(message.content)
39
+ elif isinstance(message, HumanMessage): # checking if the messsage is the instance of a Human
40
+ with st.chat_message("Human"):
41
+ st.write(message.content)
42
+
43
+
44
+
45
+
46
 
47