langsmith.client.Client.create_example#

Client.create_example(inputs: Mapping[str, Any], dataset_id: UUID | str | None = None, dataset_name: str | None = None, created_at: datetime | None = None, outputs: Mapping[str, Any] | None = None, metadata: Mapping[str, Any] | None = None, split: str | List[str] | None = None, example_id: UUID | str | None = None, source_run_id: UUID | str | None = None) Example[source]#

Create a dataset example in the LangSmith API.

Examples are rows in a dataset, containing the inputs and expected outputs (or other reference information) for a model or chain.

Parameters:
  • inputs (Mapping[str, Any]) – Mapping[str, Any] The input values for the example.

  • dataset_id (UUID | str | None) – UUID or None, default=None The ID of the dataset to create the example in.

  • dataset_name (str | None) – str or None, default=None The name of the dataset to create the example in.

  • created_at (datetime | None) – datetime or None, default=None The creation timestamp of the example.

  • outputs (Mapping[str, Any] | None) – Mapping[str, Any] or None, default=None The output values for the example.

  • metadata (Mapping[str, Any] | None) – Mapping[str, Any] or None, default=None The metadata for the example.

  • split (str | List[str] | None) – str or List[str] or None, default=None The splits for the example, which are divisions of your dataset such as ‘train’, ‘test’, or ‘validation’.

  • example_id (UUID | str | None) – UUID or None, default=None The ID of the example to create. If not provided, a new example will be created.

  • source_run_id (UUID | str | None) – UUID or None, default=None The ID of the source run associated with this example.

Returns:

The created example.

Return type:

Example