(feat) Add basic logging support for /batches endpoints (#7381)

* add basic logging for create`batch`

* add create_batch as a call type

* add basic dd logging for batches

* basic batch creation logging on DD
This commit is contained in:
Ishaan Jaff 2024-12-23 17:45:03 -08:00 committed by GitHub
parent 6f6c651ee0
commit 87f19d6f13
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 81 additions and 43 deletions

View file

@ -34,7 +34,11 @@ from litellm.litellm_core_utils.redact_messages import (
redact_message_input_output_from_custom_logger,
redact_message_input_output_from_logging,
)
from litellm.types.llms.openai import AllMessageValues, HttpxBinaryResponseContent
from litellm.types.llms.openai import (
AllMessageValues,
Batch,
HttpxBinaryResponseContent,
)
from litellm.types.rerank import RerankResponse
from litellm.types.router import SPECIAL_MODEL_INFO_PARAMS
from litellm.types.utils import (
@ -749,6 +753,7 @@ class Logging(LiteLLMLoggingBaseClass):
TextCompletionResponse,
HttpxBinaryResponseContent,
RerankResponse,
Batch,
],
cache_hit: Optional[bool] = None,
) -> Optional[float]:
@ -865,6 +870,7 @@ class Logging(LiteLLMLoggingBaseClass):
or isinstance(result, TextCompletionResponse)
or isinstance(result, HttpxBinaryResponseContent) # tts
or isinstance(result, RerankResponse)
or isinstance(result, Batch)
):
## RESPONSE COST ##
self.model_call_details["response_cost"] = (