Run#

class langsmith.schemas.Run[source]#

Bases: RunBase

Run schema when loading from the DB.

Initialize a Run object.

param app_path: str | None = None#

Relative URL path of this run within the app.

param attachments: Dict[str, Tuple[str, bytes] | Attachment] [Optional]#

Attachments associated with the run. Each entry is a tuple of (mime_type, bytes).

param child_run_ids: List[UUID] | None = None#

The child run IDs of this run.

param child_runs: List[Run] | None = None#

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.

param completion_cost: Decimal | None = None#

The estimated cost associated with the completion tokens.

param completion_tokens: int | None = None#

Number of tokens generated as output.

param dotted_order: str = ''#

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.

Example

  • Parent: 20230914T223155647Z1b64098b-4ab7-43f6-afee-992304f198d8

  • Children:

  • 20230914T223155647Z1b64098b-4ab7-43f6-afee-992304f198d8.20230914T223155649Z809ed3a2-0172-4f4d-8a02-a64e9b7a0f8a

  • 20230915T223155647Z1b64098b-4ab7-43f6-afee-992304f198d8.20230914T223155650Zc8d9f4c5-6c5a-4b2d-9b1c-3d9d7a7c5c7c

param end_time: datetime | None = None#

End time of the run, if applicable.

param error: str | None = None#

Error message, if the run encountered any issues.

param events: List[Dict] | None = None#

List of events associated with the run, like start and end events.

param extra: dict | None [Optional]#

Additional metadata or settings related to the run.

param feedback_stats: Dict[str, Any] | None = None#

Feedback stats for this run.

param first_token_time: datetime | None = None#

Time the first token was processed.

param id: UUID [Required]#

Unique identifier for the run.

param in_dataset: bool | None = None#

Whether this run is in a dataset.

param inputs: dict [Optional]#

Inputs used for the run.

param manifest_id: UUID | None = None#

Unique ID of the serialized object for this run.

param name: str [Required]#

Human-readable name for the run.

param outputs: dict | None = None#

Outputs generated by the run, if any.

param parent_run_id: UUID | None = None#

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

param parent_run_ids: List[UUID] | None = None#

List of parent run IDs.

param prompt_cost: Decimal | None = None#

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

param prompt_tokens: int | None = None#

Number of tokens used for the prompt.

param reference_example_id: UUID | None = None#

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

param run_type: str [Required]#

The type of run, such as tool, chain, llm, retriever, embedding, prompt, parser.

param serialized: dict | None = None#

Serialized object that executed the run for potential reuse.

param session_id: UUID | None = None#

The project ID this run belongs to.

param start_time: datetime [Required]#

Start time of the run.

param status: str | None = None#

Status of the run (e.g., ‘success’).

param tags: List[str] | None = None#

Tags for categorizing or annotating the run.

param total_cost: Decimal | None = None#

The total estimated LLM cost associated with the completion tokens.

param total_tokens: int | None = None#

Total tokens for prompt and completion.

param trace_id: UUID [Required]#

Unique ID assigned to every run within this nested trace.

property metadata: dict[str, Any]#

Retrieve the metadata (if any).

property revision_id: UUID | None#

Retrieve the revision ID (if any).

property url: str | None#

URL of this run within the app.