diff --git a/enterprise/callbacks/api_callback.py b/enterprise/callbacks/api_callback.py index 8c32ee86c..8a8ea2617 100644 --- a/enterprise/callbacks/api_callback.py +++ b/enterprise/callbacks/api_callback.py @@ -31,10 +31,24 @@ class GenericAPILogger: # Class variables or attributes def __init__(self, endpoint=None, headers=None): try: - verbose_logger.debug(f"in init GenericAPILogger, endpoint {endpoint}") + if endpoint == None: + # check env for "GENERIC_LOGGER_ENDPOINT" + if os.getenv("GENERIC_LOGGER_ENDPOINT"): + # Do something with the endpoint + endpoint = os.getenv("GENERIC_LOGGER_ENDPOINT") + else: + # Handle the case when the endpoint is not found in the environment variables + raise ValueError( + f"endpoint not set for GenericAPILogger, GENERIC_LOGGER_ENDPOINT not found in environment variables" + ) + headers = headers or litellm.generic_logger_headers self.endpoint = endpoint self.headers = headers + verbose_logger.debug( + f"in init GenericAPILogger, endpoint {self.endpoint}, headers {self.headers}" + ) + pass except Exception as e: diff --git a/litellm/__init__.py b/litellm/__init__.py index 00d7488c9..a7f232f76 100644 --- a/litellm/__init__.py +++ b/litellm/__init__.py @@ -146,6 +146,7 @@ model_cost_map_url: str = "https://raw.githubusercontent.com/BerriAI/litellm/mai suppress_debug_info = False dynamodb_table_name: Optional[str] = None s3_callback_params: Optional[Dict] = None +generic_logger_headers: Optional[Dict] = None default_key_generate_params: Optional[Dict] = None upperbound_key_generate_params: Optional[Dict] = None default_team_settings: Optional[List] = None