ashupanda123 commited on
Commit
3eb8aff
·
verified ·
1 Parent(s): bfbc8d4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -6,10 +6,13 @@ from langchain.schema import AIMessage, HumanMessage, SystemMessage
6
  st.set_page_config(page_title="LangChain Demo", page_icon=":robot:")
7
  st.header("Hey, I'm your Chat GPT")
8
 
9
- # Initialize session state for messages
 
 
 
10
  if "sessionMessages" not in st.session_state:
11
  st.session_state.sessionMessages = [
12
- SystemMessage(content="You are a helpful assistant.")
13
  ]
14
 
15
  # Function to load the assistant's answer
 
6
  st.set_page_config(page_title="LangChain Demo", page_icon=":robot:")
7
  st.header("Hey, I'm your Chat GPT")
8
 
9
+ # Input field for the initial system message
10
+ initial_system_message = st.text_input("Initial System Message:", value="You are a helpful assistant.")
11
+
12
+ # Initialize session state for messages if not already initialized
13
  if "sessionMessages" not in st.session_state:
14
  st.session_state.sessionMessages = [
15
+ SystemMessage(content=initial_system_message)
16
  ]
17
 
18
  # Function to load the assistant's answer