Add model continuation support (Anthropic pause_turn + OpenAI background mode)
Closed
MA
10mo ago+4364+4364+0123456789012345678901234567890123456789-70-70-01234567890123456789
- Partially addresses #3365
- Closes https://github.com/pydantic/pydantic-ai/issues/2600
Note: This PR adds an expects_continuation field to ModelResponse, which is a schema addition. Old messages without the field deserialize correctly (defaults to False), but messages serialized by this version include the new field.
Pre-Review Checklist
- Any AI generated code has been reviewed line-by-line by the human PR author, who stands by it.
- No breaking changes in accordance with the version policy.
- Linting and type checking pass per
make formatandmake typecheck. - PR title is fit for the release changelog.
Pre-Merge Checklist
- New tests for any fix or new behavior, maintaining 100% coverage.
- Updated documentation for new features and behaviors, including docstrings for API docs.