Skip to content

BinaryContent identifier should be optional #3107

@kousun12

Description

@kousun12

Initial Checks

Description

https://github.com/pydantic/pydantic-ai/pull/2636/files/92a2645fa32945e91da573ae33a201cdfb4b4c9f#r2408265218

As mentioned above, that PR erroneously switched BinaryContent.identifier to non-optional, assuming that the constructor will always set it if it is not provided. This however breaks e.g. ModelMessageAdapter.validate_json from previous versions which exported json objects with identifier=None

Example Code

Python, Pydantic AI & LLM client version

1.0.14

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions