(feat) /batches - track user_api_key_alias, user_api_key_team_alias etc for /batch requests (#7401)

* run azure testing on ci/cd

* update docs on azure batches endpoints

* add input azure.jsonl

* refactor - use separate file for batches endpoints

* fixes for passing custom llm provider to /batch endpoints

* pass custom llm provider to files endpoints

* update azure batches doc

* add info for azure batches api

* update batches endpoints

* use simple helper for raising proxy exception

* update config.yml

* fix imports

* add type hints to get_litellm_params

* update get_litellm_params

* update get_litellm_params

* update get slp

* QOL - stop double logging a create batch operations on custom loggers

* re use slp from og event

* _create_standard_logging_object_for_completed_batch

* fix linting errors

* reduce num changes in PR

* update BATCH_STATUS_POLL_MAX_ATTEMPTS
This commit is contained in:
Ishaan Jaff 2024-12-24 17:44:28 -08:00 committed by GitHub
parent 0627450808
commit e98f1d16fd
9 changed files with 72 additions and 29 deletions

View file

@ -388,10 +388,16 @@ class Logging(LiteLLMLoggingBaseClass):
return standard_callback_dynamic_params
def update_environment_variables(
self, model, user, optional_params, litellm_params, **additional_params
self,
litellm_params: Dict,
optional_params: Dict,
model: Optional[str] = None,
user: Optional[str] = None,
**additional_params,
):
self.optional_params = optional_params
self.model = model
if model is not None:
self.model = model
self.user = user
self.litellm_params = scrub_sensitive_keys_in_metadata(litellm_params)
self.logger_fn = litellm_params.get("logger_fn", None)
@ -2885,9 +2891,11 @@ def get_standard_logging_object_payload(
litellm_params = kwargs.get("litellm_params", {})
proxy_server_request = litellm_params.get("proxy_server_request") or {}
end_user_id = proxy_server_request.get("body", {}).get("user", None)
metadata = (
litellm_params.get("metadata", {}) or {}
) # if litellm_params['metadata'] == None
metadata: dict = (
litellm_params.get("litellm_metadata")
or litellm_params.get("metadata", None)
or {}
)
completion_start_time = kwargs.get("completion_start_time", end_time)
call_type = kwargs.get("call_type")
cache_hit = kwargs.get("cache_hit", False)