Update app.py
Browse files
app.py
CHANGED
@@ -82,6 +82,14 @@ def main():
|
|
82 |
|
83 |
user_question = st.text_input("Ask a question about your documents:")
|
84 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
85 |
if "messages" not in st.session_state:
|
86 |
st.session_state["messages"] = [
|
87 |
{"role": "assistant", "content": "Hi, I'm a chatbot who is based on lithuanian law documents. How can I help you?"}
|
@@ -89,11 +97,6 @@ def main():
|
|
89 |
|
90 |
for msg in st.session_state.messages:
|
91 |
st.chat_message(msg["role"]).write(msg["content"])
|
92 |
-
|
93 |
-
retriever = create_retriever_from_chroma(vectorstore_path="docs/chroma/", search_type='mmr', k=7, chunk_size=250, chunk_overlap=20)
|
94 |
-
|
95 |
-
if user_question:
|
96 |
-
handle_userinput(user_question,retriever)
|
97 |
|
98 |
|
99 |
def handle_userinput(user_question,retriever):
|
|
|
82 |
|
83 |
user_question = st.text_input("Ask a question about your documents:")
|
84 |
|
85 |
+
|
86 |
+
|
87 |
+
retriever = create_retriever_from_chroma(vectorstore_path="docs/chroma/", search_type='mmr', k=7, chunk_size=250, chunk_overlap=20)
|
88 |
+
|
89 |
+
if user_question:
|
90 |
+
handle_userinput(user_question,retriever)
|
91 |
+
|
92 |
+
|
93 |
if "messages" not in st.session_state:
|
94 |
st.session_state["messages"] = [
|
95 |
{"role": "assistant", "content": "Hi, I'm a chatbot who is based on lithuanian law documents. How can I help you?"}
|
|
|
97 |
|
98 |
for msg in st.session_state.messages:
|
99 |
st.chat_message(msg["role"]).write(msg["content"])
|
|
|
|
|
|
|
|
|
|
|
100 |
|
101 |
|
102 |
def handle_userinput(user_question,retriever):
|