iShare commited on
Commit
01ae07f
1 Parent(s): 0f7b3d4

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +3 -2
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
- #return {'response': result} #FastAPI方式下,这个返回形式,有问题?
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."