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_clienttypesrunEvent
Class●Since v0.9

Event

Copy
Event()

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
kwargs: Optional[object]
attribute
name: Optional[str]
attribute
time: Optional[datetime]

kwargs is the event payload — an opaque JSON object whose shape depends on name and on the emitting SDK. For example LangChain emits {"token": {...}} for new_token events, tool-call start/end details for tool events, and arbitrary user-defined payloads for custom events. Clients should treat kwargs as untyped JSON: do not assume specific keys exist for a given name, and tolerate additional unknown keys appearing over time.

name is the event kind.

Common values emitted by the LangChain/LangSmith tracer SDKs include "start", "end", and "new_token", but applications may emit arbitrary strings for their own instrumentation.

time is when the event occurred (RFC3339 date-time with millisecond precision).