You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+33Lines changed: 33 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -77,6 +77,39 @@ Nested request parameters are [TypedDicts](https://docs.python.org/3/library/typ
77
77
78
78
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`.
79
79
80
+
## Nested params
81
+
82
+
Nested parameters are dictionaries, typed using `TypedDict`, for example:
83
+
84
+
```python
85
+
from brand.dev import BrandDev
86
+
87
+
client = BrandDev()
88
+
89
+
response = client.brand.ai_query(
90
+
data_to_extract=[
91
+
{
92
+
"datapoint_description": "datapoint_description",
93
+
"datapoint_example": "datapoint_example",
94
+
"datapoint_name": "datapoint_name",
95
+
"datapoint_type": "text",
96
+
}
97
+
],
98
+
domain="domain",
99
+
specific_pages={
100
+
"about_us": True,
101
+
"blog": True,
102
+
"careers": True,
103
+
"contact_us": True,
104
+
"faq": True,
105
+
"home_page": True,
106
+
"privacy_policy": True,
107
+
"terms_and_conditions": True,
108
+
},
109
+
)
110
+
print(response.specific_pages)
111
+
```
112
+
80
113
## Handling errors
81
114
82
115
When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `brand.dev.APIConnectionError` is raised.
0 commit comments