Pārlūkot izejas kodu

logs: add baidu reply log

master
zhayujie pirms 1 gada
vecāks
revīzija
2dcd026e9f
1 mainītis faili ar 1 papildinājumiem un 0 dzēšanām
  1. +1
    -0
      bot/baidu/baidu_wenxin.py

+ 1
- 0
bot/baidu/baidu_wenxin.py Parādīt failu

@@ -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"]


Notiek ielāde…
Atcelt
Saglabāt