Bumps the major group in /libs/sdk-py with 1 update: [websockets](https://github.com/python-websockets/websockets). Updates `websockets` from 15.0.1 to 16.0 <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/python-websockets/websockets/releases">websockets's releases</a>.</em></p> <blockquote> <h2>16.0</h2> <p>See <a href="https://websockets.readthedocs.io/en/stable/project/changelog.html">https://websockets.readthedocs.io/en/stable/project/changelog.html</a> for details.</p> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/python-websockets/websockets/commit/d4303a5d3e373fc8c34177c3dec1a9c75c8865fa"><code>d4303a5</code></a> Release version 16.0.</li> <li><a href="https://github.com/python-websockets/websockets/commit/851bcd756bf114e41438f04d928aa85838724fe1"><code>851bcd7</code></a> Bump pypa/cibuildwheel from 3.3.0 to 3.3.1</li> <li><a href="https://github.com/python-websockets/websockets/commit/740c8d373e10ced940fb33c3e0457991841c10c4"><code>740c8d3</code></a> Temporarily remove the trio implementation.</li> <li><a href="https://github.com/python-websockets/websockets/commit/92ea0553587ba07a4668c30dfd9e6210d9f26bc9"><code>92ea055</code></a> Add missing changelog entry.</li> <li><a href="https://github.com/python-websockets/websockets/commit/ba74244154df5a74f044d0f8cd971acac636bb74"><code>ba74244</code></a> Document bug fix.</li> <li><a href="https://github.com/python-websockets/websockets/commit/9410483c016463a6cd08b2a5321337b85e094f10"><code>9410483</code></a> Pin sphinx to avoid error in sphinxcontrib-trio.</li> <li><a href="https://github.com/python-websockets/websockets/commit/8e4d408e17b0bfa1a91aa62e054b8786a8132231"><code>8e4d408</code></a> Document asyncio's TLS read buffer.</li> <li><a href="https://github.com/python-websockets/websockets/commit/cb3500b0b030715dc3caa1e3ce95affe4a79b8bd"><code>cb3500b</code></a> Stop referring to the asyncio implementation as new.</li> <li><a href="https://github.com/python-websockets/websockets/commit/6563a9c884d92df4c889bb174dc84a56a7377686"><code>6563a9c</code></a> The threading implementation supports max_queue.</li> <li><a href="https://github.com/python-websockets/websockets/commit/9f17e92dbee2b9a14e02b2792cfbb127efbd4098"><code>9f17e92</code></a> Clarify that protocol_mutex protects pending_pings.</li> <li>Additional commits viewable in <a href="https://github.com/python-websockets/websockets/compare/15.0.1...16.0">compare view</a></li> </ul> </details> <br /> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore <dependency name> major version` will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself) - `@dependabot ignore <dependency name> minor version` will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself) - `@dependabot ignore <dependency name>` will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself) - `@dependabot unignore <dependency name>` will remove all of the ignore conditions of the specified dependency - `@dependabot unignore <dependency name> <ignore condition>` will remove the ignore condition of the specified dependency and ignore conditions </details> --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: John Kennedy <65985482+jkennedyvz@users.noreply.github.com> Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com>
LangGraph Python SDK
To help you ship LangGraph apps to production faster, check out LangSmith. LangSmith is a unified developer platform for building, testing, and monitoring LLM applications.
Quick Install
uv add langgraph-sdk
🤔 What is this?
This library provides the Python SDK for interacting with the LangGraph API. Use it to connect to a running LangGraph API server, manage assistants and threads, and stream runs from Python applications.
You will need a running LangGraph API server. If you're running a server locally using langgraph-cli, the SDK will automatically point at http://localhost:8123; otherwise, specify the server URL when creating a client.
📖 Documentation
For full documentation, see the API reference. For conceptual guides and tutorials, see the LangGraph Docs.
Quick Start
from langgraph_sdk import get_client
# If you're using a remote server, initialize the client with `get_client(url=REMOTE_URL)`
client = get_client()
# List all assistants
assistants = await client.assistants.search()
# We auto-create an assistant for each graph you register in config.
agent = assistants[0]
# Start a new thread
thread = await client.threads.create()
# Start a streaming run
input = {"messages": [{"role": "human", "content": "what's the weather in la"}]}
async for chunk in client.runs.stream(thread['thread_id'], agent['assistant_id'], input=input):
print(chunk)
Known Limitations
- WebSocket transport requires
websockets>=14and is only available on the async client (AsyncThreadStream). The sync client (SyncThreadStream) uses SSE exclusively. thread.extensions[name]opens a new subscription each time the same name is accessed. Assign the projection to a variable and reuse it within a single session rather than re-indexing across multiple iterations.- Sync streaming drives the lifecycle watcher in a background thread. Long-lived sync sessions will hold that thread open until the context manager exits.
- Reconnect attempts are limited to 5 by default for both the shared SSE fan-out and the lifecycle watcher. Persistent network partitions will surface as
RuntimeErroron in-flight projections.
Thread-Centric Streaming (v3)
client.threads.stream() returns a context manager that owns the SSE session for one thread. Typed projections — values snapshots, message streams, tool calls, custom events — all share the same underlying connection.
from langgraph_sdk import get_client
import asyncio
client = get_client()
async with client.threads.stream(
thread_id="my-thread",
assistant_id="agent",
) as thread:
await thread.run.start(input={"messages": [{"role": "user", "content": "hi"}]})
# Start all consumers concurrently so they share one SSE connection.
async def get_messages():
return [s async for s in thread.messages]
async def get_tool_calls():
return [c async for c in thread.tool_calls]
messages, tool_calls = await asyncio.gather(get_messages(), get_tool_calls())
for stream in messages:
print(await stream.text) # accumulated text
final = await thread.output # terminal state values
📕 Releases & Versioning
See our Releases and Versioning policies.
💁 Contributing
As an open-source project in a rapidly developing field, we are extremely open to contributions, whether it be in the form of a new feature, improved infrastructure, or better documentation.
For detailed information on how to contribute, see the Contributing Guide.