mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-06-27 18:50:41 +00:00
Update URL type to avoid string-ifying and creating complexity
This commit is contained in:
parent
75e72cf2fc
commit
f1d6cb22d7
3 changed files with 18 additions and 12 deletions
|
@ -2893,9 +2893,16 @@
|
|||
]
|
||||
},
|
||||
"URL": {
|
||||
"type": "string",
|
||||
"format": "uri",
|
||||
"pattern": "^(https?://|file://|data:)"
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"uri": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"uri"
|
||||
]
|
||||
},
|
||||
"UserMessage": {
|
||||
"type": "object",
|
||||
|
|
|
@ -3105,9 +3105,13 @@ components:
|
|||
title: A single turn in an interaction with an Agentic System.
|
||||
type: object
|
||||
URL:
|
||||
format: uri
|
||||
pattern: ^(https?://|file://|data:)
|
||||
type: string
|
||||
additionalProperties: false
|
||||
properties:
|
||||
uri:
|
||||
type: string
|
||||
required:
|
||||
- uri
|
||||
type: object
|
||||
UnregisterDatasetRequest:
|
||||
additionalProperties: false
|
||||
properties:
|
||||
|
|
|
@ -11,15 +11,10 @@ from llama_models.schema_utils import json_schema_type, register_schema
|
|||
from pydantic import BaseModel, Field, model_validator
|
||||
|
||||
|
||||
@json_schema_type(
|
||||
schema={"type": "string", "format": "uri", "pattern": "^(https?://|file://|data:)"}
|
||||
)
|
||||
@json_schema_type
|
||||
class URL(BaseModel):
|
||||
uri: str
|
||||
|
||||
def __str__(self) -> str:
|
||||
return self.uri
|
||||
|
||||
|
||||
class _URLOrData(BaseModel):
|
||||
url: Optional[URL] = None
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue