Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
st.write("
|
26 |
-
|
27 |
-
|
28 |
-
|
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 |
+
|