SDK for interacting with LangGraph API
Project description
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
# 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)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
langgraph_sdk-0.1.28.tar.gz
(13.0 kB
view details)
Built Distribution
File details
Details for the file langgraph_sdk-0.1.28.tar.gz
.
File metadata
- Download URL: langgraph_sdk-0.1.28.tar.gz
- Upload date:
- Size: 13.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dc1b2ad525b484a5b5bffdecb7b65b5a786538ee0afea0c5efb43aa84d23222a |
|
MD5 | f4ccc0ba133bcb66eb4706fb10617b1e |
|
BLAKE2b-256 | 2171936313509821c84d92847f918536206887d16aa2b774a84a7029b3a1ae45 |
File details
Details for the file langgraph_sdk-0.1.28-py3-none-any.whl
.
File metadata
- Download URL: langgraph_sdk-0.1.28-py3-none-any.whl
- Upload date:
- Size: 13.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d1ec3a8cee92ba91fb4a795dd2eaf1c6241fcf18dda53e96f82145b1bb8da173 |
|
MD5 | d5ee7470919f3995f0510221f8d39a52 |
|
BLAKE2b-256 | 8863d59f6b6b945f93cca650466784988931c4e55d3467de400f5372c2bab38d |