From 47066a33b201047fa9c6e0dca541961f30b1e240 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 11 Mar 2025 05:02:29 +0000 Subject: [PATCH] docs: revise readme docs about nested params --- README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/README.md b/README.md index 55c15c5a..84a1c27b 100644 --- a/README.md +++ b/README.md @@ -134,6 +134,25 @@ for datasource in first_page.items: # Remove `await` for non-async usage. ``` +## Nested params + +Nested parameters are dictionaries, typed using `TypedDict`, for example: + +```python +from asktable import Asktable + +client = Asktable() + +response = client.sys.projects.api_keys.create_token( + project_id="project_id", + chat_role={ + "role_id": "1", + "role_variables": {"id": "42"}, + }, +) +print(response.chat_role) +``` + ## File uploads Request parameters that correspond to file uploads can be passed as `bytes`, a [`PathLike`](https://docs.python.org/3/library/os.html#os.PathLike) instance or a tuple of `(filename, contents, media type)`.