Spaces:
Sleeping
Sleeping
update main.py
Browse files
main.py
CHANGED
@@ -143,18 +143,18 @@ qa = ConvoRetrievalChain.from_llm(
|
|
143 |
class Question(BaseModel):
|
144 |
question: str
|
145 |
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
|
152 |
|
153 |
-
@app.get("/")
|
154 |
|
155 |
-
def chat_with(str1):
|
156 |
-
|
157 |
-
|
158 |
|
159 |
|
160 |
|
|
|
143 |
class Question(BaseModel):
|
144 |
question: str
|
145 |
|
146 |
+
@app.get("/chat/")
|
147 |
+
def chat_with(str1: str):
|
148 |
+
resp = qa({"question": str1})
|
149 |
+
answer = resp.get('answer', '')
|
150 |
+
return {'message': answer}
|
151 |
|
152 |
|
153 |
+
# @app.get("/")
|
154 |
|
155 |
+
# def chat_with(str1):
|
156 |
+
# resp = qa({"question": str1})
|
157 |
+
# return {'message':resp}
|
158 |
|
159 |
|
160 |
|