Skip to content

Commit 24c0768

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
chore(docs): document how to do per-request http client customization (#1560)
1 parent e1389bc commit 24c0768

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
@@ -575,6 +575,12 @@ client = OpenAI(
575575
)
576576
```
577577

578+
You can also customize the client on a per-request basis by using `with_options()`:
579+
580+
```python
581+
client.with_options(http_client=DefaultHttpxClient(...))
582+
```
583+
578584
### Managing HTTP resources
579585

580586
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)