Elbachaik commited on
Commit
7ec6fbc
·
verified ·
1 Parent(s): 181da38

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +31 -30
app.py CHANGED
@@ -1,30 +1,31 @@
1
- import streamlit as st
2
- from rag_retriever import initialize_llm, initialize_pinecone, create_query_engine, get_response
3
-
4
- # Initialize LLM and Pinecone
5
- initialize_llm()
6
- index = initialize_pinecone()
7
- query_engine = create_query_engine(index)
8
-
9
- # Create a Streamlit app
10
- st.title("KYC SUD CONSULTING Chatbot")
11
- st.markdown("### Ask me anything about our company!")
12
-
13
- # Create a text input field for the user to enter their query
14
- query = st.text_area("Your Question:", "", height=100)
15
-
16
- # Create a button to trigger the response generation
17
- if st.button("Get Answer"):
18
- # Get the response from the query engine
19
- response = get_response(query_engine, query)
20
- # Display the response
21
- st.write("### Response:")
22
- st.write(response)
23
-
24
- # Add some whitespace to make the app look more spacious
25
- st.write("\n\n")
26
-
27
- # Add a footer with some text
28
- st.markdown("### Powered by KYC SUD CONSULTING")
29
-
30
-
 
 
1
+ import streamlit as st
2
+ from rag_retriever import initialize_llm, initialize_pinecone, create_query_engine, get_response
3
+
4
+ # Initialize LLM and Pinecone
5
+ initialize_llm()
6
+ index = initialize_pinecone()
7
+ query_engine = create_query_engine(index)
8
+
9
+ # Create a Streamlit app
10
+ st.title("KYC SUD CONSULTING Chatbot")
11
+
12
+ # Create a chatbot-like interface
13
+ with st.form("chat_form"):
14
+ user_input = st.text_area("Your Question:", "", height=100, placeholder="Type your question here...")
15
+ submit_button = st.form_submit_button("Send")
16
+
17
+ # Create a container to display the conversation
18
+ conversation_container = st.container()
19
+
20
+ # Display the conversation
21
+ if submit_button:
22
+ response = get_response(query_engine, user_input)
23
+ with conversation_container:
24
+ st.write("You: " + user_input)
25
+ st.write("Bot: " + response)
26
+
27
+
28
+
29
+ st.markdown("### Powered by KYC SUD CONSULTING")
30
+
31
+