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
Pythonlangsmith_openapi_clienttypesissueEvidenceSeriesMetricDefinition
Class●Since v0.14

EvidenceSeriesMetricDefinition

Copy
EvidenceSeriesMetricDefinition()

Bases

BaseModel

Attributes

Inherited fromBaseModel

Attributes

Amodel_fields_set: set[str]Amodel_config: ConfigDictAmodel_construct: construct

Methods

Mto_dict
—
View source on GitHub

Recursively generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Mto_json
—

Generates a JSON string representing this model as it would be received from or sent to the API (but with indentation).

Mconstruct
Mmodel_dump
—

Usage docs: https://docs.pydantic.dev/2.4/concepts/serialization/#modelmodel_dump

Mmodel_dump_json
—

Usage docs: https://docs.pydantic.dev/2.4/concepts/serialization/#modelmodel_dump_json

Classes

CConfig
attribute
type: Literal['count', 'sum', 'avg', 'min', 'max', 'percentile', 'ratio', 'histogram']
attribute
denominator: Optional[EvidenceSeriesMetricDefinitionDenominator]
attribute
entity: Optional[Literal['run', 'feedback']]
attribute
field: Optional[Literal['latency_seconds', 'first_token_seconds', 'total_tokens', 'prompt_tokens', 'completion_tokens', 'total_cost', 'prompt_cost', 'completion_cost', 'feedback_score', 'prompt_token_details.cache_creation', 'prompt_token_details.cache_read', 'prompt_token_details.ephemeral_1h_input_tokens', 'prompt_token_details.ephemeral_5m_input_tokens', 'prompt_token_details.audio', 'prompt_token_details.image', 'prompt_token_details.video', 'completion_token_details.reasoning', 'completion_token_details.audio', 'completion_token_details.image', 'completion_token_details.video']]
attribute
numerator: Optional[EvidenceSeriesMetricDefinitionNumerator]
attribute
params: Optional[EvidenceSeriesMetricDefinitionParams]

histogram is reserved and rejected; the tag publishes what is accepted.

Entity selects what a type=count metric counts.

Only valid when type=count; defaults to MetricEntityRun. entity=feedback requires params.feedback_key and counts individual feedback records rather than runs.

Numerator and Denominator are required when type=ratio.

percentile p or histogram bucket_count