Skip to content

Missing media_type #2675

@mwildehahn

Description

@mwildehahn

Initial Checks

Description

Creating a new issue with a failing test for this one: #2394.

Failing test is here: 56fc78c. I think this has to do with the _media_type being an attribute ImageUrl gets from FileUrl, but when we serialize, we don't include that property because of this: https://docs.pydantic.dev/latest/concepts/serialization/#subclass-instances-for-fields-of-basemodel-dataclasses-typeddict.

So when we deserialize and try and access _media_type we get the error that the property doesn't exist. I thought this only happened if media_type was missing but I added two tests one without it and expanded the test @DouweM had with it and both fail.

Example Code

Python, Pydantic AI & LLM client version

de000324

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