DrishtiSharma commited on
Commit
ae384c7
1 Parent(s): 1329590

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +25 -0
app.py ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ from langchain.chains import ConversationChain
3
+ from langchain.chains.conversation.memory import ConversationEntityMemory
4
+ from langchain.chains.conversation.prompt import ENTITY_MEMORY_CONVERSATION_TEMPLATE
5
+ from langchain.llms import OpenAI
6
+
7
+
8
+ if "generated" not in st.session_state:
9
+ st.session_state["generated"] = []
10
+
11
+ if "past" not in st.session_state:
12
+ st.session_state["past"] = []
13
+
14
+ if "input" not in st.session_state:
15
+ st.session_state["input"] = ""
16
+
17
+ if "stored_session" not in st.session_state:
18
+ st.session_state["stored_session"] = []
19
+
20
+
21
+ def get_text():
22
+ input_text = st.text_input("You: ", st.session_state["input"], key = "input", placeholder = "Your AI Assistant here.. Ask me anything!", label_visibility = "hidden" )
23
+ return input_text
24
+
25
+ st.title("Memory Bot")