datasets

Copy examples from a source dataset into an existing target dataset.

Each copied example gets a new ID and keeps the inputs, outputs, metadata, and source run ID of its source example. Attachments are copied when blob storage is enabled. Copying the same examples twice adds them twice. Requires the datasets:clone permission on both datasets. Returns the ID, dataset ID, creation and modification times, and source run ID of each new example. Without example IDs, a source or target that is not found can return an empty list instead of an error.

post/api/v1/datasets/clone

Request

  • Base URL
    https://api.smith.langchain.com
  • URL
    https://api.smith.langchain.com/api/v1/datasets/clone
  • Auth
    • API key in header X-API-Key
    • or API key in header X-Tenant-Id
    • or HTTP bearer

Request body

target_dataset_idstring uuid required

ID of the dataset in this workspace that receives the copied examples. Its current examples are kept.

source_dataset_idstring uuid required

ID of the dataset in this workspace to copy examples from. It is not modified.

examplesstring[]

IDs of source examples to copy. Defaults to every example in the source version. When IDs are given and nothing is copied, because none match or either dataset is not found, the request fails with 404.

tag_value_idsstring[] nullable

List of resource tag value IDs to attach to the target dataset, up to 100. Requires the datasets:tag_on_create permission.

Response

Successful Response

object[] required

Changes

    • info

      added the non-success response with the status

    • breaking

      the / response's property type changed from object to string for status

    • breaking

      removed the required property // from the response with the status

    • breaking

      removed the required property // from the response with the status

    • breaking

      removed the required property // from the response with the status

    • info

      added the new optional request property