Skip to content

Commit ad3284d

Browse files
committed
Add file_name parameter to FileUploadFromPath docs
The Python SDK (viam-python-sdk#1195) added an optional file_name parameter to file_upload_from_path(). When provided, it overrides the filename derived from the filepath. https://claude.ai/code/session_01K2JbXAWg8N7NYCG46Y4KnD
1 parent 7569425 commit ad3284d

1 file changed

Lines changed: 18 additions & 22 deletions

File tree

static/include/app/apis/generated/data_sync.md

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Uploaded binary data can be found under the **Images**, **Point clouds**, or **F
2121

2222
**Returns:**
2323

24-
- ([str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)): : The binary data ID of the uploaded data.
24+
- ([str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)): : The binary data ID of the uploaded data.
2525

2626
**Raises:**
2727

@@ -75,12 +75,12 @@ For more information, see the [Python SDK Docs](https://python.viam.dev/autoapi/
7575
```ts {class="line-numbers linkable-line-numbers"}
7676
const binaryDataId = await dataClient.binaryDataCaptureUpload(
7777
binaryData,
78-
'123abc45-1234-5678-90ab-cdef12345678',
79-
'rdk:component:camera',
80-
'my-camera',
81-
'ReadImage',
82-
[new Date('2025-03-19'), new Date('2025-03-19')],
83-
{ mimeType: 'image/jpeg' }
78+
"123abc45-1234-5678-90ab-cdef12345678",
79+
"rdk:component:camera",
80+
"my-camera",
81+
"ReadImage",
82+
[new Date("2025-03-19"), new Date("2025-03-19")],
83+
{ mimeType: "image/jpeg" },
8484
);
8585
```
8686

@@ -167,7 +167,7 @@ Viam enforces a maximum size of 4MB for any single reading for tabular data.
167167

168168
**Returns:**
169169

170-
- ([str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)): : The file ID of the uploaded data.
170+
- ([str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)): : The file ID of the uploaded data.
171171

172172
**Raises:**
173173

@@ -230,21 +230,16 @@ const fileId = await dataClient.tabularDataCaptureUpload(
230230
[
231231
{
232232
readings: {
233-
timestamp: '2025-03-26T10:00:00Z',
233+
timestamp: "2025-03-26T10:00:00Z",
234234
value: 10,
235235
},
236236
},
237237
],
238-
'123abc45-1234-5678-90ab-cdef12345678',
239-
'rdk:component:sensor',
240-
'my-sensor',
241-
'Readings',
242-
[
243-
[
244-
new Date('2025-03-26T10:00:00Z'),
245-
new Date('2025-03-26T10:00:00Z'),
246-
],
247-
]
238+
"123abc45-1234-5678-90ab-cdef12345678",
239+
"rdk:component:sensor",
240+
"my-sensor",
241+
"Readings",
242+
[[new Date("2025-03-26T10:00:00Z"), new Date("2025-03-26T10:00:00Z")]],
248243
);
249244
```
250245

@@ -337,7 +332,7 @@ All other types of uploaded files can be found under the **Files** subtab of the
337332

338333
**Returns:**
339334

340-
- ([str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)): : Binary data ID of the new file.
335+
- ([str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)): : Binary data ID of the new file.
341336

342337
**Raises:**
343338

@@ -448,10 +443,11 @@ Uploaded files can be found under the **Files** subtab of the [**Data** tab](htt
448443
- `tags` (List[[str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)]) (optional): Optional list of tags to allow for tag-based filtering when retrieving data.
449444
- `dataset_ids` (List[[str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)]) (optional): Optional list of datasets to add the data to.
450445
- `mime_type` ([str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (optional): Optional mime type of the data.
446+
- `file_name` ([str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)) (optional): Optional name of the file. If not provided, the name is derived from the filepath.
451447

452448
**Returns:**
453449

454-
- ([str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)): : Binary data ID of the new file.
450+
- ([str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)): : Binary data ID of the new file.
455451

456452
**Raises:**
457453

@@ -498,7 +494,7 @@ Uploaded streaming data can be found under the [**Data** tab](https://app.viam.c
498494

499495
**Returns:**
500496

501-
- ([str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)): : The binary data ID of the uploaded data.
497+
- ([str](https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str)): : The binary data ID of the uploaded data.
502498

503499
**Raises:**
504500

0 commit comments

Comments
 (0)