mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-08-03 01:03:59 +00:00
fix serialization pydantic
This commit is contained in:
parent
48df492a44
commit
ca6f204f4d
1 changed files with 2 additions and 1 deletions
|
@ -4,6 +4,7 @@
|
|||
# This source code is licensed under the terms described in the LICENSE file in
|
||||
# the root directory of this source tree.
|
||||
|
||||
import base64
|
||||
from typing import Annotated, List, Literal, Optional, Union
|
||||
|
||||
from llama_models.schema_utils import json_schema_type, register_schema
|
||||
|
@ -28,7 +29,7 @@ class _URLOrData(BaseModel):
|
|||
return {"url": values}
|
||||
|
||||
class Config:
|
||||
json_encoders = {bytes: lambda v: str("binary data")}
|
||||
json_encoders = {bytes: lambda v: base64.b64encode(v).decode("utf-8")}
|
||||
|
||||
|
||||
@json_schema_type
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue