fix health check

This commit is contained in:
Ishaan Jaff 2024-07-19 15:56:35 -07:00
parent 1797021d53
commit 43e5890f77

View file

@ -4798,9 +4798,10 @@ async def ahealth_check(
if isinstance(stack_trace, str): if isinstance(stack_trace, str):
stack_trace = stack_trace[:1000] stack_trace = stack_trace[:1000]
if model not in litellm.model_cost and mode is None: if model not in litellm.model_cost and mode is None:
raise Exception( return {
"Missing `mode`. Set the `mode` for the model - https://docs.litellm.ai/docs/proxy/health#embedding-models" "error": "Missing `mode`. Set the `mode` for the model - https://docs.litellm.ai/docs/proxy/health#embedding-models"
) }
error_to_return = str(e) + " stack trace: " + stack_trace error_to_return = str(e) + " stack trace: " + stack_trace
return {"error": error_to_return} return {"error": error_to_return}