LangGraph Python SDK
This repository contains the Python SDK for interacting with the LangGraph Cloud 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
client = get_client()
assistants = await client.assistants.search()
agent = assistants[0]
thread = await client.threads.create()
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)