Browse Source

logs: add baidu reply log

master
zhayujie 1 year ago
parent
commit
2dcd026e9f
1 changed files with 1 additions and 0 deletions
  1. +1
    -0
      bot/baidu/baidu_wenxin.py

+ 1
- 0
bot/baidu/baidu_wenxin.py View File

@@ -77,6 +77,7 @@ class BaiduWenxinBot(Bot):
payload = {'messages': session.messages}
response = requests.request("POST", url, headers=headers, data=json.dumps(payload))
response_text = json.loads(response.text)
logger.info(f"[BAIDU] response text={response_text}")
res_content = response_text["result"]
total_tokens = response_text["usage"]["total_tokens"]
completion_tokens = response_text["usage"]["completion_tokens"]


Loading…
Cancel
Save