Langchain tests utilities.
Utilities for working with pydantic models.
Validator for LangChain content-block protocol event streams.
Checks that an event stream emitted by a chat model (via stream_events(version="v3"),
or by the compat bridge's chunks_to_events / message_to_events)
conforms to the protocol lifecycle rules:
message-start opens and message-finish closes the stream.content-block-start → optional content-block-deltas →
content-block-finish, while other block indices may start or receive
deltas before that block finishes.uint values
starting at 0.text, reasoning, tool_call_chunk,
server_tool_call_chunk), accumulated delta content matches the
final payload delivered on content-block-finish.The validator accepts any iterable of protocol event dicts. It raises
AssertionError on the first violation with a descriptive message.