Skip to content

Commit 0be044e

Browse files
committed
Add tenacity utilities/integration
1 parent 0f46928 commit 0be044e

File tree

8 files changed

+1367
-96
lines changed

8 files changed

+1367
-96
lines changed

docs/api/tenacity.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# `pydantic_ai.tenacity`
2+
3+
## Setup
4+
5+
To use the tenacity integration, you need to install the `tenacity` dependency:
6+
7+
```bash
8+
pip install tenacity
9+
```
10+
11+
## Overview
12+
13+
The `pydantic_ai.tenacity` module provides HTTP transport wrappers and wait strategies that leverage the tenacity
14+
library to add convenient retry behavior to HTTP requests. This is particularly useful for handling transient failures
15+
like rate limits, network timeouts, or temporary server errors.
16+
17+
The module includes:
18+
- **Transport Classes**: Wrap existing HTTP transports to add retry functionality
19+
- **Wait Strategies**: Smart waiting that respects HTTP headers like `Retry-After`
20+
21+
For detailed usage examples and patterns, see the [HTTP Request Retries](../retries.md) guide.
22+
23+
::: pydantic_ai.tenacity

0 commit comments

Comments
 (0)