diff --git a/enterprise/litellm_enterprise/proxy/management_endpoints/project_endpoints.py b/enterprise/litellm_enterprise/proxy/management_endpoints/project_endpoints.py index 66fac8d76ee..4c69bfa4a19 100644 --- a/enterprise/litellm_enterprise/proxy/management_endpoints/project_endpoints.py +++ b/enterprise/litellm_enterprise/proxy/management_endpoints/project_endpoints.py @@ -454,7 +454,7 @@ async def new_project( return response except Exception as e: verbose_proxy_logger.exception( - "litellm.proxy.management_endpoints.project_endpoints.new_project(): Exception occured - {}".format(str(e)) + "litellm.proxy.management_endpoints.project_endpoints.new_project(): Exception occurred - {}".format(str(e)) ) raise handle_exception_on_proxy(e) @@ -682,7 +682,7 @@ async def update_project( return updated_project except Exception as e: verbose_proxy_logger.exception( - "litellm.proxy.management_endpoints.project_endpoints.update_project(): Exception occured - {}".format( + "litellm.proxy.management_endpoints.project_endpoints.update_project(): Exception occurred - {}".format( str(e) ) ) @@ -790,7 +790,7 @@ async def delete_project( return deleted_projects except Exception as e: verbose_proxy_logger.exception( - "litellm.proxy.management_endpoints.project_endpoints.delete_project(): Exception occured - {}".format( + "litellm.proxy.management_endpoints.project_endpoints.delete_project(): Exception occurred - {}".format( str(e) ) ) @@ -865,7 +865,7 @@ async def project_info( return project except Exception as e: verbose_proxy_logger.exception( - "litellm.proxy.management_endpoints.project_endpoints.project_info(): Exception occured - {}".format(str(e)) + "litellm.proxy.management_endpoints.project_endpoints.project_info(): Exception occurred - {}".format(str(e)) ) raise handle_exception_on_proxy(e) @@ -921,7 +921,7 @@ async def list_projects( return projects except Exception as e: verbose_proxy_logger.exception( - "litellm.proxy.management_endpoints.project_endpoints.list_projects(): Exception occured - {}".format( + "litellm.proxy.management_endpoints.project_endpoints.list_projects(): Exception occurred - {}".format( str(e) ) ) diff --git a/litellm/cost_calculator.py b/litellm/cost_calculator.py index 6b6653c5646..583d5ae9ef0 100644 --- a/litellm/cost_calculator.py +++ b/litellm/cost_calculator.py @@ -1686,7 +1686,7 @@ def completion_cost( ) if idx == len(potential_model_names) - 1: raise e - raise Exception(f"Unable to calculat cost for received potential model names - {potential_model_names}") + raise Exception(f"Unable to calculate cost for received potential model names - {potential_model_names}") except Exception as e: raise e diff --git a/litellm/integrations/langfuse/langfuse.py b/litellm/integrations/langfuse/langfuse.py index 05e7fe99e16..3e20c9331fc 100644 --- a/litellm/integrations/langfuse/langfuse.py +++ b/litellm/integrations/langfuse/langfuse.py @@ -326,7 +326,7 @@ class LangFuseLogger: return {"trace_id": trace_id, "generation_id": generation_id} except Exception as e: - verbose_logger.exception("Langfuse Layer Error(): Exception occured - %s", e) + verbose_logger.exception("Langfuse Layer Error(): Exception occurred - %s", e) return {"trace_id": None, "generation_id": None} def _get_langfuse_input_output_content( diff --git a/litellm/integrations/prometheus.py b/litellm/integrations/prometheus.py index a9056aaf4e1..9e4ebffdd9a 100644 --- a/litellm/integrations/prometheus.py +++ b/litellm/integrations/prometheus.py @@ -2128,7 +2128,7 @@ class PrometheusLogger(CustomLogger): response_cost=0, ) except Exception as e: - verbose_logger.exception("prometheus Layer Error(): Exception occured - %s", e) + verbose_logger.exception("prometheus Layer Error(): Exception occurred - %s", e) def _extract_status_code( self, @@ -2380,7 +2380,7 @@ class PrometheusLogger(CustomLogger): ) except Exception as e: - verbose_logger.exception("prometheus Layer Error(): Exception occured - %s", e) + verbose_logger.exception("prometheus Layer Error(): Exception occurred - %s", e) async def async_post_call_success_hook(self, data: dict, user_api_key_dict: UserAPIKeyAuth, response): """ @@ -2605,7 +2605,7 @@ class PrometheusLogger(CustomLogger): ) except Exception as e: - verbose_logger.debug("Prometheus Error: set_llm_deployment_failure_metrics. Exception occured - %s", e) + verbose_logger.debug("Prometheus Error: set_llm_deployment_failure_metrics. Exception occurred - %s", e) def _set_deployment_tpm_rpm_limit_metrics( self, @@ -2719,7 +2719,7 @@ class PrometheusLogger(CustomLogger): ) self.litellm_remaining_requests_metric.labels(**_labels).set(remaining_requests) except Exception as e: - verbose_logger.exception("Prometheus Error: _async_set_router_remaining_metrics. Exception occured - %s", e) + verbose_logger.exception("Prometheus Error: _async_set_router_remaining_metrics. Exception occurred - %s", e) def set_llm_deployment_success_metrics( self, @@ -2862,7 +2862,7 @@ class PrometheusLogger(CustomLogger): self.litellm_deployment_latency_per_output_token.labels(**_labels).observe(latency_per_token) except Exception as e: - verbose_logger.exception("Prometheus Error: set_llm_deployment_success_metrics. Exception occured - %s", e) + verbose_logger.exception("Prometheus Error: set_llm_deployment_success_metrics. Exception occurred - %s", e) return def _record_guardrail_metrics( diff --git a/litellm/litellm_core_utils/litellm_logging.py b/litellm/litellm_core_utils/litellm_logging.py index 99721c3ffa2..06c35330e8b 100644 --- a/litellm/litellm_core_utils/litellm_logging.py +++ b/litellm/litellm_core_utils/litellm_logging.py @@ -1034,7 +1034,7 @@ class Logging(LiteLLMLoggingBaseClass): callback_func=callback, ) except Exception as e: - verbose_logger.exception("litellm.Logging.pre_call(): Exception occured - %s", e) + verbose_logger.exception("litellm.Logging.pre_call(): Exception occurred - %s", e) verbose_logger.debug( "LiteLLM.Logging: is sentry capture exception initialized %s", capture_exception ) diff --git a/litellm/litellm_core_utils/llm_cost_calc/utils.py b/litellm/litellm_core_utils/llm_cost_calc/utils.py index 6574b261774..d5ca7ce9188 100644 --- a/litellm/litellm_core_utils/llm_cost_calc/utils.py +++ b/litellm/litellm_core_utils/llm_cost_calc/utils.py @@ -150,7 +150,7 @@ def _generic_cost_per_character( prompt_cost = prompt_characters * custom_prompt_cost except Exception as e: verbose_logger.exception( - "litellm.litellm_core_utils.llm_cost_calc.utils.py::cost_per_character(): Exception occured - %s\nDefaulting to None", + "litellm.litellm_core_utils.llm_cost_calc.utils.py::cost_per_character(): Exception occurred - %s\nDefaulting to None", e, ) @@ -166,7 +166,7 @@ def _generic_cost_per_character( completion_cost = completion_characters * custom_completion_cost except Exception as e: verbose_logger.exception( - "litellm.litellm_core_utils.llm_cost_calc.utils.py::cost_per_character(): Exception occured - %s\nDefaulting to None", + "litellm.litellm_core_utils.llm_cost_calc.utils.py::cost_per_character(): Exception occurred - %s\nDefaulting to None", e, ) @@ -390,7 +390,7 @@ def _get_cost_per_unit(model_info: ModelInfo, cost_key: str, default_value: floa return float(cost_per_unit) except ValueError: verbose_logger.exception( - "litellm.litellm_core_utils.llm_cost_calc.utils.py::calculate_cost_per_component(): Exception occured - %s\nDefaulting to 0.0", + "litellm.litellm_core_utils.llm_cost_calc.utils.py::calculate_cost_per_component(): Exception occurred - %s\nDefaulting to 0.0", cost_per_unit, ) @@ -411,7 +411,7 @@ def _get_cost_per_unit(model_info: ModelInfo, cost_key: str, default_value: floa return float(fallback_cost) except ValueError: verbose_logger.exception( - "litellm.litellm_core_utils.llm_cost_calc.utils.py::_get_cost_per_unit(): Exception occured - %s\nDefaulting to 0.0", + "litellm.litellm_core_utils.llm_cost_calc.utils.py::_get_cost_per_unit(): Exception occurred - %s\nDefaulting to 0.0", fallback_cost, ) break # Only try the first matching suffix diff --git a/litellm/litellm_core_utils/streaming_handler.py b/litellm/litellm_core_utils/streaming_handler.py index 68465d06b15..a692ee1dec0 100644 --- a/litellm/litellm_core_utils/streaming_handler.py +++ b/litellm/litellm_core_utils/streaming_handler.py @@ -614,7 +614,7 @@ class CustomStreamWrapper: else: return "" except Exception as e: - verbose_logger.exception("litellm.CustomStreamWrapper.handle_baseten_chunk(): Exception occured - %s", e) + verbose_logger.exception("litellm.CustomStreamWrapper.handle_baseten_chunk(): Exception occurred - %s", e) return "" def handle_triton_stream(self, chunk): @@ -1421,7 +1421,7 @@ class CustomStreamWrapper: model_response.choices[0].delta = Delta(**_json_delta) except Exception as e: verbose_logger.exception( - "litellm.CustomStreamWrapper.chunk_creator(): Exception occured - %s", e + "litellm.CustomStreamWrapper.chunk_creator(): Exception occurred - %s", e ) model_response.choices[0].delta = Delta() elif self._has_any_special_delta_attributes(delta): diff --git a/litellm/llms/vertex_ai/cost_calculator.py b/litellm/llms/vertex_ai/cost_calculator.py index 86a5bb207ec..5a2fe35e276 100644 --- a/litellm/llms/vertex_ai/cost_calculator.py +++ b/litellm/llms/vertex_ai/cost_calculator.py @@ -114,7 +114,7 @@ def cost_per_character( prompt_cost = prompt_characters * model_info["input_cost_per_character"] except Exception as e: verbose_logger.debug( - "litellm.litellm_core_utils.llm_cost_calc.google.py::cost_per_character(): Exception occured - %s\nDefaulting to None", + "litellm.litellm_core_utils.llm_cost_calc.google.py::cost_per_character(): Exception occurred - %s\nDefaulting to None", e, ) prompt_cost, _ = cost_per_token( @@ -153,7 +153,7 @@ def cost_per_character( completion_cost = completion_characters * model_info["output_cost_per_character"] except Exception as e: verbose_logger.debug( - "litellm.litellm_core_utils.llm_cost_calc.google.py::cost_per_character(): Exception occured - %s\nDefaulting to None", + "litellm.litellm_core_utils.llm_cost_calc.google.py::cost_per_character(): Exception occurred - %s\nDefaulting to None", e, ) _, completion_cost = cost_per_token( diff --git a/litellm/proxy/anthropic_endpoints/endpoints.py b/litellm/proxy/anthropic_endpoints/endpoints.py index f75899b91dc..84bca20d460 100644 --- a/litellm/proxy/anthropic_endpoints/endpoints.py +++ b/litellm/proxy/anthropic_endpoints/endpoints.py @@ -191,7 +191,7 @@ async def anthropic_response( await proxy_logging_obj.post_call_failure_hook( user_api_key_dict=user_api_key_dict, original_exception=e, request_data=data ) - verbose_proxy_logger.exception("litellm.proxy.proxy_server.anthropic_response(): Exception occured - %s", e) + verbose_proxy_logger.exception("litellm.proxy.proxy_server.anthropic_response(): Exception occurred - %s", e) # Extract model_id from request metadata (same as success path) litellm_metadata: Final = data.get("litellm_metadata", {}) or {} diff --git a/litellm/proxy/auth/auth_exception_handler.py b/litellm/proxy/auth/auth_exception_handler.py index 603e72463bc..dee31a3c2e7 100644 --- a/litellm/proxy/auth/auth_exception_handler.py +++ b/litellm/proxy/auth/auth_exception_handler.py @@ -95,7 +95,7 @@ class UserAPIKeyAuthExceptionHandler: use_x_forwarded_for=general_settings.get("use_x_forwarded_for", False), ) verbose_proxy_logger.exception( - "litellm.proxy.proxy_server.user_api_key_auth(): Exception occured - %s\nRequester IP Address:%s", + "litellm.proxy.proxy_server.user_api_key_auth(): Exception occurred - %s\nRequester IP Address:%s", e, requester_ip, extra={"requester_ip": requester_ip}, diff --git a/litellm/proxy/batches_endpoints/endpoints.py b/litellm/proxy/batches_endpoints/endpoints.py index aef1c5ac17e..a4bb2d2136c 100644 --- a/litellm/proxy/batches_endpoints/endpoints.py +++ b/litellm/proxy/batches_endpoints/endpoints.py @@ -350,7 +350,7 @@ async def create_batch( await proxy_logging_obj.post_call_failure_hook( user_api_key_dict=user_api_key_dict, original_exception=e, request_data=data ) - verbose_proxy_logger.exception("litellm.proxy.proxy_server.create_batch(): Exception occured - %s", e) + verbose_proxy_logger.exception("litellm.proxy.proxy_server.create_batch(): Exception occurred - %s", e) raise handle_exception_on_proxy(e) @@ -620,7 +620,7 @@ async def retrieve_batch( await proxy_logging_obj.post_call_failure_hook( user_api_key_dict=user_api_key_dict, original_exception=e, request_data=data ) - verbose_proxy_logger.exception("litellm.proxy.proxy_server.retrieve_batch(): Exception occured - %s", e) + verbose_proxy_logger.exception("litellm.proxy.proxy_server.retrieve_batch(): Exception occurred - %s", e) raise handle_exception_on_proxy(e) @@ -801,7 +801,7 @@ async def list_batches( original_exception=e, request_data={"after": after, "limit": limit}, ) - verbose_proxy_logger.error("litellm.proxy.proxy_server.retrieve_batch(): Exception occured - %s", e) + verbose_proxy_logger.error("litellm.proxy.proxy_server.retrieve_batch(): Exception occurred - %s", e) raise handle_exception_on_proxy(e) @@ -1018,7 +1018,7 @@ async def cancel_batch( await proxy_logging_obj.post_call_failure_hook( user_api_key_dict=user_api_key_dict, original_exception=e, request_data=data ) - verbose_proxy_logger.exception("litellm.proxy.proxy_server.create_batch(): Exception occured - %s", e) + verbose_proxy_logger.exception("litellm.proxy.proxy_server.create_batch(): Exception occurred - %s", e) raise handle_exception_on_proxy(e) diff --git a/litellm/proxy/common_request_processing.py b/litellm/proxy/common_request_processing.py index 159d7508f4e..dcf56ffe18e 100644 --- a/litellm/proxy/common_request_processing.py +++ b/litellm/proxy/common_request_processing.py @@ -967,7 +967,7 @@ def _log_llm_api_exception(e: Exception) -> None: "litellm.proxy.proxy_server._handle_llm_api_exception(): client disconnected, upstream LLM request cancelled" ) return - verbose_proxy_logger.exception("litellm.proxy.proxy_server._handle_llm_api_exception(): Exception occured - %s", e) + verbose_proxy_logger.exception("litellm.proxy.proxy_server._handle_llm_api_exception(): Exception occurred - %s", e) async def _cancel_llm_call_on_client_disconnect( @@ -2977,7 +2977,7 @@ class ProxyBaseLLMRequestProcessing: raise except Exception as e: verbose_proxy_logger.exception( - "litellm.proxy.proxy_server.async_data_generator(): Exception occured - %s", e + "litellm.proxy.proxy_server.async_data_generator(): Exception occurred - %s", e ) transformed_exception: Final = await proxy_logging_obj.post_call_failure_hook( user_api_key_dict=user_api_key_dict, diff --git a/litellm/proxy/health_endpoints/_health_endpoints.py b/litellm/proxy/health_endpoints/_health_endpoints.py index 52b7faeac07..66c2c913b9f 100644 --- a/litellm/proxy/health_endpoints/_health_endpoints.py +++ b/litellm/proxy/health_endpoints/_health_endpoints.py @@ -471,7 +471,7 @@ async def health_services_endpoint( } except Exception as e: - verbose_proxy_logger.error("litellm.proxy.proxy_server.health_services_endpoint(): Exception occured - %s", e) + verbose_proxy_logger.error("litellm.proxy.proxy_server.health_services_endpoint(): Exception occurred - %s", e) verbose_proxy_logger.debug(traceback.format_exc()) if isinstance(e, HTTPException): raise ProxyException( @@ -1115,7 +1115,7 @@ async def health_endpoint( ) return _post_process(router_result) except Exception as e: - verbose_proxy_logger.error("litellm.proxy.proxy_server.py::health_endpoint(): Exception occured - %s", e) + verbose_proxy_logger.error("litellm.proxy.proxy_server.py::health_endpoint(): Exception occurred - %s", e) verbose_proxy_logger.debug(traceback.format_exc()) raise e diff --git a/litellm/proxy/hooks/azure_content_safety.py b/litellm/proxy/hooks/azure_content_safety.py index f9d5970bb55..6170863fc64 100644 --- a/litellm/proxy/hooks/azure_content_safety.py +++ b/litellm/proxy/hooks/azure_content_safety.py @@ -124,7 +124,7 @@ class _PROXY_AzureContentSafety( raise e except Exception as e: verbose_proxy_logger.error( - "litellm.proxy.hooks.azure_content_safety.py::async_pre_call_hook(): Exception occured - %s", e + "litellm.proxy.hooks.azure_content_safety.py::async_pre_call_hook(): Exception occurred - %s", e ) verbose_proxy_logger.debug(traceback.format_exc()) diff --git a/litellm/proxy/hooks/batch_redis_get.py b/litellm/proxy/hooks/batch_redis_get.py index 13e2bdbc304..926eb877cdf 100644 --- a/litellm/proxy/hooks/batch_redis_get.py +++ b/litellm/proxy/hooks/batch_redis_get.py @@ -84,7 +84,7 @@ class _PROXY_BatchRedisRequests(CustomLogger): raise e except Exception as e: verbose_proxy_logger.error( - "litellm.proxy.hooks.batch_redis_get.py::async_pre_call_hook(): Exception occured - %s", e + "litellm.proxy.hooks.batch_redis_get.py::async_pre_call_hook(): Exception occurred - %s", e ) verbose_proxy_logger.debug(traceback.format_exc()) diff --git a/litellm/proxy/hooks/cache_control_check.py b/litellm/proxy/hooks/cache_control_check.py index dab2ed0b933..8d60938f454 100644 --- a/litellm/proxy/hooks/cache_control_check.py +++ b/litellm/proxy/hooks/cache_control_check.py @@ -54,5 +54,5 @@ class _PROXY_CacheControlCheck(CustomLogger): raise e except Exception as e: verbose_logger.exception( - "litellm.proxy.hooks.cache_control_check.py::async_pre_call_hook(): Exception occured - %s", e + "litellm.proxy.hooks.cache_control_check.py::async_pre_call_hook(): Exception occurred - %s", e ) diff --git a/litellm/proxy/hooks/dynamic_rate_limiter.py b/litellm/proxy/hooks/dynamic_rate_limiter.py index f4eac6ae5ae..ac8bf0537e6 100644 --- a/litellm/proxy/hooks/dynamic_rate_limiter.py +++ b/litellm/proxy/hooks/dynamic_rate_limiter.py @@ -69,7 +69,7 @@ class DynamicRateLimiterCache: await self.cache.async_set_cache_sadd(key=key_name, value=value, ttl=self.ttl) except Exception as e: verbose_proxy_logger.exception( - "litellm.proxy.hooks.dynamic_rate_limiter.py::async_set_cache_sadd(): Exception occured - %s", e + "litellm.proxy.hooks.dynamic_rate_limiter.py::async_set_cache_sadd(): Exception occurred - %s", e ) raise e @@ -266,6 +266,6 @@ class _PROXY_DynamicRateLimitHandler(CustomLogger): ) except Exception as e: verbose_proxy_logger.exception( - "litellm.proxy.hooks.dynamic_rate_limiter.py::async_post_call_success_hook(): Exception occured - %s", e + "litellm.proxy.hooks.dynamic_rate_limiter.py::async_post_call_success_hook(): Exception occurred - %s", e ) return response diff --git a/litellm/proxy/hooks/max_budget_limiter.py b/litellm/proxy/hooks/max_budget_limiter.py index eaf37b0bcf1..140143592e0 100644 --- a/litellm/proxy/hooks/max_budget_limiter.py +++ b/litellm/proxy/hooks/max_budget_limiter.py @@ -80,5 +80,5 @@ class _PROXY_MaxBudgetLimiter(CustomLogger): raise e except Exception as e: verbose_logger.exception( - "litellm.proxy.hooks.max_budget_limiter.py::async_pre_call_hook(): Exception occured - %s", e + "litellm.proxy.hooks.max_budget_limiter.py::async_pre_call_hook(): Exception occurred - %s", e ) diff --git a/litellm/proxy/hooks/prompt_injection_detection.py b/litellm/proxy/hooks/prompt_injection_detection.py index bfeec49d664..8b7d64ad53f 100644 --- a/litellm/proxy/hooks/prompt_injection_detection.py +++ b/litellm/proxy/hooks/prompt_injection_detection.py @@ -197,7 +197,7 @@ class _OPTIONAL_PromptInjectionDetection(CustomLogger): raise e except Exception as e: verbose_proxy_logger.exception( - "litellm.proxy.hooks.prompt_injection_detection.py::async_pre_call_hook(): Exception occured - %s", e + "litellm.proxy.hooks.prompt_injection_detection.py::async_pre_call_hook(): Exception occurred - %s", e ) async def async_moderation_hook( diff --git a/litellm/proxy/image_endpoints/endpoints.py b/litellm/proxy/image_endpoints/endpoints.py index 24ee1d96a0d..0cfcf3148f0 100644 --- a/litellm/proxy/image_endpoints/endpoints.py +++ b/litellm/proxy/image_endpoints/endpoints.py @@ -190,7 +190,7 @@ async def image_generation( await proxy_logging_obj.post_call_failure_hook( user_api_key_dict=user_api_key_dict, original_exception=e, request_data=data ) - verbose_proxy_logger.error("litellm.proxy.proxy_server.image_generation(): Exception occured - %s", e) + verbose_proxy_logger.error("litellm.proxy.proxy_server.image_generation(): Exception occurred - %s", e) verbose_proxy_logger.debug(traceback.format_exc()) if isinstance(e, HTTPException): raise ProxyException( diff --git a/litellm/proxy/management_endpoints/customer_endpoints.py b/litellm/proxy/management_endpoints/customer_endpoints.py index a51ff48aab6..1b432fc6838 100644 --- a/litellm/proxy/management_endpoints/customer_endpoints.py +++ b/litellm/proxy/management_endpoints/customer_endpoints.py @@ -392,7 +392,7 @@ async def new_end_user( return _to_customer_response(end_user_record) except Exception as e: verbose_proxy_logger.exception( - "litellm.proxy.management_endpoints.customer_endpoints.new_end_user(): Exception occured - %s", e + "litellm.proxy.management_endpoints.customer_endpoints.new_end_user(): Exception occurred - %s", e ) if "Unique constraint failed on the fields: (`user_id`)" in str(e): raise ProxyException( @@ -457,7 +457,7 @@ async def end_user_info( except Exception as e: verbose_proxy_logger.exception( - "litellm.proxy.management_endpoints.customer_endpoints.end_user_info(): Exception occured - %s", e + "litellm.proxy.management_endpoints.customer_endpoints.end_user_info(): Exception occurred - %s", e ) raise handle_exception_on_proxy(e) @@ -639,7 +639,7 @@ async def update_end_user( # update based on remaining passed in values except Exception as e: - verbose_proxy_logger.exception("litellm.proxy.proxy_server.update_end_user(): Exception occured - %s", e) + verbose_proxy_logger.exception("litellm.proxy.proxy_server.update_end_user(): Exception occurred - %s", e) raise handle_exception_on_proxy(e) @@ -714,7 +714,7 @@ async def delete_end_user( # update based on remaining passed in values except Exception as e: - verbose_proxy_logger.error("litellm.proxy.proxy_server.delete_end_user(): Exception occured - %s", e) + verbose_proxy_logger.error("litellm.proxy.proxy_server.delete_end_user(): Exception occurred - %s", e) raise handle_exception_on_proxy(e) @@ -770,7 +770,7 @@ async def list_end_user( except Exception as e: verbose_proxy_logger.exception( - "litellm.proxy.management_endpoints.customer_endpoints.list_end_user(): Exception occured - %s", e + "litellm.proxy.management_endpoints.customer_endpoints.list_end_user(): Exception occurred - %s", e ) raise handle_exception_on_proxy(e) diff --git a/litellm/proxy/management_endpoints/internal_user_endpoints.py b/litellm/proxy/management_endpoints/internal_user_endpoints.py index abc5d3e53ff..99dedbab7eb 100644 --- a/litellm/proxy/management_endpoints/internal_user_endpoints.py +++ b/litellm/proxy/management_endpoints/internal_user_endpoints.py @@ -607,7 +607,7 @@ async def new_user( return new_user_response except Exception as e: - verbose_proxy_logger.exception("/user/new: Exception occured - %s", e) + verbose_proxy_logger.exception("/user/new: Exception occurred - %s", e) raise handle_exception_on_proxy(e) @@ -901,7 +901,7 @@ async def user_info( return response_data except Exception as e: - verbose_proxy_logger.exception("litellm.proxy.proxy_server.user_info(): Exception occured - %s", e) + verbose_proxy_logger.exception("litellm.proxy.proxy_server.user_info(): Exception occurred - %s", e) raise handle_exception_on_proxy(e) @@ -1051,7 +1051,7 @@ async def user_info_v2( object_permission=user_data.get("object_permission"), ) except Exception as e: - verbose_proxy_logger.exception("litellm.proxy.proxy_server.user_info_v2(): Exception occured - %s", e) + verbose_proxy_logger.exception("litellm.proxy.proxy_server.user_info_v2(): Exception occurred - %s", e) raise handle_exception_on_proxy(e) @@ -1570,7 +1570,7 @@ async def user_update( ) return response except Exception as e: - verbose_proxy_logger.exception("litellm.proxy.proxy_server.user_update(): Exception occured - %s", e) + verbose_proxy_logger.exception("litellm.proxy.proxy_server.user_update(): Exception occurred - %s", e) verbose_proxy_logger.debug(traceback.format_exc()) if isinstance(e, HTTPException): raise ProxyException( @@ -2725,7 +2725,7 @@ async def get_user_daily_activity( except HTTPException: raise except Exception as e: - verbose_proxy_logger.exception("/spend/daily/analytics: Exception occured - %s", e) + verbose_proxy_logger.exception("/spend/daily/analytics: Exception occurred - %s", e) raise HTTPException( status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail={"error": f"Failed to fetch analytics: {e}"}, @@ -2817,7 +2817,7 @@ async def get_user_daily_activity_aggregated( except HTTPException: raise except Exception as e: - verbose_proxy_logger.exception("/user/daily/activity/aggregated: Exception occured - %s", e) + verbose_proxy_logger.exception("/user/daily/activity/aggregated: Exception occurred - %s", e) raise HTTPException( status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail={"error": f"Failed to fetch analytics: {e}"}, diff --git a/litellm/proxy/management_endpoints/key_management_endpoints.py b/litellm/proxy/management_endpoints/key_management_endpoints.py index 2de1d177b33..ac7070628f1 100644 --- a/litellm/proxy/management_endpoints/key_management_endpoints.py +++ b/litellm/proxy/management_endpoints/key_management_endpoints.py @@ -1744,7 +1744,7 @@ async def generate_key_fn( ) except Exception as e: - verbose_proxy_logger.exception("litellm.proxy.proxy_server.generate_key_fn(): Exception occured - %s", e) + verbose_proxy_logger.exception("litellm.proxy.proxy_server.generate_key_fn(): Exception occurred - %s", e) raise handle_exception_on_proxy(e) @@ -1948,7 +1948,7 @@ def prepare_metadata_fields(data: BaseModel, non_default_values: dict, existing_ except Exception as e: verbose_proxy_logger.exception( - "litellm.proxy.proxy_server.prepare_metadata_fields(): Exception occured - %s", e + "litellm.proxy.proxy_server.prepare_metadata_fields(): Exception occurred - %s", e ) non_default_values["metadata"] = encrypt_callback_vars(casted_metadata) @@ -2813,7 +2813,7 @@ async def update_key_fn( return {"key": key, **response["data"]} # update based on remaining passed in values except Exception as e: - verbose_proxy_logger.exception("litellm.proxy.proxy_server.update_key_fn(): Exception occured - %s", e) + verbose_proxy_logger.exception("litellm.proxy.proxy_server.update_key_fn(): Exception occurred - %s", e) if isinstance(e, HTTPException): raise ProxyException( message=getattr(e, "detail", f"Authentication Error({e})"), @@ -3382,7 +3382,7 @@ async def delete_key_fn( return {"deleted_keys": deleted_keys} except Exception as e: - verbose_proxy_logger.exception("litellm.proxy.proxy_server.delete_key_fn(): Exception occured - %s", e) + verbose_proxy_logger.exception("litellm.proxy.proxy_server.delete_key_fn(): Exception occurred - %s", e) raise handle_exception_on_proxy(e) @@ -3945,7 +3945,7 @@ async def generate_key_helper_fn( # If it's not valid JSON/YAML, keep as is or set to empty dict key_data["router_settings"] = {} except Exception as e: - verbose_proxy_logger.error("litellm.proxy.proxy_server.generate_key_helper_fn(): Exception occured - %s", e) + verbose_proxy_logger.error("litellm.proxy.proxy_server.generate_key_helper_fn(): Exception occurred - %s", e) verbose_proxy_logger.debug(traceback.format_exc()) if isinstance(e, HTTPException): raise e @@ -4153,7 +4153,7 @@ async def delete_verification_tokens( raise Exception("DB not connected. prisma_client is None") except Exception as e: verbose_proxy_logger.exception( - "litellm.proxy.proxy_server.delete_verification_tokens(): Exception occured - %s", e + "litellm.proxy.proxy_server.delete_verification_tokens(): Exception occurred - %s", e ) verbose_proxy_logger.debug(traceback.format_exc()) raise e diff --git a/litellm/proxy/management_endpoints/management_v1/budgets.py b/litellm/proxy/management_endpoints/management_v1/budgets.py index 51ebc20fe31..e6de9660f86 100644 --- a/litellm/proxy/management_endpoints/management_v1/budgets.py +++ b/litellm/proxy/management_endpoints/management_v1/budgets.py @@ -191,7 +191,7 @@ async def list_budgets( raise except Exception as e: # noqa: BLE001 # a driver error answers as a problem document, not the OpenAI error shape verbose_proxy_logger.exception( - "litellm.proxy.management_endpoints.management_v1.budgets.list_budgets(): Exception occured - %s", e + "litellm.proxy.management_endpoints.management_v1.budgets.list_budgets(): Exception occurred - %s", e ) raise ManagementProblem( ProblemDetail( diff --git a/litellm/proxy/management_endpoints/management_v1/spend_logs.py b/litellm/proxy/management_endpoints/management_v1/spend_logs.py index 96e60fcfdfc..9fd0c4eefa0 100644 --- a/litellm/proxy/management_endpoints/management_v1/spend_logs.py +++ b/litellm/proxy/management_endpoints/management_v1/spend_logs.py @@ -187,7 +187,7 @@ async def list_spend_log_end_users( raise except Exception as e: verbose_proxy_logger.exception( - "litellm.proxy.management_endpoints.management_v1.spend_logs.list_spend_log_end_users(): Exception occured - %s", + "litellm.proxy.management_endpoints.management_v1.spend_logs.list_spend_log_end_users(): Exception occurred - %s", e, ) raise ManagementProblem( diff --git a/litellm/proxy/management_endpoints/model_management_endpoints.py b/litellm/proxy/management_endpoints/model_management_endpoints.py index c2087005863..51b2c41e9ac 100644 --- a/litellm/proxy/management_endpoints/model_management_endpoints.py +++ b/litellm/proxy/management_endpoints/model_management_endpoints.py @@ -1499,7 +1499,7 @@ async def add_new_model( return model_response except Exception as e: - verbose_proxy_logger.exception("litellm.proxy.proxy_server.add_new_model(): Exception occured - %s", e) + verbose_proxy_logger.exception("litellm.proxy.proxy_server.add_new_model(): Exception occurred - %s", e) if isinstance(e, HTTPException): raise ProxyException( message=getattr(e, "detail", f"Authentication Error({e})"), @@ -1652,7 +1652,7 @@ async def update_model( return model_response except Exception as e: - verbose_proxy_logger.exception("litellm.proxy.proxy_server.update_model(): Exception occured - %s", e) + verbose_proxy_logger.exception("litellm.proxy.proxy_server.update_model(): Exception occurred - %s", e) if isinstance(e, HTTPException): raise ProxyException( message=getattr(e, "detail", f"Authentication Error({e})"), diff --git a/litellm/proxy/management_endpoints/team_callback_endpoints.py b/litellm/proxy/management_endpoints/team_callback_endpoints.py index 834d4e8b73b..7190cf8f29b 100644 --- a/litellm/proxy/management_endpoints/team_callback_endpoints.py +++ b/litellm/proxy/management_endpoints/team_callback_endpoints.py @@ -354,7 +354,7 @@ async def add_team_callbacks( except ProxyException as e: raise e except Exception as e: - verbose_proxy_logger.exception("litellm.proxy.proxy_server.add_team_callbacks(): Exception occured - %s", e) + verbose_proxy_logger.exception("litellm.proxy.proxy_server.add_team_callbacks(): Exception occurred - %s", e) raise ProxyException( message="Internal Server Error, " + str(e), type=ProxyErrorTypes.internal_server_error.value, diff --git a/litellm/proxy/openai_files_endpoints/files_endpoints.py b/litellm/proxy/openai_files_endpoints/files_endpoints.py index 0acaac3bf5d..df047141c7f 100644 --- a/litellm/proxy/openai_files_endpoints/files_endpoints.py +++ b/litellm/proxy/openai_files_endpoints/files_endpoints.py @@ -550,7 +550,7 @@ async def create_file( await proxy_logging_obj.post_call_failure_hook( user_api_key_dict=user_api_key_dict, original_exception=e, request_data=data ) - verbose_proxy_logger.exception("litellm.proxy.proxy_server.create_file(): Exception occured - %s", e) + verbose_proxy_logger.exception("litellm.proxy.proxy_server.create_file(): Exception occurred - %s", e) if isinstance(e, HTTPException): raise ProxyException( message=getattr(e, "message", str(e.detail)), @@ -853,7 +853,7 @@ async def get_file_content( await proxy_logging_obj.post_call_failure_hook( user_api_key_dict=user_api_key_dict, original_exception=e, request_data=data ) - verbose_proxy_logger.exception("litellm.proxy.proxy_server.retrieve_file_content(): Exception occured - %s", e) + verbose_proxy_logger.exception("litellm.proxy.proxy_server.retrieve_file_content(): Exception occurred - %s", e) verbose_proxy_logger.debug(traceback.format_exc()) if isinstance(e, HTTPException): raise ProxyException( @@ -1047,7 +1047,7 @@ async def get_file( await proxy_logging_obj.post_call_failure_hook( user_api_key_dict=user_api_key_dict, original_exception=e, request_data=data ) - verbose_proxy_logger.error("litellm.proxy.proxy_server.retrieve_file(): Exception occured - %s", e) + verbose_proxy_logger.error("litellm.proxy.proxy_server.retrieve_file(): Exception occurred - %s", e) verbose_proxy_logger.debug(traceback.format_exc()) if isinstance(e, HTTPException): raise ProxyException( @@ -1260,7 +1260,7 @@ async def delete_file( await proxy_logging_obj.post_call_failure_hook( user_api_key_dict=user_api_key_dict, original_exception=e, request_data=data ) - verbose_proxy_logger.exception("litellm.proxy.proxy_server.delete_file(): Exception occured - %s", e) + verbose_proxy_logger.exception("litellm.proxy.proxy_server.delete_file(): Exception occurred - %s", e) if isinstance(e, HTTPException): raise ProxyException( message=getattr(e, "message", str(e.detail)), @@ -1449,7 +1449,7 @@ async def list_files( await proxy_logging_obj.post_call_failure_hook( user_api_key_dict=user_api_key_dict, original_exception=e, request_data=data ) - verbose_proxy_logger.error("litellm.proxy.proxy_server.list_files(): Exception occured - %s", e) + verbose_proxy_logger.error("litellm.proxy.proxy_server.list_files(): Exception occurred - %s", e) verbose_proxy_logger.debug(traceback.format_exc()) if isinstance(e, HTTPException): raise ProxyException( diff --git a/litellm/proxy/pass_through_endpoints/pass_through_endpoints.py b/litellm/proxy/pass_through_endpoints/pass_through_endpoints.py index 8a526fcd6cb..470a8eac9e3 100644 --- a/litellm/proxy/pass_through_endpoints/pass_through_endpoints.py +++ b/litellm/proxy/pass_through_endpoints/pass_through_endpoints.py @@ -294,7 +294,7 @@ async def chat_completion_pass_through_endpoint( await proxy_logging_obj.post_call_failure_hook( user_api_key_dict=user_api_key_dict, original_exception=e, request_data=data ) - verbose_proxy_logger.exception("litellm.proxy.proxy_server.completion(): Exception occured - %s", e) + verbose_proxy_logger.exception("litellm.proxy.proxy_server.completion(): Exception occurred - %s", e) error_msg: Final = f"{e}" raise ProxyException( message=getattr(e, "message", error_msg), @@ -1505,7 +1505,7 @@ async def pass_through_request( ) else: verbose_proxy_logger.exception( - "litellm.proxy.proxy_server.pass_through_endpoint(): Exception occured - %s", e + "litellm.proxy.proxy_server.pass_through_endpoint(): Exception occurred - %s", e ) ######################################################### diff --git a/litellm/proxy/proxy_server.py b/litellm/proxy/proxy_server.py index 90daaaeae6b..e7f44ffbc83 100644 --- a/litellm/proxy/proxy_server.py +++ b/litellm/proxy/proxy_server.py @@ -7323,7 +7323,7 @@ async def async_assistants_data_generator(response, user_api_key_dict: UserAPIKe yield f"data: {done_message}\n\n" except Exception as e: verbose_proxy_logger.exception( - "litellm.proxy.proxy_server.async_assistants_data_generator(): Exception occured - %s", e + "litellm.proxy.proxy_server.async_assistants_data_generator(): Exception occurred - %s", e ) await proxy_logging_obj.post_call_failure_hook( user_api_key_dict=user_api_key_dict, @@ -7803,7 +7803,7 @@ async def async_data_generator( client_disconnected = True raise except Exception as e: - verbose_proxy_logger.exception("litellm.proxy.proxy_server.async_data_generator(): Exception occured - %s", e) + verbose_proxy_logger.exception("litellm.proxy.proxy_server.async_data_generator(): Exception occurred - %s", e) await proxy_logging_obj.post_call_failure_hook( user_api_key_dict=user_api_key_dict, original_exception=e, @@ -9605,7 +9605,7 @@ async def completion( await proxy_logging_obj.post_call_failure_hook( user_api_key_dict=user_api_key_dict, original_exception=e, request_data=data ) - verbose_proxy_logger.exception("litellm.proxy.proxy_server.completion(): Exception occured - %s", e) + verbose_proxy_logger.exception("litellm.proxy.proxy_server.completion(): Exception occurred - %s", e) error_msg: Final = f"{e}" raise ProxyException( message=getattr(e, "message", error_msg), @@ -9844,7 +9844,7 @@ async def moderations( await proxy_logging_obj.post_call_failure_hook( user_api_key_dict=user_api_key_dict, original_exception=e, request_data=data ) - verbose_proxy_logger.exception("litellm.proxy.proxy_server.moderations(): Exception occured - %s", e) + verbose_proxy_logger.exception("litellm.proxy.proxy_server.moderations(): Exception occurred - %s", e) if isinstance(e, HTTPException): raise ProxyException( message=getattr(e, "message", str(e)), @@ -9990,7 +9990,7 @@ async def audio_speech( original_exception=e, request_data=data, ) - verbose_proxy_logger.error("litellm.proxy.proxy_server.audio_speech(): Exception occured - %s", e) + verbose_proxy_logger.error("litellm.proxy.proxy_server.audio_speech(): Exception occurred - %s", e) verbose_proxy_logger.debug(traceback.format_exc()) raise e @@ -10132,7 +10132,7 @@ async def audio_transcriptions( await proxy_logging_obj.post_call_failure_hook( user_api_key_dict=user_api_key_dict, original_exception=e, request_data=data ) - verbose_proxy_logger.exception("litellm.proxy.proxy_server.audio_transcription(): Exception occured - %s", e) + verbose_proxy_logger.exception("litellm.proxy.proxy_server.audio_transcription(): Exception occurred - %s", e) if isinstance(e, HTTPException): raise ProxyException( message=getattr(e, "message", str(e.detail)), @@ -10418,7 +10418,7 @@ async def get_assistants( await proxy_logging_obj.post_call_failure_hook( user_api_key_dict=user_api_key_dict, original_exception=e, request_data=data ) - verbose_proxy_logger.error("litellm.proxy.proxy_server.get_assistants(): Exception occured - %s", e) + verbose_proxy_logger.error("litellm.proxy.proxy_server.get_assistants(): Exception occurred - %s", e) verbose_proxy_logger.debug(traceback.format_exc()) if isinstance(e, HTTPException): raise ProxyException( @@ -10509,7 +10509,7 @@ async def create_assistant( await proxy_logging_obj.post_call_failure_hook( user_api_key_dict=user_api_key_dict, original_exception=e, request_data=data ) - verbose_proxy_logger.error("litellm.proxy.proxy_server.create_assistant(): Exception occured - %s", e) + verbose_proxy_logger.error("litellm.proxy.proxy_server.create_assistant(): Exception occurred - %s", e) verbose_proxy_logger.debug(traceback.format_exc()) if isinstance(e, HTTPException): raise ProxyException( @@ -10598,7 +10598,7 @@ async def delete_assistant( await proxy_logging_obj.post_call_failure_hook( user_api_key_dict=user_api_key_dict, original_exception=e, request_data=data ) - verbose_proxy_logger.error("litellm.proxy.proxy_server.delete_assistant(): Exception occured - %s", e) + verbose_proxy_logger.error("litellm.proxy.proxy_server.delete_assistant(): Exception occurred - %s", e) verbose_proxy_logger.debug(traceback.format_exc()) if isinstance(e, HTTPException): raise ProxyException( @@ -10687,7 +10687,7 @@ async def create_threads( await proxy_logging_obj.post_call_failure_hook( user_api_key_dict=user_api_key_dict, original_exception=e, request_data=data ) - verbose_proxy_logger.error("litellm.proxy.proxy_server.create_threads(): Exception occured - %s", e) + verbose_proxy_logger.error("litellm.proxy.proxy_server.create_threads(): Exception occurred - %s", e) verbose_proxy_logger.debug(traceback.format_exc()) if isinstance(e, HTTPException): raise ProxyException( @@ -10774,7 +10774,7 @@ async def get_thread( await proxy_logging_obj.post_call_failure_hook( user_api_key_dict=user_api_key_dict, original_exception=e, request_data=data ) - verbose_proxy_logger.error("litellm.proxy.proxy_server.get_thread(): Exception occured - %s", e) + verbose_proxy_logger.error("litellm.proxy.proxy_server.get_thread(): Exception occurred - %s", e) verbose_proxy_logger.debug(traceback.format_exc()) if isinstance(e, HTTPException): raise ProxyException( @@ -10865,7 +10865,7 @@ async def add_messages( await proxy_logging_obj.post_call_failure_hook( user_api_key_dict=user_api_key_dict, original_exception=e, request_data=data ) - verbose_proxy_logger.error("litellm.proxy.proxy_server.add_messages(): Exception occured - %s", e) + verbose_proxy_logger.error("litellm.proxy.proxy_server.add_messages(): Exception occurred - %s", e) verbose_proxy_logger.debug(traceback.format_exc()) if isinstance(e, HTTPException): raise ProxyException( @@ -10952,7 +10952,7 @@ async def get_messages( await proxy_logging_obj.post_call_failure_hook( user_api_key_dict=user_api_key_dict, original_exception=e, request_data=data ) - verbose_proxy_logger.error("litellm.proxy.proxy_server.get_messages(): Exception occured - %s", e) + verbose_proxy_logger.error("litellm.proxy.proxy_server.get_messages(): Exception occurred - %s", e) verbose_proxy_logger.debug(traceback.format_exc()) if isinstance(e, HTTPException): raise ProxyException( @@ -11053,7 +11053,7 @@ async def run_thread( await proxy_logging_obj.post_call_failure_hook( user_api_key_dict=user_api_key_dict, original_exception=e, request_data=data ) - verbose_proxy_logger.error("litellm.proxy.proxy_server.run_thread(): Exception occured - %s", e) + verbose_proxy_logger.error("litellm.proxy.proxy_server.run_thread(): Exception occurred - %s", e) verbose_proxy_logger.debug(traceback.format_exc()) if isinstance(e, HTTPException): raise ProxyException( @@ -11243,7 +11243,7 @@ async def token_counter(request: TokenCountRequest, call_endpoint: bool = False) ) except Exception: verbose_proxy_logger.exception( - "litellm.proxy.proxy_server.token_counter(): Exception occured while getting deployment" + "litellm.proxy.proxy_server.token_counter(): Exception occurred while getting deployment" ) if deployment is not None: litellm_model_name = deployment.get("litellm_params", {}).get("model") @@ -14993,7 +14993,7 @@ async def update_config( return {"message": "Config updated successfully"} except Exception as e: - verbose_proxy_logger.error("litellm.proxy.proxy_server.update_config(): Exception occured - %s", e) + verbose_proxy_logger.error("litellm.proxy.proxy_server.update_config(): Exception occurred - %s", e) verbose_proxy_logger.debug(traceback.format_exc()) if isinstance(e, HTTPException): raise ProxyException( @@ -15950,7 +15950,7 @@ async def get_config( "available_callbacks": all_available_callbacks, } except Exception as e: - verbose_proxy_logger.exception("litellm.proxy.proxy_server.get_config(): Exception occured - %s", e) + verbose_proxy_logger.exception("litellm.proxy.proxy_server.get_config(): Exception occurred - %s", e) if isinstance(e, HTTPException): raise ProxyException( message=getattr(e, "detail", f"Authentication Error({e})"), diff --git a/litellm/proxy/rerank_endpoints/endpoints.py b/litellm/proxy/rerank_endpoints/endpoints.py index fab97f0bdab..dd0f593b4d9 100644 --- a/litellm/proxy/rerank_endpoints/endpoints.py +++ b/litellm/proxy/rerank_endpoints/endpoints.py @@ -104,7 +104,7 @@ async def rerank( await proxy_logging_obj.post_call_failure_hook( user_api_key_dict=user_api_key_dict, original_exception=e, request_data=data ) - verbose_proxy_logger.error("litellm.proxy.proxy_server.rerank(): Exception occured - %s", e) + verbose_proxy_logger.error("litellm.proxy.proxy_server.rerank(): Exception occurred - %s", e) if isinstance(e, HTTPException): raise ProxyException( message=getattr(e, "message", str(e)), diff --git a/litellm/proxy/spend_tracking/spend_management_endpoints.py b/litellm/proxy/spend_tracking/spend_management_endpoints.py index 8fb5570965b..74f4a7c2fee 100644 --- a/litellm/proxy/spend_tracking/spend_management_endpoints.py +++ b/litellm/proxy/spend_tracking/spend_management_endpoints.py @@ -3748,7 +3748,7 @@ async def provider_budgets() -> ProviderBudgetResponse: provider_budget_response_dict[_provider] = provider_budget_response_object return ProviderBudgetResponse(providers=provider_budget_response_dict) except Exception as e: - verbose_proxy_logger.exception("/provider/budgets: Exception occured - %s", e) + verbose_proxy_logger.exception("/provider/budgets: Exception occurred - %s", e) raise handle_exception_on_proxy(e) diff --git a/litellm/router.py b/litellm/router.py index feaf69a44ae..30af7f3b85a 100644 --- a/litellm/router.py +++ b/litellm/router.py @@ -1996,19 +1996,19 @@ class Router: @overload async def acompletion( self, model: str, messages: list[AllMessageValues], stream: Literal[True], **kwargs - ) -> CustomStreamWrapper: + ) -> CustomStreamWrapper: ... @overload async def acompletion( self, model: str, messages: list[AllMessageValues], stream: Literal[False] = False, **kwargs - ) -> ModelResponse: + ) -> ModelResponse: ... @overload async def acompletion( self, model: str, messages: list[AllMessageValues], stream: Literal[True, False] = False, **kwargs - ) -> CustomStreamWrapper | ModelResponse: + ) -> CustomStreamWrapper | ModelResponse: ... # fmt: on @@ -3473,13 +3473,13 @@ class Router: @overload async def schedule_acompletion( self, model: str, messages: list[AllMessageValues], priority: int, stream: Literal[False] = False, **kwargs - ) -> ModelResponse: + ) -> ModelResponse: ... @overload async def schedule_acompletion( self, model: str, messages: list[AllMessageValues], priority: int, stream: Literal[True], **kwargs - ) -> CustomStreamWrapper: + ) -> CustomStreamWrapper: ... # fmt: on @@ -7002,7 +7002,7 @@ class Router: except Exception as e: verbose_router_logger.debug( - "litellm.router.Router::deployment_callback_on_success(): Exception occured - %s", e + "litellm.router.Router::deployment_callback_on_success(): Exception occurred - %s", e ) def sync_deployment_callback_on_success( diff --git a/litellm/router_strategy/lowest_cost.py b/litellm/router_strategy/lowest_cost.py index b927df0c438..06bec5bbe6a 100644 --- a/litellm/router_strategy/lowest_cost.py +++ b/litellm/router_strategy/lowest_cost.py @@ -92,7 +92,7 @@ class LowestCostLoggingHandler(CustomLogger): self.logged_success += 1 except Exception as e: verbose_logger.exception( - "litellm.router_strategy.lowest_cost.py::log_success_event(): Exception occured - %s", e + "litellm.router_strategy.lowest_cost.py::log_success_event(): Exception occurred - %s", e ) async def async_log_success_event(self, kwargs, response_obj, start_time, end_time): @@ -171,7 +171,7 @@ class LowestCostLoggingHandler(CustomLogger): self.logged_success += 1 except Exception as e: verbose_logger.exception( - "litellm.proxy.hooks.prompt_injection_detection.py::async_pre_call_hook(): Exception occured - %s", e + "litellm.proxy.hooks.prompt_injection_detection.py::async_pre_call_hook(): Exception occurred - %s", e ) async def async_get_available_deployments( diff --git a/litellm/router_strategy/lowest_latency.py b/litellm/router_strategy/lowest_latency.py index eebe81ebba1..a4342a6520f 100644 --- a/litellm/router_strategy/lowest_latency.py +++ b/litellm/router_strategy/lowest_latency.py @@ -160,7 +160,7 @@ class LowestLatencyLoggingHandler(CustomLogger): self.logged_success += 1 except Exception as e: verbose_logger.exception( - "litellm.proxy.hooks.prompt_injection_detection.py::async_pre_call_hook(): Exception occured - %s", e + "litellm.proxy.hooks.prompt_injection_detection.py::async_pre_call_hook(): Exception occurred - %s", e ) async def async_log_failure_event(self, kwargs, response_obj, start_time, end_time): @@ -217,7 +217,7 @@ class LowestLatencyLoggingHandler(CustomLogger): return except Exception as e: verbose_logger.exception( - "litellm.proxy.hooks.prompt_injection_detection.py::async_pre_call_hook(): Exception occured - %s", e + "litellm.proxy.hooks.prompt_injection_detection.py::async_pre_call_hook(): Exception occurred - %s", e ) async def async_log_success_event(self, kwargs, response_obj, start_time, end_time): @@ -350,7 +350,7 @@ class LowestLatencyLoggingHandler(CustomLogger): self.logged_success += 1 except Exception as e: verbose_logger.exception( - "litellm.router_strategy.lowest_latency.py::async_log_success_event(): Exception occured - %s", e + "litellm.router_strategy.lowest_latency.py::async_log_success_event(): Exception occurred - %s", e ) def _get_available_deployments( diff --git a/litellm/router_strategy/lowest_tpm_rpm.py b/litellm/router_strategy/lowest_tpm_rpm.py index 31c4b1d7e3f..ee527b1e935 100644 --- a/litellm/router_strategy/lowest_tpm_rpm.py +++ b/litellm/router_strategy/lowest_tpm_rpm.py @@ -74,7 +74,7 @@ class LowestTPMLoggingHandler(CustomLogger): self.logged_success += 1 except Exception as e: verbose_router_logger.error( - "litellm.router_strategy.lowest_tpm_rpm.py::async_log_success_event(): Exception occured - %s", e + "litellm.router_strategy.lowest_tpm_rpm.py::async_log_success_event(): Exception occurred - %s", e ) verbose_router_logger.debug(traceback.format_exc()) @@ -136,7 +136,7 @@ class LowestTPMLoggingHandler(CustomLogger): self.logged_success += 1 except Exception as e: verbose_router_logger.exception( - "litellm.router_strategy.lowest_tpm_rpm.py::async_log_success_event(): Exception occured - %s", e + "litellm.router_strategy.lowest_tpm_rpm.py::async_log_success_event(): Exception occurred - %s", e ) verbose_router_logger.debug(traceback.format_exc()) diff --git a/litellm/router_strategy/lowest_tpm_rpm_v2.py b/litellm/router_strategy/lowest_tpm_rpm_v2.py index 6deba5aa1cf..bbb8c3cad82 100644 --- a/litellm/router_strategy/lowest_tpm_rpm_v2.py +++ b/litellm/router_strategy/lowest_tpm_rpm_v2.py @@ -245,7 +245,7 @@ class LowestTPMLoggingHandler_v2(BaseRoutingStrategy, CustomLogger): self.logged_success += 1 except Exception as e: verbose_logger.exception( - "litellm.proxy.hooks.lowest_tpm_rpm_v2.py::log_success_event(): Exception occured - %s", e + "litellm.proxy.hooks.lowest_tpm_rpm_v2.py::log_success_event(): Exception occurred - %s", e ) async def async_log_success_event(self, kwargs, response_obj, start_time, end_time): @@ -289,7 +289,7 @@ class LowestTPMLoggingHandler_v2(BaseRoutingStrategy, CustomLogger): self.logged_success += 1 except Exception as e: verbose_logger.exception( - "litellm.proxy.hooks.lowest_tpm_rpm_v2.py::async_log_success_event(): Exception occured - %s", e + "litellm.proxy.hooks.lowest_tpm_rpm_v2.py::async_log_success_event(): Exception occurred - %s", e ) def _return_potential_deployments( diff --git a/litellm/types/llms/openai.py b/litellm/types/llms/openai.py index da0592e6bb2..882a1b5db40 100644 --- a/litellm/types/llms/openai.py +++ b/litellm/types/llms/openai.py @@ -157,7 +157,7 @@ class ToolResourcesFileSearchVectorStore(TypedDict, total=False): This can be useful for storing additional information about the vector store in a structured format. Keys can be a maximum of 64 characters long and values can - be a maxium of 512 characters long. + be a maximum of 512 characters long. """ @@ -256,7 +256,7 @@ class Thread(BaseModel): This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be - a maxium of 512 characters long. + a maximum of 512 characters long. """ object: Literal["thread"] @@ -1821,7 +1821,7 @@ class OpenAIRealtimeStreamSession(TypedDict, total=False): turn_detection: object """ - Configuration for turn detection, ether Server VAD or Semantic VAD. This can be set to null to turn off, in which case the client must manually trigger model response. Server VAD means that the model will detect the start and end of speech based on audio volume and respond at the end of user speech. Semantic VAD is more advanced and uses a turn detection model (in conjuction with VAD) to semantically estimate whether the user has finished speaking, then dynamically sets a timeout based on this probability. For example, if user audio trails off with "uhhm", the model will score a low probability of turn end and wait longer for the user to continue speaking. This can be useful for more natural conversations, but may have a higher latency. + Configuration for turn detection, ether Server VAD or Semantic VAD. This can be set to null to turn off, in which case the client must manually trigger model response. Server VAD means that the model will detect the start and end of speech based on audio volume and respond at the end of user speech. Semantic VAD is more advanced and uses a turn detection model (in conjunction with VAD) to semantically estimate whether the user has finished speaking, then dynamically sets a timeout based on this probability. For example, if user audio trails off with "uhhm", the model will score a low probability of turn end and wait longer for the user to continue speaking. This can be useful for more natural conversations, but may have a higher latency. """ voice: str diff --git a/litellm/utils.py b/litellm/utils.py index 911de83b785..c6ec41992d0 100644 --- a/litellm/utils.py +++ b/litellm/utils.py @@ -5780,8 +5780,8 @@ def function_to_dict(input_function) -> dict: Returns ------- - dictionnary - A dictionnary to add to the list passed to `functions` parameter of `litellm.completion` + dictionary + A dictionary to add to the list passed to `functions` parameter of `litellm.completion` """ # Get function name and docstring try: diff --git a/tests/llm_translation/test_triton.py b/tests/llm_translation/test_triton.py index 21887e8d848..ff16098325e 100644 --- a/tests/llm_translation/test_triton.py +++ b/tests/llm_translation/test_triton.py @@ -35,7 +35,7 @@ def test_split_embedding_by_shape_passes(): ) assert split_output_data == [[1, 2, 3], [4, 5, 6]] except Exception as e: - pytest.fail(f"An exception occured: {e}") + pytest.fail(f"An exception occurred: {e}") def test_split_embedding_by_shape_fails_with_shape_value_error(): diff --git a/tests/local_testing/test_completion_cost.py b/tests/local_testing/test_completion_cost.py index cf0c645615d..497880ef548 100644 --- a/tests/local_testing/test_completion_cost.py +++ b/tests/local_testing/test_completion_cost.py @@ -736,7 +736,7 @@ def test_vertex_ai_embedding_completion_cost(caplog): for item in captured_logs: print("\nitem:{}\n".format(item)) if ( - "litellm.litellm_core_utils.llm_cost_calc.google.cost_per_character(): Exception occured " + "litellm.litellm_core_utils.llm_cost_calc.google.cost_per_character(): Exception occurred " in item ): raise Exception("Error log raised for calculating embedding cost") diff --git a/tests/local_testing/test_exceptions.py b/tests/local_testing/test_exceptions.py index e02d9e21171..7a711481822 100644 --- a/tests/local_testing/test_exceptions.py +++ b/tests/local_testing/test_exceptions.py @@ -1047,7 +1047,7 @@ async def test_exception_with_headers(sync_mode, provider, model, call_type, str but Azure says to retry in at most 9s ``` - {"message": "litellm.proxy.proxy_server.embeddings(): Exception occured - No deployments available for selected model, Try again in 60 seconds. Passed model=text-embedding-ada-002. pre-call-checks=False, allowed_model_region=n/a, cooldown_list=[('b49cbc9314273db7181fe69b1b19993f04efb88f2c1819947c538bac08097e4c', {'Exception Received': 'litellm.RateLimitError: AzureException RateLimitError - Requests to the Embeddings_Create Operation under Azure OpenAI API version 2023-09-01-preview have exceeded call rate limit of your current OpenAI S0 pricing tier. Please retry after 9 seconds. Please go here: https://aka.ms/oai/quotaincrease if you would like to further increase the default rate limit.', 'Status Code': '429'})]", "level": "ERROR", "timestamp": "2024-08-22T03:25:36.900476"} + {"message": "litellm.proxy.proxy_server.embeddings(): Exception occurred - No deployments available for selected model, Try again in 60 seconds. Passed model=text-embedding-ada-002. pre-call-checks=False, allowed_model_region=n/a, cooldown_list=[('b49cbc9314273db7181fe69b1b19993f04efb88f2c1819947c538bac08097e4c', {'Exception Received': 'litellm.RateLimitError: AzureException RateLimitError - Requests to the Embeddings_Create Operation under Azure OpenAI API version 2023-09-01-preview have exceeded call rate limit of your current OpenAI S0 pricing tier. Please retry after 9 seconds. Please go here: https://aka.ms/oai/quotaincrease if you would like to further increase the default rate limit.', 'Status Code': '429'})]", "level": "ERROR", "timestamp": "2024-08-22T03:25:36.900476"} ``` """ print(f"Received args: {locals()}") @@ -1224,7 +1224,7 @@ async def test_exception_with_headers_httpx( but Azure says to retry in at most 9s ``` - {"message": "litellm.proxy.proxy_server.embeddings(): Exception occured - No deployments available for selected model, Try again in 60 seconds. Passed model=text-embedding-ada-002. pre-call-checks=False, allowed_model_region=n/a, cooldown_list=[('b49cbc9314273db7181fe69b1b19993f04efb88f2c1819947c538bac08097e4c', {'Exception Received': 'litellm.RateLimitError: AzureException RateLimitError - Requests to the Embeddings_Create Operation under Azure OpenAI API version 2023-09-01-preview have exceeded call rate limit of your current OpenAI S0 pricing tier. Please retry after 9 seconds. Please go here: https://aka.ms/oai/quotaincrease if you would like to further increase the default rate limit.', 'Status Code': '429'})]", "level": "ERROR", "timestamp": "2024-08-22T03:25:36.900476"} + {"message": "litellm.proxy.proxy_server.embeddings(): Exception occurred - No deployments available for selected model, Try again in 60 seconds. Passed model=text-embedding-ada-002. pre-call-checks=False, allowed_model_region=n/a, cooldown_list=[('b49cbc9314273db7181fe69b1b19993f04efb88f2c1819947c538bac08097e4c', {'Exception Received': 'litellm.RateLimitError: AzureException RateLimitError - Requests to the Embeddings_Create Operation under Azure OpenAI API version 2023-09-01-preview have exceeded call rate limit of your current OpenAI S0 pricing tier. Please retry after 9 seconds. Please go here: https://aka.ms/oai/quotaincrease if you would like to further increase the default rate limit.', 'Status Code': '429'})]", "level": "ERROR", "timestamp": "2024-08-22T03:25:36.900476"} ``` """ print(f"Received args: {locals()}") diff --git a/tests/local_testing/test_litellm_max_budget.py b/tests/local_testing/test_litellm_max_budget.py index 9fcddfe32da..cc3875c0b9f 100644 --- a/tests/local_testing/test_litellm_max_budget.py +++ b/tests/local_testing/test_litellm_max_budget.py @@ -26,4 +26,4 @@ # except BudgetExceededError as e: # pass # except Exception as e: -# pytest.fail(f"An error occured: {str(e)}") +# pytest.fail(f"An error occurred: {str(e)}") diff --git a/tests/local_testing/test_prometheus_service.py b/tests/local_testing/test_prometheus_service.py index b97fcd096b3..94f9eb5e21a 100644 --- a/tests/local_testing/test_prometheus_service.py +++ b/tests/local_testing/test_prometheus_service.py @@ -139,7 +139,7 @@ async def test_router_with_caching(): assert sl.prometheusServicesLogger.mock_testing_success_calls > 0 except Exception as e: - pytest.fail(f"An exception occured - {str(e)}") + pytest.fail(f"An exception occurred - {str(e)}") @pytest.mark.asyncio diff --git a/tests/local_testing/test_router.py b/tests/local_testing/test_router.py index 2ee1aee9710..b5f730bd055 100644 --- a/tests/local_testing/test_router.py +++ b/tests/local_testing/test_router.py @@ -1985,7 +1985,7 @@ def test_router_dynamic_cooldown_correct_retry_after_time(): but Azure says to retry in at most 9s ``` - {"message": "litellm.proxy.proxy_server.embeddings(): Exception occured - No deployments available for selected model, Try again in 60 seconds. Passed model=text-embedding-ada-002. pre-call-checks=False, allowed_model_region=n/a, cooldown_list=[('b49cbc9314273db7181fe69b1b19993f04efb88f2c1819947c538bac08097e4c', {'Exception Received': 'litellm.RateLimitError: AzureException RateLimitError - Requests to the Embeddings_Create Operation under Azure OpenAI API version 2023-09-01-preview have exceeded call rate limit of your current OpenAI S0 pricing tier. Please retry after 9 seconds. Please go here: https://aka.ms/oai/quotaincrease if you would like to further increase the default rate limit.', 'Status Code': '429'})]", "level": "ERROR", "timestamp": "2024-08-22T03:25:36.900476"} + {"message": "litellm.proxy.proxy_server.embeddings(): Exception occurred - No deployments available for selected model, Try again in 60 seconds. Passed model=text-embedding-ada-002. pre-call-checks=False, allowed_model_region=n/a, cooldown_list=[('b49cbc9314273db7181fe69b1b19993f04efb88f2c1819947c538bac08097e4c', {'Exception Received': 'litellm.RateLimitError: AzureException RateLimitError - Requests to the Embeddings_Create Operation under Azure OpenAI API version 2023-09-01-preview have exceeded call rate limit of your current OpenAI S0 pricing tier. Please retry after 9 seconds. Please go here: https://aka.ms/oai/quotaincrease if you would like to further increase the default rate limit.', 'Status Code': '429'})]", "level": "ERROR", "timestamp": "2024-08-22T03:25:36.900476"} ``` """ router = Router( diff --git a/tests/test_litellm/litellm_core_utils/test_token_counter.py b/tests/test_litellm/litellm_core_utils/test_token_counter.py index 71e686563a5..8d9046012b8 100644 --- a/tests/test_litellm/litellm_core_utils/test_token_counter.py +++ b/tests/test_litellm/litellm_core_utils/test_token_counter.py @@ -274,7 +274,7 @@ def test_tokenizers(): print("test tokenizer: It worked!") except Exception as e: - pytest.fail(f"An exception occured: {e}") + pytest.fail(f"An exception occurred: {e}") # test_tokenizers() @@ -308,7 +308,7 @@ def test_encoding_and_decoding(): assert llama2_text == sample_text except Exception as e: - pytest.fail(f"An exception occured: {e}\n{traceback.format_exc()}") + pytest.fail(f"An exception occurred: {e}\n{traceback.format_exc()}") # test_encoding_and_decoding()