mirror of
https://github.com/langbot-app/LangBot.git
synced 2025-11-25 19:37:36 +08:00
Merge pull request #521 from RockChinQ/fix-usage-not-reported
[Fix] text的使用量未上报
This commit is contained in:
@@ -52,6 +52,13 @@ class OpenAIInteract:
|
|||||||
|
|
||||||
# 请求接口
|
# 请求接口
|
||||||
for resp in request:
|
for resp in request:
|
||||||
|
|
||||||
|
if resp['usage']['total_tokens'] > 0:
|
||||||
|
self.audit_mgr.report_text_model_usage(
|
||||||
|
model,
|
||||||
|
resp['usage']['total_tokens']
|
||||||
|
)
|
||||||
|
|
||||||
yield resp
|
yield resp
|
||||||
|
|
||||||
def request_image(self, prompt) -> dict:
|
def request_image(self, prompt) -> dict:
|
||||||
|
|||||||
Reference in New Issue
Block a user