mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-07-27 14:38:49 +00:00
update: add validation on non-string type
Signed-off-by: Wen Zhou <wenzhou@redhat.com>
This commit is contained in:
parent
8563c76f88
commit
0b051c037b
2 changed files with 26 additions and 4 deletions
|
@ -26,9 +26,10 @@ class ProviderInfo(BaseModel):
|
|||
def validate_metrics_url(cls, v):
|
||||
if v is None:
|
||||
return None
|
||||
if isinstance(v, str):
|
||||
HttpUrl(v)
|
||||
return v
|
||||
if not isinstance(v, str):
|
||||
raise ValueError("metrics must be a string URL or None")
|
||||
HttpUrl(v)
|
||||
return v
|
||||
|
||||
|
||||
class ListProvidersResponse(BaseModel):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue