From b09bfbfd8514a22a33106ccfec4c5349e2d45614 Mon Sep 17 00:00:00 2001 From: Sameer Kankute Date: Thu, 26 Feb 2026 12:18:01 +0530 Subject: [PATCH] Fix : enterprise tests --- litellm/types/integrations/prometheus.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/litellm/types/integrations/prometheus.py b/litellm/types/integrations/prometheus.py index 482b87085dd..2c75276d9ca 100644 --- a/litellm/types/integrations/prometheus.py +++ b/litellm/types/integrations/prometheus.py @@ -3,7 +3,7 @@ from dataclasses import dataclass from enum import Enum from typing import Any, Dict, List, Literal, Optional, Tuple -from pydantic import BaseModel, Field +from pydantic import BaseModel, Field, field_validator from typing_extensions import Annotated import litellm @@ -721,6 +721,13 @@ class UserAPIKeyLabelValues(BaseModel): Optional[str], Field(..., alias=UserAPIKeyLabelNames.STREAM.value) ] = None + @field_validator("stream", mode="before") + @classmethod + def coerce_stream_to_str(cls, v: Any) -> Optional[str]: + if v is None: + return None + return str(v) + class PrometheusMetricsConfig(BaseModel): """Configuration for filtering Prometheus metrics"""