iShare commited on
Commit
d2d2af5
·
1 Parent(s): 750768e

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +3 -3
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
- #return JSONResponse({'response': result})
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: