Update app.py
Browse files
app.py
CHANGED
@@ -156,7 +156,19 @@ def get_response(user_input):
|
|
156 |
|
157 |
return response
|
158 |
|
|
|
159 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
160 |
|
161 |
###################
|
162 |
|
|
|
156 |
|
157 |
return response
|
158 |
|
159 |
+
app = FastAPI()
|
160 |
|
161 |
+
@app.post("/generate/")
|
162 |
+
def generate(user_input):
|
163 |
+
retriever_chain = get_context_retriever_chain(st.session_state.vector_store)
|
164 |
+
conversation_rag_chain = get_conversational_rag_chain(retriever_chain)
|
165 |
+
|
166 |
+
response = conversation_rag_chain.invoke({
|
167 |
+
"chat_history": [],
|
168 |
+
"input": user_query
|
169 |
+
})
|
170 |
+
|
171 |
+
return response
|
172 |
|
173 |
###################
|
174 |
|