Ask a question to get started
Enter to sendā¢Shift+Enter new line
Convert an async iterable of legacy ChatGenerationChunks into ChatModelStreamEvents with typed deltas.
ChatGenerationChunk
ChatModelStreamEvent
Finalize a content block for the finish event. For tool calls, parse the accumulated JSON args string.
Compatibility bridge: converts legacy _streamResponseChunks (ChatGenerationChunk / AIMessageChunk) output to the new ChatModelStreamEvent protocol.
_streamResponseChunks
AIMessageChunk
import { ... } from "@langchain/core/language_models/compat";