Spaces:
Runtime error
Runtime error
Update main.py
Browse files
main.py
CHANGED
@@ -57,8 +57,9 @@ async def chat(request: Request, chat_request: ChatRequest):
|
|
57 |
docs = loader.load()
|
58 |
result = chain.run(docs)
|
59 |
print("AI Summarization: " + result)
|
60 |
-
|
61 |
-
return JSONResponse({'response': result})
|
|
|
62 |
#对比FlaskAPI的:return jsonify({'response': result}),JSONResponse vs jsonify(都需要相应的from ... import ...)
|
63 |
except Exception as e:
|
64 |
err_msg = "Wrong URL or URL not parsable."
|
|
|
57 |
docs = loader.load()
|
58 |
result = chain.run(docs)
|
59 |
print("AI Summarization: " + result)
|
60 |
+
return {'response': result} #FastAPI方式下,这个返回形式,有问题?
|
61 |
+
#return JSONResponse({'response': result})
|
62 |
+
|
63 |
#对比FlaskAPI的:return jsonify({'response': result}),JSONResponse vs jsonify(都需要相应的from ... import ...)
|
64 |
except Exception as e:
|
65 |
err_msg = "Wrong URL or URL not parsable."
|