mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-07 02:59:05 +00:00
fix(litellm_logging.py): correctly log token usage for audio transcription calls to langfuse
This commit is contained in:
parent
08cfc2bf7e
commit
0640949333
1 changed files with 9 additions and 0 deletions
|
|
@ -1597,7 +1597,16 @@ class Logging(LiteLLMLoggingBaseClass):
|
|||
if hasattr(result, "model_dump")
|
||||
else dict(result)
|
||||
)
|
||||
elif isinstance(result, TranscriptionResponse):
|
||||
from litellm.litellm_core_utils.llm_cost_calc.usage_object_transformation import (
|
||||
TranscriptionUsageObjectTransformation,
|
||||
)
|
||||
|
||||
result = result.model_copy()
|
||||
transformed_usage = TranscriptionUsageObjectTransformation.transform_transcription_usage_object(
|
||||
result.usage # type: ignore
|
||||
)
|
||||
setattr(result, "usage", transformed_usage)
|
||||
if (
|
||||
litellm.max_budget
|
||||
and self.stream is False
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue