--- id: langchain-protocol version: "0.0.18" license: MIT license_treatment: permissive maintenance: active --- # langchain-protocol — Python bindings for the LangChain agent streaming protocol License: permissive · Maintenance: active · Popularity: top 1,000 on PyPI ## Install pip install langchain-protocol uv add langchain-protocol poetry add langchain-protocol ## Description # langchain-protocol Python bindings for the [LangChain agent streaming protocol][streaming]. This package provides generated `TypedDict` and `Literal` definitions for the protocol's commands, events, results, and payload shapes. It does not include a runtime client, transport, or helper APIs — it is intended as a source of typing primitives only. The types are generated from [`protocol.cddl`][cddl], the source of truth for the wire format. See the [streaming protocol overview][streaming] for the full design, channel model, and transport details. [streaming]: https://github.com/langchain-ai/agent-protocol/tree/main/streaming [cddl]: https://github.com/langchain-ai/agent-protocol/blob/main/streaming/protocol.cddl ## Installation ```bash pip install langchain-protocol ``` ## Usage ```python from langchain_protocol import Command, SubscribeParams params: SubscribeParams = { "channels": ["messages", "lifecycle"], } subscribe: Command = { "id": 1, "method": "subscription.subscribe", "params": params, } ``` ## What this package includes - `TypedDict` definitions for commands, events, results, and payload shapes - `Literal` and union aliases for... ## AI interpretation — verify before relying Provides TypedDict and Literal type definitions for the LangChain agent streaming protocol, enabling type-safe interaction with protocol commands, events, and payloads without runtime client or transport logic. Verdict: A lightweight, actively maintained typing library for the LangChain streaming protocol with no security vulnerabilities and permissive licensing. Suitable for projects needing protocol-compliant type annotations, though it provides only type definitions and not runtime functionality. [View on SkillFed](https://skillfed.io/packages/langchain-protocol) · [View on PyPI](https://pypi.org/project/langchain-protocol/)