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
+24Lines changed: 24 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -79,6 +79,30 @@ Nested request parameters are [TypedDicts](https://docs.python.org/3/library/typ
79
79
80
80
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`.
81
81
82
+
## Nested params
83
+
84
+
Nested parameters are dictionaries, typed using `TypedDict`, for example:
85
+
86
+
```python
87
+
from lumaai import LumaAI
88
+
89
+
client = LumaAI()
90
+
91
+
generation = client.generations.create(
92
+
keyframes={
93
+
"frame0": {
94
+
"type": "image",
95
+
"url": "https://example.com/image.jpg",
96
+
},
97
+
"frame1": {
98
+
"id": "123e4567-e89b-12d3-a456-426614174000",
99
+
"type": "generation",
100
+
},
101
+
},
102
+
)
103
+
print(generation.keyframes)
104
+
```
105
+
82
106
## Handling errors
83
107
84
108
When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `lumaai.APIConnectionError` is raised.
0 commit comments