Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -86,14 +86,14 @@ async def addText(vectorstorename: str, text: str):
|
|
| 86 |
|
| 87 |
|
| 88 |
@app.get("/answerQuery")
|
| 89 |
-
async def answerQuestion(query: str,
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
return output
|
|
|
|
| 86 |
|
| 87 |
|
| 88 |
@app.get("/answerQuery")
|
| 89 |
+
async def answerQuestion(query: str, vectorstore: str, llmModel: str = "llama3-70b-8192"):
|
| 90 |
+
try:
|
| 91 |
+
response = answerQuery(query=query, vectorstore=vectorstore, llmModel=llmModel)
|
| 92 |
+
output = {
|
| 93 |
+
"output": response
|
| 94 |
+
}
|
| 95 |
+
except Exception as e:
|
| 96 |
+
output = {
|
| 97 |
+
"error": e
|
| 98 |
+
}
|
| 99 |
return output
|