mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 11:14:04 +00:00
correct use of healthy / unhealthy
This commit is contained in:
parent
578f9c91af
commit
c133ba25d9
3 changed files with 9 additions and 5 deletions
|
@ -1496,7 +1496,7 @@ async def key_health(
|
|||
Response when logging callbacks are not setup correctly:
|
||||
```json
|
||||
{
|
||||
"key": "healthy",
|
||||
"key": "unhealthy",
|
||||
"logging_callbacks": {
|
||||
"callbacks": [
|
||||
"gcs_bucket"
|
||||
|
@ -1525,6 +1525,10 @@ async def key_health(
|
|||
)
|
||||
health_status["logging_callbacks"] = logging_statuses
|
||||
|
||||
# Check if any logging callback is unhealthy
|
||||
if logging_statuses.get("status") == "unhealthy":
|
||||
health_status["key"] = "unhealthy"
|
||||
|
||||
return KeyHealthResponse(**health_status)
|
||||
|
||||
except Exception as e:
|
||||
|
@ -1591,7 +1595,7 @@ async def test_key_logging(
|
|||
except Exception as e:
|
||||
return LoggingCallbackStatus(
|
||||
callbacks=logging_callbacks,
|
||||
status="error",
|
||||
status="unhealthy",
|
||||
details=f"Logging test failed: {str(e)}",
|
||||
)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue