codekingpro/portable-devtools
114k
1Metadata-Version: 2.42Name: langgraph-sdk3Version: 0.3.144Summary: SDK for interacting with LangGraph API5Project-URL: Source, https://github.com/langchain-ai/langgraph/tree/main/libs/sdk-py6Project-URL: Twitter, https://x.com/langchain_oss7Project-URL: Slack, https://www.langchain.com/join-community8Project-URL: Reddit, https://www.reddit.com/r/LangChain/9License-Expression: MIT10License-File: LICENSE11Requires-Python: >=3.1012Requires-Dist: httpx>=0.25.213Requires-Dist: orjson>=3.11.514Description-Content-Type: text/markdown15 16# LangGraph Python SDK17 18This repository contains the Python SDK for interacting with the LangSmith Deployment REST API.19 20## Quick Start21 22To get started with the Python SDK, [install the package](https://pypi.org/project/langgraph-sdk/)23 24```bash25pip install -U langgraph-sdk26```27 28You 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`, otherwise29you would need to specify the server URL when creating a client.30 31```python32from langgraph_sdk import get_client33 34# If you're using a remote server, initialize the client with `get_client(url=REMOTE_URL)`35client = get_client()36 37# List all assistants38assistants = await client.assistants.search()39 40# We auto-create an assistant for each graph you register in config.41agent = assistants[0]42 43# Start a new thread44thread = await client.threads.create()45 46# Start a streaming run47input = {"messages": [{"role": "human", "content": "what's the weather in la"}]}48async for chunk in client.runs.stream(thread['thread_id'], agent['assistant_id'], input=input):49 print(chunk)50```51 