mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-07 07:58:09 +00:00
docs: fix some typos
Signed-off-by: John E <jeis4wpi@outlook.com>
This commit is contained in:
parent
ecba48dd7c
commit
bf6af255ec
46 changed files with 116 additions and 116 deletions
|
|
@ -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)
|
||||
)
|
||||
)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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(
|
||||
|
|
|
|||
|
|
@ -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(
|
||||
|
|
|
|||
|
|
@ -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
|
||||
)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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):
|
||||
|
|
|
|||
|
|
@ -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(
|
||||
|
|
|
|||
|
|
@ -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 {}
|
||||
|
|
|
|||
|
|
@ -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},
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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())
|
||||
|
||||
|
|
|
|||
|
|
@ -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())
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
)
|
||||
|
|
|
|||
|
|
@ -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(
|
||||
|
|
|
|||
|
|
@ -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(
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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}"},
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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(
|
||||
|
|
|
|||
|
|
@ -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(
|
||||
|
|
|
|||
|
|
@ -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})"),
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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(
|
||||
|
|
|
|||
|
|
@ -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
|
||||
)
|
||||
|
||||
#########################################################
|
||||
|
|
|
|||
|
|
@ -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})"),
|
||||
|
|
|
|||
|
|
@ -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)),
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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(
|
||||
|
|
|
|||
|
|
@ -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(
|
||||
|
|
|
|||
|
|
@ -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(
|
||||
|
|
|
|||
|
|
@ -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())
|
||||
|
||||
|
|
|
|||
|
|
@ -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(
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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():
|
||||
|
|
|
|||
|
|
@ -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")
|
||||
|
|
|
|||
|
|
@ -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()}")
|
||||
|
|
|
|||
|
|
@ -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)}")
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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(
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue