forked from phoenix/litellm-mirror
Merge pull request #5573 from BerriAI/litellm_add_rerank_spend_tracking
[Feat] Add cost tracking for cohere rerank
This commit is contained in:
commit
64a828b455
6 changed files with 98 additions and 1 deletions
|
@ -30,6 +30,7 @@ from litellm.integrations.custom_logger import CustomLogger
|
|||
from litellm.litellm_core_utils.redact_messages import (
|
||||
redact_message_input_output_from_logging,
|
||||
)
|
||||
from litellm.rerank_api.types import RerankResponse
|
||||
from litellm.types.llms.openai import HttpxBinaryResponseContent
|
||||
from litellm.types.router import SPECIAL_MODEL_INFO_PARAMS
|
||||
from litellm.types.utils import (
|
||||
|
@ -525,6 +526,7 @@ class Logging:
|
|||
TranscriptionResponse,
|
||||
TextCompletionResponse,
|
||||
HttpxBinaryResponseContent,
|
||||
RerankResponse,
|
||||
],
|
||||
cache_hit: Optional[bool] = None,
|
||||
):
|
||||
|
@ -588,6 +590,7 @@ class Logging:
|
|||
or isinstance(result, TranscriptionResponse)
|
||||
or isinstance(result, TextCompletionResponse)
|
||||
or isinstance(result, HttpxBinaryResponseContent) # tts
|
||||
or isinstance(result, RerankResponse)
|
||||
):
|
||||
## RESPONSE COST ##
|
||||
self.model_call_details["response_cost"] = (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue