langsmith>=0.3.13
uploadExamplesMultipart
method to upload examples with attachments.
Note that this is a different method from the standard createExamples
method, which currently does not support attachments. Each attachment requires either a Uint8Array
or an ArrayBuffer
as the data type.
Uint8Array
: Useful for handling binary data directly.ArrayBuffer
: Represents fixed-length binary data, which can be converted to Uint8Array
as needed.data
value and specify arg dangerously_allow_filesystem=True
:inputs
and the second must be called attachments
.
inputs
argument is a dictionary that contains the input data for the example, excluding the attachments.attachments
argument is a dictionary that maps the attachment name to a dictionary containing a presigned url, mime_type, and a reader of the bytes content of the file. You can use either the presigned url or the reader to get the file contents. Each value in the attachments dictionary is a dictionary with the following structure:config
argument is used to pass in the attachments to the target function if includeAttachments
is set to true
.
The config
will contain attachments
which is an object mapping the attachment name to an object of the form:
retain
or rename
.attachments
and attachment_operations
fields.+ Example
button in the Examples
tab of the dataset UI. Then upload attachments using the “Upload Files” button:
All attachments
variable to include all available attachments for each example.