LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
  • Client
  • AsyncClient
  • Run Helpers
  • Run Trees
  • Evaluation
  • Schemas
  • Utilities
  • Wrappers
  • Anonymizer
  • Testing
  • Expect API
  • Middleware
  • Pytest Plugin
  • Deployment SDK
⌘I

LangChain Assistant

Ask a question to get started

Enter to send•Shift+Enter new line

Menu

OverviewClientAsyncClientRun HelpersRun TreesEvaluationSchemasUtilitiesWrappersAnonymizerTestingExpect APIMiddlewarePytest PluginDeployment SDK
Language
Theme
PythonlangsmithclientClientcreate_example
Method●Since v0.0

create_example

Copy
create_example(
  self,
  inputs: Optional[Mapping[str, Any]] =
View source on GitHub
None
,
dataset_id
:
Optional
[
ID_TYPE
]
=
None
,
dataset_name
:
Optional
[
str
]
=
None
,
created_at
:
Optional
[
datetime
.
datetime
]
=
None
,
outputs
:
Optional
[
Mapping
[
str
,
Any
]
]
=
None
,
metadata
:
Optional
[
Mapping
[
str
,
Any
]
]
=
None
,
split
:
Optional
[
str
|
list
[
str
]
]
=
None
,
example_id
:
Optional
[
ID_TYPE
]
=
None
,
source_run_id
:
Optional
[
ID_TYPE
]
=
None
,
use_source_run_io
:
bool
=
False
,
use_source_run_attachments
:
Optional
[
list
[
str
]
]
=
None
,
attachments
:
Optional
[
ls_schemas
.
Attachments
]
=
None
)
->
ls_schemas
.
Example

Parameters

NameTypeDescription
inputsMapping[str, Any]
Default:None

The input values for the example.

dataset_idOptional[Union[UUID, str]]
Default:None
dataset_nameOptional[str]
Default:None
created_atOptional[datetime.datetime]
Default:None
outputsOptional[Mapping[str, Any]]
Default:None
metadataOptional[Mapping[str, Any]]
Default:None
splitOptional[str | List[str]]
Default:None
example_idOptional[Union[UUID, str]]
Default:None
source_run_idOptional[Union[UUID, str]]
Default:None
use_source_run_iobool
Default:False
use_source_run_attachmentsOptional[List[str]]
Default:None
attachmentsOptional[Attachments]
Default:None

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.

The ID of the dataset to create the example in.

The name of the dataset to create the example in.

The creation timestamp of the example.

The output values for the example.

The metadata for the example.

The splits for the example, which are divisions of your dataset such as 'train', 'test', or 'validation'.

The ID of the example to create. If not provided, a new example will be created.

The ID of the source run associated with this example.

Whether to use the inputs, outputs, and attachments from the source run.

Which attachments to use from the source run. If use_source_run_io is True, all attachments will be used regardless of this param.

The attachments for the example.