Skip to content

Commit 8a5fa3a

Browse files
authored
Merge branch 'pydantic:main' into qian/dbos-agent
2 parents 5957602 + a2f0eab commit 8a5fa3a

File tree

2 files changed

+47
-5
lines changed

2 files changed

+47
-5
lines changed

docs/changelog.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,16 @@ Pydantic AI is still pre-version 1, so breaking changes will occur, however:
1212
!!! note
1313
Here's a filtered list of the breaking changes for each version to help you upgrade Pydantic AI.
1414

15+
### v0.8.0 (2025-08-26)
16+
17+
See [#2689](https://github.com/pydantic/pydantic-ai/pull/2689) - `AgentStreamEvent` was expanded to be a union of `ModelResponseStreamEvent` and `HandleResponseEvent`, simplifying the `event_stream_handler` function signature. Existing code accepting `AgentStreamEvent | HandleResponseEvent` will continue to work.
18+
19+
### v0.7.6 (2025-08-26)
20+
21+
The following breaking change was inadvertently released in a patch version rather than a minor version:
22+
23+
See [#2670](https://github.com/pydantic/pydantic-ai/pull/2670) - `TenacityTransport` and `AsyncTenacityTransport` now require the use of `pydantic_ai.retries.RetryConfig` (which is just a `TypedDict` containing the kwargs to `tenacity.retry`) instead of `tenacity.Retrying` or `tenacity.AsyncRetrying`.
24+
1525
### v0.7.0 (2025-08-12)
1626

1727
See [#2458](https://github.com/pydantic/pydantic-ai/pull/2458) - `pydantic_ai.models.StreamedResponse` now yields a `FinalResultEvent` along with the existing `PartStartEvent` and `PartDeltaEvent`. If you're using `pydantic_ai.direct.model_request_stream` or `pydantic_ai.direct.model_request_stream_sync`, you may need to update your code to account for this.

pydantic_ai_slim/pydantic_ai/messages.py

Lines changed: 37 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ class FileUrl(ABC):
111111
"""
112112

113113
_media_type: Annotated[str | None, pydantic.Field(alias='media_type', default=None, exclude=True)] = field(
114-
compare=False
114+
compare=False, default=None
115115
)
116116

117117
def __init__(
@@ -163,8 +163,16 @@ def __init__(
163163
vendor_metadata: dict[str, Any] | None = None,
164164
media_type: str | None = None,
165165
kind: Literal['video-url'] = 'video-url',
166+
*,
167+
# Required for inline-snapshot which expects all dataclass `__init__` methods to take all field names as kwargs.
168+
_media_type: str | None = None,
166169
) -> None:
167-
super().__init__(url=url, force_download=force_download, vendor_metadata=vendor_metadata, media_type=media_type)
170+
super().__init__(
171+
url=url,
172+
force_download=force_download,
173+
vendor_metadata=vendor_metadata,
174+
media_type=media_type or _media_type,
175+
)
168176
self.kind = kind
169177

170178
def _infer_media_type(self) -> VideoMediaType:
@@ -226,8 +234,16 @@ def __init__(
226234
vendor_metadata: dict[str, Any] | None = None,
227235
media_type: str | None = None,
228236
kind: Literal['audio-url'] = 'audio-url',
237+
*,
238+
# Required for inline-snapshot which expects all dataclass `__init__` methods to take all field names as kwargs.
239+
_media_type: str | None = None,
229240
) -> None:
230-
super().__init__(url=url, force_download=force_download, vendor_metadata=vendor_metadata, media_type=media_type)
241+
super().__init__(
242+
url=url,
243+
force_download=force_download,
244+
vendor_metadata=vendor_metadata,
245+
media_type=media_type or _media_type,
246+
)
231247
self.kind = kind
232248

233249
def _infer_media_type(self) -> AudioMediaType:
@@ -276,8 +292,16 @@ def __init__(
276292
vendor_metadata: dict[str, Any] | None = None,
277293
media_type: str | None = None,
278294
kind: Literal['image-url'] = 'image-url',
295+
*,
296+
# Required for inline-snapshot which expects all dataclass `__init__` methods to take all field names as kwargs.
297+
_media_type: str | None = None,
279298
) -> None:
280-
super().__init__(url=url, force_download=force_download, vendor_metadata=vendor_metadata, media_type=media_type)
299+
super().__init__(
300+
url=url,
301+
force_download=force_download,
302+
vendor_metadata=vendor_metadata,
303+
media_type=media_type or _media_type,
304+
)
281305
self.kind = kind
282306

283307
def _infer_media_type(self) -> ImageMediaType:
@@ -321,8 +345,16 @@ def __init__(
321345
vendor_metadata: dict[str, Any] | None = None,
322346
media_type: str | None = None,
323347
kind: Literal['document-url'] = 'document-url',
348+
*,
349+
# Required for inline-snapshot which expects all dataclass `__init__` methods to take all field names as kwargs.
350+
_media_type: str | None = None,
324351
) -> None:
325-
super().__init__(url=url, force_download=force_download, vendor_metadata=vendor_metadata, media_type=media_type)
352+
super().__init__(
353+
url=url,
354+
force_download=force_download,
355+
vendor_metadata=vendor_metadata,
356+
media_type=media_type or _media_type,
357+
)
326358
self.kind = kind
327359

328360
def _infer_media_type(self) -> str:

0 commit comments

Comments
 (0)