Sfoglia il codice sorgente

logs: add baidu reply log

master
zhayujie 1 anno fa
parent
commit
2dcd026e9f
1 ha cambiato i file con 1 aggiunte e 0 eliminazioni
  1. +1
    -0
      bot/baidu/baidu_wenxin.py

+ 1
- 0
bot/baidu/baidu_wenxin.py Vedi 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…
Annulla
Salva