kwargs is the event payload — an opaque JSON object whose shape depends on name and
on the emitting SDK.
public JsonValue _kwargs()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.
This arbitrary value can be deserialized into a custom type using the convert method:
MyClass myObject = event.kwargs().convert(MyClass.class);