-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Initial Checks
- I confirm that I'm using the latest version of Pydantic AI
- I confirm that I searched for my issue in https://github.com/pydantic/pydantic-ai/issues before opening this issue
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 workingSomething isn't working