fix:修改utf-8解码可能报错
This commit is contained in:
@@ -80,9 +80,9 @@ def do_chat_with_bot(user_query,session_id):
|
|||||||
if str(resp.status_code) == '200':
|
if str(resp.status_code) == '200':
|
||||||
for chunk in resp.iter_content(chunk_size=2048):
|
for chunk in resp.iter_content(chunk_size=2048):
|
||||||
if chunk:
|
if chunk:
|
||||||
text = chunk.decode('utf-8')
|
#text = chunk.decode('utf-8')
|
||||||
logger.debug(f'session {body.get('sessionId')} :\nchat with {body.get('agentCode')}: \ncontent is :{text}')
|
#logger.debug(f'session {body.get('sessionId')} :\nchat with {body.get('agentCode')}: \ncontent is :{text}')
|
||||||
yield text
|
yield chunk
|
||||||
else:
|
else:
|
||||||
logger.error(f"request chat with bot error,code is : {resp.status_code},\n error body is :{resp.content}")
|
logger.error(f"request chat with bot error,code is : {resp.status_code},\n error body is :{resp.content}")
|
||||||
yield resp.content
|
yield resp.content
|
||||||
Reference in New Issue
Block a user