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
PythonlangsmithschemasRun
Class●Since v0.0

Run

Run schema when loading from the DB.

Copy
Run(
    self,
    _host_url: Optional[str] = None,
    **kwargs: Any = {},

Bases

RunBase

Used in Docs

  • How to define a code evaluator
  • How to evaluate a graph
  • How to evaluate an application's intermediate steps
  • How to fetch performance metrics for an experiment

Constructors

Attributes

Inherited fromRunBase

Attributes

Aid: UUID
—

Unique identifier for the run.

Aname: str
—

Human-readable name for the run.

Arun_type: str
—

The type of run, such as tool, chain, llm, retriever,

A
View source on GitHub
)
extra
: Optional[dict]
—

Additional metadata or settings related to the run.

Aerror: Optional[str]
—

Error message, if the run encountered any issues.

Aserialized: Optional[dict]
—

Serialized object that executed the run for potential reuse.

Aevents: Optional[list[dict]]
—

List of events associated with the run, like

Ainputs: dict
—

Inputs used for the run.

Aoutputs: Optional[dict]
—

Outputs generated by the run, if any.

Areference_example_id: Optional[UUID]
—

Reference to an example that this run may be based on.

Aparent_run_id: Optional[UUID]
—

Identifier for a parent run, if this run is a sub-run.

Atags: Optional[list[str]]
—

Tags for categorizing or annotating the run.

Aattachments: Union[Attachments, dict[str, AttachmentInfo]]
—

Attachments associated with the run.

Ametadata: dict[str, Any]
—

Retrieve the metadata (if any).

Arevision_id: Optional[UUID]
—

Retrieve the revision ID (if any).

Alatency: Optional[float]
—

Latency in seconds.

Amodel_config
constructor
__init__
NameType
_host_urlOptional[str]
attribute
session_id: Optional[UUID]
attribute
child_run_ids: Optional[list[UUID]]
attribute
child_runs: Optional[list[Run]]
attribute
feedback_stats: Optional[dict[str, Any]]
attribute
app_path: Optional[str]
attribute
manifest_id: Optional[UUID]
attribute
status: Optional[str]
attribute
prompt_tokens: Optional[int]
attribute
completion_tokens: Optional[int]
attribute
total_tokens: Optional[int]
attribute
prompt_token_details: Optional[dict[str, int]]
attribute
completion_token_details: Optional[dict[str, int]]
attribute
first_token_time: Optional[datetime]
attribute
total_cost: Optional[Decimal]
attribute
prompt_cost: Optional[Decimal]
attribute
completion_cost: Optional[Decimal]
attribute
prompt_cost_details: Optional[dict[str, Decimal]]
attribute
completion_cost_details: Optional[dict[str, Decimal]]
attribute
parent_run_ids: Optional[list[UUID]]
attribute
trace_id: UUID
attribute
dotted_order: str
attribute
in_dataset: Optional[bool]
attribute
start_time
attribute
end_time
attribute
url: Optional[str]
attribute
input_tokens: int | None
attribute
output_tokens: int | None
attribute
input_cost: Decimal | None
attribute
output_cost: Decimal | None
attribute
input_token_details: dict[str, int] | None
attribute
output_token_details: dict[str, int] | None
attribute
input_cost_details: dict[str, Decimal] | None
attribute
output_cost_details: dict[str, Decimal] | None

The project ID this run belongs to.

Deprecated: The child run IDs of this run.

The child runs of this run, if instructed to load using the client These are not populated by default, as it is a heavier query to make.

Feedback stats for this run.

Relative URL path of this run within the app.

Unique ID of the serialized object for this run.

Status of the run (e.g., 'success').

Number of tokens used for the prompt.

Number of tokens generated as output.

Total tokens for prompt and completion.

Breakdown of prompt (input) token counts.

Does not need to sum to full prompt token count.

Breakdown of completion (output) token counts.

Does not need to sum to full completion token count.

Time the first token was processed.

The total estimated LLM cost associated with the completion tokens.

The estimated cost associated with the prompt (input) tokens.

The estimated cost associated with the completion tokens.

Breakdown of prompt (input) token costs.

Does not need to sum to full prompt token cost.

Breakdown of completion (output) token costs.

Does not need to sum to full completion token cost.

List of parent run IDs.

Unique ID assigned to every run within this nested trace.

Dotted order for the run.

This is a string composed of {time}{run-uuid}.* so that a trace can be sorted in the order it was executed.

Whether this run is in a dataset.

URL of this run within the app.

Alias for prompt_tokens.

Alias for completion_tokens.

Alias for prompt_cost.

Alias for completion_cost.

Alias for prompt_token_details.

Alias for output_token_details.

Alias for prompt_cost_details.

Alias for completion_cost_details.