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
SK-2707: make response-object reference informative (types + descriptions)
Replace the flat "Attributes" column with a per-response subsection that
documents each attribute's type and meaning, marks optional attributes with
`| None`, and explains the shared `errors` shape once. Response anchors now
come from the subsection headings (README deep-links still resolve).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@@ -148,30 +148,139 @@ Wrapper for a file passed to `DeidentifyFileRequest`. Provide one of:
148
148
149
149
## Response objects
150
150
151
-
Every vault, token, connection, and Detect operation returns a typed response object. All carry an `errors` attribute that is populated on partial failure (`continue_on_error`).
Every vault, token, connection, and Detect operation returns a typed response object. Each attribute below lists its type and meaning. Types use `| None` to mark attributes that may be absent.
152
+
153
+
> **The `errors` attribute** is common to most responses. It is `list[dict] | None` and is populated only on partial failure (for example when `continue_on_error=True`); it is `None` when there are no errors. Each error dict contains `request_index`, `request_id`, `error`, and `http_code`. The per-class tables below describe only the operation-specific attributes and refer back to this note for `errors`.
print(response.inserted_fields) # list of inserted records (with tokens if return_tokens=True)
171
-
print(response.errors) #populated only on partial failure
158
+
print(response.errors) #None unless there was a partial failure
172
159
```
173
160
174
-
> `DeidentifyTextResponse.entities` is a list of [`EntityInfo`](#entityinfo). `DeidentifyFileResponse.file` is a [`File`](#file) wrapper.
161
+
### `InsertResponse`
162
+
163
+
`skyflow.vault.data` — returned by `vault().insert()`.
164
+
165
+
| Attribute | Type | Description |
166
+
|-----------|------|-------------|
167
+
|`inserted_fields`|`list[dict]`| One entry per inserted record. Each has `skyflow_id`; with `return_tokens=True`, also a token per column; with `continue_on_error=True`, also a `request_index`. |
168
+
|`errors`|`list[dict] \| None`| See the note above. |
169
+
170
+
### `GetResponse`
171
+
172
+
`skyflow.vault.data` — returned by `vault().get()`.
173
+
174
+
| Attribute | Type | Description |
175
+
|-----------|------|-------------|
176
+
|`data`|`list[dict]`| Retrieved records as `field → value` dicts (tokens instead of values when `return_tokens=True`). Defaults to `[]`. |
177
+
|`errors`|`list[dict] \| None`| See the note above. |
178
+
179
+
### `DeleteResponse`
180
+
181
+
`skyflow.vault.data` — returned by `vault().delete()`.
182
+
183
+
| Attribute | Type | Description |
184
+
|-----------|------|-------------|
185
+
|`deleted_ids`|`list[str] \| None`| Skyflow IDs of the deleted records. |
186
+
|`errors`|`list[dict] \| None`| See the note above. |
187
+
188
+
### `UpdateResponse`
189
+
190
+
`skyflow.vault.data` — returned by `vault().update()`.
191
+
192
+
| Attribute | Type | Description |
193
+
|-----------|------|-------------|
194
+
|`updated_field`|`dict`| The updated record: `skyflow_id`, plus a token per updated column when `return_tokens=True`. |
195
+
|`errors`|`list[dict] \| None`| See the note above. |
196
+
197
+
### `QueryResponse`
198
+
199
+
`skyflow.vault.data` — returned by `vault().query()`.
200
+
201
+
| Attribute | Type | Description |
202
+
|-----------|------|-------------|
203
+
|`fields`|`list[dict]`| Matching records. Each record dict also includes a `tokenized_data` map. |
204
+
|`errors`|`list[dict] \| None`| See the note above. |
205
+
206
+
### `FileUploadResponse`
207
+
208
+
`skyflow.vault.data` — returned by `vault().upload_file()`.
209
+
210
+
| Attribute | Type | Description |
211
+
|-----------|------|-------------|
212
+
|`skyflow_id`|`str`| ID of the record the file was attached to (or of the newly created record). |
213
+
|`errors`|`list[dict] \| None`| See the note above. |
214
+
215
+
### `DetokenizeResponse`
216
+
217
+
`skyflow.vault.tokens` — returned by `vault().detokenize()`.
218
+
219
+
| Attribute | Type | Description |
220
+
|-----------|------|-------------|
221
+
|`detokenized_fields`|`list[dict]`| One entry per token, each with `token`, `value` (plaintext or masked), and `type` (the value type). |
222
+
|`errors`|`list[dict] \| None`| See the note above. |
223
+
224
+
### `TokenizeResponse`
225
+
226
+
`skyflow.vault.tokens` — returned by `vault().tokenize()`.
227
+
228
+
| Attribute | Type | Description |
229
+
|-----------|------|-------------|
230
+
|`tokenized_fields`|`list[dict]`| One entry per value, each with its `token`. |
231
+
|`errors`|`list[dict] \| None`| See the note above. |
232
+
233
+
### `InvokeConnectionResponse`
234
+
235
+
`skyflow.vault.connection` — returned by `connection().invoke()`.
236
+
237
+
| Attribute | Type | Description |
238
+
|-----------|------|-------------|
239
+
|`data`|`dict`| The connection's response body. |
240
+
|`metadata`|`dict`| Response metadata (for example `request_id`). Defaults to `{}`. |
241
+
|`errors`|`list[dict] \| None`| See the note above. |
242
+
243
+
### `DeidentifyTextResponse`
244
+
245
+
`skyflow.vault.detect` — returned by `detect().deidentify_text()`.
246
+
247
+
| Attribute | Type | Description |
248
+
|-----------|------|-------------|
249
+
|`processed_text`|`str`| The de-identified text. |
250
+
|`entities`|`list[EntityInfo]`| Detected entities. See [`EntityInfo`](#entityinfo). |
251
+
|`word_count`|`int`| Word count of the input text. |
252
+
|`char_count`|`int`| Character count of the input text. |
253
+
|`errors`|`list \| None`| See the note above. |
254
+
255
+
### `ReidentifyTextResponse`
256
+
257
+
`skyflow.vault.detect` — returned by `detect().reidentify_text()`.
258
+
259
+
| Attribute | Type | Description |
260
+
|-----------|------|-------------|
261
+
|`processed_text`|`str`| The re-identified text. |
262
+
|`errors`|`list \| None`| See the note above. |
263
+
264
+
### `DeidentifyFileResponse`
265
+
266
+
`skyflow.vault.detect` — returned by `detect().deidentify_file()` and `detect().get_detect_run()`. All non-error attributes are optional (default `None`) and are populated based on the file type and processing status. If processing exceeds `wait_time`, only `run_id` and `status` are set; poll with `get_detect_run`.
267
+
268
+
| Attribute | Type | Description |
269
+
|-----------|------|-------------|
270
+
|`file_base64`|`str \| None`| The processed file as a base64 string. |
271
+
|`file`|`File \| None`| The processed file wrapper. See [`File`](#file). |
272
+
|`type`|`str \| None`| MIME type of the processed file. |
273
+
|`extension`|`str \| None`| File extension of the processed file. |
274
+
|`word_count`|`int \| None`| Word count (text-bearing files). |
275
+
|`char_count`|`int \| None`| Character count (text-bearing files). |
276
+
|`size_in_kb`|`float \| None`| Size of the processed file in KB. |
277
+
|`duration_in_seconds`|`float \| None`| Duration in seconds (audio files). |
0 commit comments