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
  • RemoteGraph
⌘I

LangChain Assistant

Ask a question to get started

Enter to send•Shift+Enter new line

Menu

OverviewClientAsyncClientRun HelpersRun TreesEvaluationSchemasUtilitiesWrappersAnonymizerTestingExpect APIMiddlewarePytest PluginDeployment SDKRemoteGraph
Language
Theme
PythonlangsmithclientClientupdate_run
Method●Since v0.0

update_run

Update a run in the LangSmith API.

Copy
update_run(
  self,
  run_id: ID_TYPE,
  *,
  name: Optional[str] = None,
  run_type: Optional[RUN_TYPE_T] = None,
  start_time: Optional[datetime.datetime] = None,
  end_time: Optional[datetime.datetime] = None,
  error: Optional[str] = None,
  inputs: Optional[dict] = None,
  outputs: Optional[dict] = None,
  events: Optional[Sequence[dict]] = None,
  extra: Optional[dict] = None,
  tags: Optional[list[str]] = None,
  attachments: Optional[ls_schemas.Attachments] = None,
  dangerously_allow_filesystem: bool = False,
  reference_example_id: str | uuid.UUID | None = None,
  api_key: Optional[str] = None,
  api_url: Optional[str] = None,
  service_key: Optional[str] = None,
  tenant_id: Optional[str] = None,
  authorization: Optional[str] = None,
  cookie: Optional[str] = None,
  **kwargs: Any = {}
) -> None

Parameters

NameTypeDescription
run_id*Union[UUID, str]

The ID of the run to update.

nameOptional[str]
Default:None

The name of the run.

run_typeOptional[str]
Default:None

The type of the run (e.g., llm, chain, tool).

start_timeOptional[datetime.datetime]
Default:None

The start time of the run.

end_timeOptional[datetime.datetime]
Default:None

The end time of the run.

errorOptional[str]
Default:None

The error message of the run.

inputsOptional[Dict]
Default:None

The input values for the run.

outputsOptional[Dict]
Default:None

The output values for the run.

eventsOptional[Sequence[dict]]
Default:None

The events for the run.

extraOptional[Dict]
Default:None

The extra information for the run.

tagsOptional[List[str]]
Default:None

The tags for the run.

attachmentsOptional[Dict[str, Attachment]]
Default:None

A dictionary of attachments to add to the run. The keys are the attachment names, and the values are Attachment objects containing the data and mime type.

reference_example_idOptional[Union[str, uuid.UUID]]
Default:None

ID of the example that was the source of the run inputs. Used for runs that were part of an experiment.

api_keyOptional[str]
Default:None

The API key to use for this specific run.

api_urlOptional[str]
Default:None

The API URL to use for this specific run.

service_keyOptional[str]
Default:None

The service JWT key for service-to-service auth.

tenant_idOptional[str]
Default:None

The tenant ID for multi-tenant requests.

authorizationOptional[str]
Default:None

The Authorization header value.

cookieOptional[str]
Default:None

The Cookie header value.

**kwargsAny
Default:{}

Kwargs are ignored.

View source on GitHub