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

Chat LangChain

What can I help with?

Enter to sendยทShift+Enter new line

Menu

OverviewClientAsyncClientRun HelpersRun TreesEvaluationSchemasUtilitiesWrappersAnonymizerTestingExpect APIMiddlewarePytest PluginDeployment SDK
Language
Theme
PythonlangsmithresourcesdatasetsexamplesAsyncExamplesResourceupdate_metadata
Methodโ—Since v0.15

update_metadata

Copy
update_metadata(
  self,
  dataset_id: str,
  *,
  example_ids: SequenceNotStr[str],
  
View source on GitHub
operations
:
Iterable
[
example_update_metadata_params
.
Operation
]
,
extra_headers
:
Headers
|
None
=
None
,
extra_query
:
Query
|
None
=
None
,
extra_body
:
Body
|
None
=
None
,
timeout
:
float
|
httpx
.
Timeout
|
None
|
NotGiven
=
not_given
)
->
ExampleUpdateMetadataResponse

Parameters

NameTypeDescription
example_ids*SequenceNotStr[str]

The IDs of the examples to change; at most 10000. IDs of examples that are not in the dataset, or were deleted, are skipped and reported as NOT_FOUND.

operations*Iterable[example_update_metadata_params.Operation]

The metadata changes to apply, in order; at most 50, of which at most 10 are array operations.

extra_headersHeaders | None
Default:None
extra_queryQuery | None
Default:None
extra_bodyBody | None
Default:None
timeoutfloat | httpx.Timeout | None | NotGiven
Default:not_given

Applies the same metadata changes, in order, to every listed example in a dataset. Examples that are not in the dataset or were deleted are skipped; the rest are updated together, so if the update fails none of them change. Answers 207 with one status per submitted example ID: UPDATED, or NOT_FOUND for a skipped example. Metadata keys the operations do not name keep their values. To add examples to a split or remove them from one, use ARRAY_ADD or ARRAY_REMOVE on the dataset_split key. Requires permission to update datasets.

Send extra headers

Add additional query parameters to the request

Add additional JSON properties to the request

Override the client-level default timeout for this request, in seconds