Skip to content

Commit 359ef08

Browse files
committed
Add UploadedFile UserContent
This wraps an opaque reference to a provider-specific representation of an uploaded file.
1 parent 2f2c757 commit 359ef08

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

pydantic_ai_slim/pydantic_ai/messages.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,15 @@ def format(self) -> str:
423423
__repr__ = _utils.dataclasses_no_defaults_repr
424424

425425

426-
UserContent: TypeAlias = 'str | ImageUrl | AudioUrl | DocumentUrl | VideoUrl | BinaryContent'
426+
@dataclass(repr=False)
427+
class UploadedFile:
428+
"""File uploaded to the LLM provider."""
429+
430+
file: Any
431+
"""A provider-specific file object, e.g. a file ID or a file URL."""
432+
433+
434+
UserContent: TypeAlias = 'str | ImageUrl | AudioUrl | DocumentUrl | VideoUrl | BinaryContent | UploadedFile'
427435

428436

429437
@dataclass(repr=False)

0 commit comments

Comments
 (0)