Files
langgraph/libs/sdk-py
Sydney RunkleandGitHub 46fed9d161 feat: type safe stream/invoke w/ proper output type coercion (#6961)
Adding type safe streaming + more robust pydantic + dataclass support on
graph outputs

* type safe streaming via #6931 
* type safe invoke via
https://github.com/langchain-ai/langgraph/pull/6963
* actually thread through types via parametrization in
https://github.com/langchain-ai/langgraph/pull/7009
* deprecation of backwards compatible accessor via
https://github.com/langchain-ai/langgraph/pull/7011

full spec of changes:
https://github.com/langchain-ai/langgraph/issues/7008
proving out that required changes are minimal even when we update the
default to v2: https://github.com/langchain-ai/langchain/pull/35541
2026-03-09 17:52:36 +00:00
..
2026-02-17 10:30:58 -08:00
2026-02-27 13:00:05 -08:00

LangGraph Python SDK

This repository contains the Python SDK for interacting with the LangSmith Deployment REST API.

Quick Start

To get started with the Python SDK, install the package

pip install -U langgraph-sdk

You will need a running LangGraph API server. If you're running a server locally using langgraph-cli, SDK will automatically point at http://localhost:8123, otherwise you would need to specify the server URL when creating a client.

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)