Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 |
-
#
|
|
|
|
|
|
|
|
|
|
| 10 |
if "sessionMessages" not in st.session_state:
|
| 11 |
st.session_state.sessionMessages = [
|
| 12 |
-
SystemMessage(content=
|
| 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
|