TracerSessionResult#
- class langsmith.schemas.TracerSessionResult(
- _host_url: str | None = None,
- *,
- id: UUID,
- start_time: datetime = None,
- end_time: datetime | None = None,
- description: str | None = None,
- name: str | None = None,
- extra: dict[str, Any] | None = None,
- tenant_id: UUID,
- reference_dataset_id: UUID | None = None,
- run_count: int | None = None,
- latency_p50: timedelta | None = None,
- latency_p99: timedelta | None = None,
- total_tokens: int | None = None,
- prompt_tokens: int | None = None,
- completion_tokens: int | None = None,
- last_run_start_time: datetime | None = None,
- feedback_stats: dict[str, Any] | None = None,
- run_facets: list[dict[str, Any]] | None = None,
- total_cost: Decimal | None = None,
- prompt_cost: Decimal | None = None,
- completion_cost: Decimal | None = None,
- first_token_p50: timedelta | None = None,
- first_token_p99: timedelta | None = None,
- error_rate: float | None = None,
A project, hydrated with additional information.
Sessions are also referred to as “Projects” in the UI.
Initialize a Run object.
Attributes
metadata
Retrieve the metadata (if any).
tags
Retrieve the tags (if any).
url
URL of this run within the app.
Methods
__init__
([_host_url])Initialize a Run object.
construct
([_fields_set])Creates a new model setting __dict__ and __fields_set__ from trusted or pre-validated data.
copy
(*[, include, exclude, update, deep])Duplicate a model, optionally choose which fields to include, exclude and change.
dict
(*[, include, exclude, by_alias, ...])Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.
from_orm
(obj)json
(*[, include, exclude, by_alias, ...])Generate a JSON representation of the model, include and exclude arguments as per dict().
parse_file
(path, *[, content_type, ...])parse_obj
(obj)parse_raw
(b, *[, content_type, encoding, ...])schema
([by_alias, ref_template])schema_json
(*[, by_alias, ref_template])update_forward_refs
(**localns)Try to update ForwardRefs on fields based on this Model, globalns and localns.
validate
(value)- Parameters:
_host_url (str | None)
id (UUID)
start_time (datetime)
end_time (datetime | None)
description (str | None)
name (str | None)
extra (dict[str, Any] | None)
tenant_id (UUID)
reference_dataset_id (UUID | None)
run_count (int | None)
latency_p50 (timedelta | None)
latency_p99 (timedelta | None)
total_tokens (int | None)
prompt_tokens (int | None)
completion_tokens (int | None)
last_run_start_time (datetime | None)
feedback_stats (dict[str, Any] | None)
run_facets (list[dict[str, Any]] | None)
total_cost (Decimal | None)
prompt_cost (Decimal | None)
completion_cost (Decimal | None)
first_token_p50 (timedelta | None)
first_token_p99 (timedelta | None)
error_rate (float | None)
- __init__(
- _host_url: str | None = None,
- **kwargs: Any,
Initialize a Run object.
- Parameters:
_host_url (str | None)
kwargs (Any)
- Return type:
None
- classmethod construct(
- _fields_set: SetStr | None = None,
- **values: Any,
Creates a new model setting __dict__ and __fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed. Behaves as if Config.extra = ‘allow’ was set since it adds all passed values
- Parameters:
_fields_set (SetStr | None)
values (Any)
- Return type:
Model
- copy(
- *,
- include: AbstractSetIntStr | MappingIntStrAny | None = None,
- exclude: AbstractSetIntStr | MappingIntStrAny | None = None,
- update: DictStrAny | None = None,
- deep: bool = False,
Duplicate a model, optionally choose which fields to include, exclude and change.
- Parameters:
include (AbstractSetIntStr | MappingIntStrAny | None) – fields to include in new model
exclude (AbstractSetIntStr | MappingIntStrAny | None) – fields to exclude from new model, as with values this takes precedence over include
update (DictStrAny | None) – values to change/add in the new model. Note: the data is not validated before creating the new model: you should trust this data
deep (bool) – set to True to make a deep copy of the model
self (Model)
- Returns:
new model instance
- Return type:
Model
- dict(
- *,
- include: AbstractSetIntStr | MappingIntStrAny | None = None,
- exclude: AbstractSetIntStr | MappingIntStrAny | None = None,
- by_alias: bool = False,
- skip_defaults: bool | None = None,
- exclude_unset: bool = False,
- exclude_defaults: bool = False,
- exclude_none: bool = False,
Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.
- Parameters:
include (AbstractSetIntStr | MappingIntStrAny | None)
exclude (AbstractSetIntStr | MappingIntStrAny | None)
by_alias (bool)
skip_defaults (bool | None)
exclude_unset (bool)
exclude_defaults (bool)
exclude_none (bool)
- Return type:
DictStrAny
- classmethod from_orm(obj: Any) Model #
- Parameters:
obj (Any)
- Return type:
Model
- json(
- *,
- include: AbstractSetIntStr | MappingIntStrAny | None = None,
- exclude: AbstractSetIntStr | MappingIntStrAny | None = None,
- by_alias: bool = False,
- skip_defaults: bool | None = None,
- exclude_unset: bool = False,
- exclude_defaults: bool = False,
- exclude_none: bool = False,
- encoder: Callable[[Any], Any] | None = None,
- models_as_dict: bool = True,
- **dumps_kwargs: Any,
Generate a JSON representation of the model, include and exclude arguments as per dict().
encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().
- Parameters:
include (AbstractSetIntStr | MappingIntStrAny | None)
exclude (AbstractSetIntStr | MappingIntStrAny | None)
by_alias (bool)
skip_defaults (bool | None)
exclude_unset (bool)
exclude_defaults (bool)
exclude_none (bool)
encoder (Callable[[Any], Any] | None)
models_as_dict (bool)
dumps_kwargs (Any)
- Return type:
str
- classmethod parse_file(
- path: str | Path,
- *,
- content_type: str = None,
- encoding: str = 'utf8',
- proto: Protocol = None,
- allow_pickle: bool = False,
- Parameters:
path (str | Path)
content_type (str)
encoding (str)
proto (Protocol)
allow_pickle (bool)
- Return type:
Model
- classmethod parse_obj(obj: Any) Model #
- Parameters:
obj (Any)
- Return type:
Model
- classmethod parse_raw(
- b: str | bytes,
- *,
- content_type: str = None,
- encoding: str = 'utf8',
- proto: Protocol = None,
- allow_pickle: bool = False,
- Parameters:
b (str | bytes)
content_type (str)
encoding (str)
proto (Protocol)
allow_pickle (bool)
- Return type:
Model
- classmethod schema(
- by_alias: bool = True,
- ref_template: str = '#/definitions/{model}',
- Parameters:
by_alias (bool)
ref_template (str)
- Return type:
DictStrAny
- classmethod schema_json(
- *,
- by_alias: bool = True,
- ref_template: str = '#/definitions/{model}',
- **dumps_kwargs: Any,
- Parameters:
by_alias (bool)
ref_template (str)
dumps_kwargs (Any)
- Return type:
str
- classmethod update_forward_refs(
- **localns: Any,
Try to update ForwardRefs on fields based on this Model, globalns and localns.
- Parameters:
localns (Any)
- Return type:
None
- classmethod validate(value: Any) Model #
- Parameters:
value (Any)
- Return type:
Model