Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 5161f62

Browse files
stainless-app[bot]stainless-bot
authored andcommittedJul 18, 2024
chore(docs): document how to do per-request http client customization (#603)
1 parent fda45a6 commit 5161f62

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed
 

‎README.md

+6
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,12 @@ client = Anthropic(
508508
)
509509
```
510510

511+
You can also customize the client on a per-request basis by using `with_options()`:
512+
513+
```python
514+
client.with_options(http_client=DefaultHttpxClient(...))
515+
```
516+
511517
### Managing HTTP resources
512518

513519
By default the library closes underlying HTTP connections whenever the client is [garbage collected](https://docs.python.org/3/reference/datamodel.html#object.__del__). You can manually close the client using the `.close()` method if desired, or with a context manager that closes when exiting.

0 commit comments

Comments
 (0)
Please sign in to comment.