remove image.data temporarily because llamastack request encoding produces data=null

This commit is contained in:
Yang Yang 2025-03-25 14:02:51 -07:00
parent 77ad120403
commit 8706b08d37
4 changed files with 1 additions and 13 deletions

View file

@ -3911,11 +3911,6 @@
"url": { "url": {
"$ref": "#/components/schemas/URL", "$ref": "#/components/schemas/URL",
"description": "A URL of the image or data URL in the format of data:image/{type};base64,{data}. Note that URL could have length limits." "description": "A URL of the image or data URL in the format of data:image/{type};base64,{data}. Note that URL could have length limits."
},
"data": {
"type": "string",
"contentEncoding": "base64",
"description": "base64 encoded image data as string"
} }
}, },
"additionalProperties": false, "additionalProperties": false,

View file

@ -2702,10 +2702,6 @@ components:
description: >- description: >-
A URL of the image or data URL in the format of data:image/{type};base64,{data}. A URL of the image or data URL in the format of data:image/{type};base64,{data}.
Note that URL could have length limits. Note that URL could have length limits.
data:
type: string
contentEncoding: base64
description: base64 encoded image data as string
additionalProperties: false additionalProperties: false
description: >- description: >-
Image as a base64 encoded string or an URL Image as a base64 encoded string or an URL

View file

@ -28,7 +28,7 @@ class _URLOrData(BaseModel):
url: Optional[URL] = None url: Optional[URL] = None
# data is a base64 encoded string, hint with contentEncoding=base64 # data is a base64 encoded string, hint with contentEncoding=base64
data: Optional[str] = Field(contentEncoding="base64", default=None) # data: Optional[str] = Field(contentEncoding="base64", default=None)
@model_validator(mode="before") @model_validator(mode="before")
@classmethod @classmethod

View file

@ -142,9 +142,6 @@ async def interleaved_content_convert_to_raw(
data = response.content data = response.content
else: else:
raise ValueError("Unsupported URL type") raise ValueError("Unsupported URL type")
elif image.data:
# data is a base64 encoded string, decode it to bytes for RawMediaItem
data = base64.b64decode(image.data)
else: else:
raise ValueError("No data or URL provided") raise ValueError("No data or URL provided")