Spaces:
Runtime error
Runtime error
Update main.py
Browse files
main.py
CHANGED
@@ -56,10 +56,10 @@ async def chat(chat_request: ChatRequest):
|
|
56 |
print(target_url)
|
57 |
docs = loader.load()
|
58 |
#result = chain.run(docs)
|
59 |
-
result="Hi FastAPI"
|
60 |
print("AI Summarization: " + result)
|
61 |
-
return {'response': result} #FastAPI方式下,这个返回形式,有问题?
|
62 |
-
|
63 |
|
64 |
#对比FlaskAPI的:return jsonify({'response': result}),JSONResponse vs jsonify(都需要相应的from ... import ...)
|
65 |
except Exception as e:
|
|
|
56 |
print(target_url)
|
57 |
docs = loader.load()
|
58 |
#result = chain.run(docs)
|
59 |
+
result="Hi FastAPI" #用这个调试OK
|
60 |
print("AI Summarization: " + result)
|
61 |
+
#return {'response': result} #FastAPI方式下,这个返回形式,有问题? - NO!不是的!可以工作!
|
62 |
+
return JSONResponse({'response': result})
|
63 |
|
64 |
#对比FlaskAPI的:return jsonify({'response': result}),JSONResponse vs jsonify(都需要相应的from ... import ...)
|
65 |
except Exception as e:
|