add schema type register

This commit is contained in:
Xi Yan 2025-01-14 18:08:30 -08:00
parent 89e3f81520
commit 4f3fd22dd4
3 changed files with 114 additions and 59 deletions

View file

@ -64,11 +64,13 @@ InterleavedContent = register_schema(
)
@json_schema_type
class TextDelta(BaseModel):
type: Literal["text"] = "text"
text: str
@json_schema_type
class ImageDelta(BaseModel):
type: Literal["image"] = "image"
data: bytes