Skip to content

Commit 7273ad1

Browse files
docs(readme): minor updates (#841)
1 parent db6cd76 commit 7273ad1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

README.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,10 @@ We recommend that you always instantiate a client (e.g., with `client = OpenAI()
156156

157157
## Using types
158158

159-
Nested request parameters are [TypedDicts](https://docs.python.org/3/library/typing.html#typing.TypedDict). Responses are [Pydantic models](https://docs.pydantic.dev), which provide helper methods for things like serializing back into JSON ([v1](https://docs.pydantic.dev/1.10/usage/models/), [v2](https://docs.pydantic.dev/latest/usage/serialization/)). To get a dictionary, call `model.model_dump()`.
159+
Nested request parameters are [TypedDicts](https://docs.python.org/3/library/typing.html#typing.TypedDict). Responses are [Pydantic models](https://docs.pydantic.dev), which provide helper methods for things like:
160+
161+
- Serializing back into JSON, `model.model_dump_json(indent=2, exclude_unset=True)`
162+
- Converting to a dictionary, `model.model_dump(exclude_unset=True)`
160163

161164
Typed requests and responses provide autocomplete and documentation within your editor. If you would like to see type errors in VS Code to help catch bugs earlier, set `python.analysis.typeCheckingMode` to `basic`.
162165

0 commit comments

Comments
 (0)