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)[source]#
一个项目,包含额外的水合信息。
会话在 UI 中也称为 “项目”。
初始化 Run 对象。
属性
metadata
检索元数据(如果有)。
tags
检索标签(如果有)。
url
此 Run 在应用内的 URL。
方法
__init__
([_host_url])初始化 Run 对象。
construct
([_fields_set])创建一个新的模型,从受信任或预验证的数据中设置 __dict__ 和 __fields_set__。
copy
(*[, include, exclude, update, deep])复制一个模型,可选择包含、排除和更改哪些字段。
dict
(*[, include, exclude, by_alias, ...])生成模型的字典表示,可选择指定要包含或排除的字段。
from_orm
(obj)json
(*[, include, exclude, by_alias, ...])生成模型的 JSON 表示,include 和 exclude 参数与 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)尝试基于此模型、globalns 和 localns 更新字段上的 ForwardRefs。
validate
(value)- 参数:
_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) None #
初始化 Run 对象。
- 参数:
_host_url (str | None)
kwargs (Any)
- 返回类型:
None
- classmethod construct(_fields_set: SetStr | None = None, **values: Any) Model #
创建一个新的模型,从受信任或预验证的数据中设置 __dict__ 和 __fields_set__。默认值会被考虑,但不会执行其他验证。行为类似于设置了 Config.extra = ‘allow’,因为它会添加所有传递的值
- 参数:
_fields_set (SetStr | None)
values (Any)
- 返回类型:
Model
- copy(*, include: AbstractSetIntStr | MappingIntStrAny | None = None, exclude: AbstractSetIntStr | MappingIntStrAny | None = None, update: DictStrAny | None = None, deep: bool = False) Model #
复制一个模型,可选择包含、排除和更改哪些字段。
- 参数:
include (AbstractSetIntStr | MappingIntStrAny | None) – 新模型中要包含的字段
exclude (AbstractSetIntStr | MappingIntStrAny | None) – 从新模型中排除的字段,与值一样,此项优先于 include
update (DictStrAny | None) – 要在新模型中更改/添加的值。注意:数据在创建新模型之前未经过验证:您应该信任此数据
deep (bool) – 设置为 True 以创建模型的深拷贝
self (Model)
- 返回:
新的模型实例
- 返回类型:
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) DictStrAny #
生成模型的字典表示,可选择指定要包含或排除的字段。
- 参数:
include (AbstractSetIntStr | MappingIntStrAny | None)
exclude (AbstractSetIntStr | MappingIntStrAny | None)
by_alias (bool)
skip_defaults (bool | None)
exclude_unset (bool)
exclude_defaults (bool)
exclude_none (bool)
- 返回类型:
DictStrAny
- classmethod from_orm(obj: Any) Model #
- 参数:
obj (Any)
- 返回类型:
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) str #
生成模型的 JSON 表示,include 和 exclude 参数与 dict() 相同。
encoder 是一个可选函数,用作 json.dumps() 的 default,其他参数与 json.dumps() 相同。
- 参数:
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)
- 返回类型:
str
- classmethod parse_file(path: str | Path, *, content_type: str = None, encoding: str = 'utf8', proto: Protocol = None, allow_pickle: bool = False) Model #
- 参数:
path (str | Path)
content_type (str)
encoding (str)
proto (Protocol)
allow_pickle (bool)
- 返回类型:
Model
- classmethod parse_obj(obj: Any) Model #
- 参数:
obj (Any)
- 返回类型:
Model
- classmethod parse_raw(b: str | bytes, *, content_type: str = None, encoding: str = 'utf8', proto: Protocol = None, allow_pickle: bool = False) Model #
- 参数:
b (str | bytes)
content_type (str)
encoding (str)
proto (Protocol)
allow_pickle (bool)
- 返回类型:
Model
- classmethod schema(by_alias: bool = True, ref_template: str = '#/definitions/{model}') DictStrAny #
- 参数:
by_alias (bool)
ref_template (str)
- 返回类型:
DictStrAny
- classmethod schema_json(*, by_alias: bool = True, ref_template: str = '#/definitions/{model}', **dumps_kwargs: Any) str #
- 参数:
by_alias (bool)
ref_template (str)
dumps_kwargs (Any)
- 返回类型:
str
- classmethod update_forward_refs(**localns: Any) None #
尝试基于此模型、globalns 和 localns 更新字段上的 ForwardRefs。
- 参数:
localns (Any)
- 返回类型:
None
- classmethod validate(value: Any) Model #
- 参数:
value (Any)
- 返回类型:
Model