Skip to content

Commit

Permalink
Update http_service.py
Browse files Browse the repository at this point in the history
  • Loading branch information
liu2-3zhi authored and lss233 committed Mar 3, 2024
1 parent 7eb7061 commit 42c0a82
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions platforms/http_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,6 @@ async def v2_chat():
# Return the result time as request_id
return bot_request.request_time


import re

@app.route('/v2/chat/response', methods=['GET'])
async def v2_chat_response():
"""异步请求时,配合/v2/chat获取内容"""
Expand All @@ -156,21 +153,6 @@ async def v2_chat_response():
return response


@app.route('/v2/chat/response', methods=['GET'])
async def v2_chat_response():
"""异步请求时,配合/v2/chat获取内容"""
request_id = request.args.get("request_id")
bot_request: BotRequest = request_dic.get(request_id, None)
if bot_request is None:
return ResponseResult(message="没有更多了!", result_status=RESPONSE_FAILED).to_json()
response = bot_request.result.to_json()
if bot_request.done:
request_dic.pop(request_id)
else:
bot_request.result.pop_all()
logger.debug(f"Bot request {request_id} response -> \n{response[:100]}")
return response


def clear_request_dict():
logger.debug("Watch and clean request_dic.")
Expand Down

0 comments on commit 42c0a82

Please sign in to comment.