mirror of
https://github.com/xtekky/gpt4free.git
synced 2025-12-06 02:30:41 -08:00
Fix response type of reasoning in UI
This commit is contained in:
parent
6b8e6adc9d
commit
797b17833a
11 changed files with 63 additions and 151 deletions
|
|
@ -156,7 +156,7 @@ class Backend_Api(Api):
|
|||
|
||||
if has_flask_limiter and app.demo:
|
||||
@app.route('/backend-api/v2/conversation', methods=['POST'])
|
||||
@limiter.limit("4 per minute") # 1 request in 15 seconds
|
||||
@limiter.limit("2 per minute")
|
||||
def _handle_conversation():
|
||||
limiter.check()
|
||||
return handle_conversation()
|
||||
|
|
@ -270,7 +270,8 @@ class Backend_Api(Api):
|
|||
response = iter_run_tools(ChatCompletion.create, **parameters)
|
||||
cache_dir.mkdir(parents=True, exist_ok=True)
|
||||
with cache_file.open("w") as f:
|
||||
f.write(response)
|
||||
for chunk in response:
|
||||
f.write(str(chunk))
|
||||
else:
|
||||
response = iter_run_tools(ChatCompletion.create, **parameters)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue