fix: empty usage (#2168)

This commit is contained in:
Yeuoly 2024-01-24 15:34:17 +08:00 committed by GitHub
parent d42df4ed04
commit 6c614f0c1f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -298,7 +298,7 @@ class AssistantCotApplicationRunner(BaseAssistantApplicationRunner):
message=AssistantPromptMessage(
content=final_answer
),
usage=llm_usage['usage'],
usage=llm_usage['usage'] if llm_usage['usage'] else LLMUsage.empty_usage(),
system_fingerprint=''
), PublishFrom.APPLICATION_MANAGER)

View File

@ -276,7 +276,7 @@ class AssistantFunctionCallApplicationRunner(BaseAssistantApplicationRunner):
message=AssistantPromptMessage(
content=final_answer,
),
usage=llm_usage['usage'],
usage=llm_usage['usage'] if llm_usage['usage'] else LLMUsage.empty_usage(),
system_fingerprint=''
), PublishFrom.APPLICATION_MANAGER)