mirror of
https://github.com/langchain-ai/langgraph.git
synced 2026-08-19 22:25:44 +02:00
Compare commits
7
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4f2f5f7cbc | ||
|
|
2ae1121994 | ||
|
|
3b5669a90b | ||
|
|
85454b6371 | ||
|
|
25a98fa888 | ||
|
|
2370db0f8c | ||
|
|
1b353aed73 |
Generated
+2
-2
@@ -831,5 +831,5 @@ watchmedo = ["PyYAML (>=3.10)"]
|
||||
|
||||
[metadata]
|
||||
lock-version = "2.0"
|
||||
python-versions = "^3.9.0,<4.0"
|
||||
content-hash = "fe930ed13860ae0d793023c6b4146919ba5a22d6a76c2d3392741f44ceed787d"
|
||||
python-versions = "^3.9.0"
|
||||
content-hash = "820b33a1587d31b4b79454417b4d956367867accd253129f562579e1afc88f62"
|
||||
|
||||
@@ -9,7 +9,8 @@ repository = "https://www.github.com/langchain-ai/langgraph"
|
||||
packages = [{ include = "langgraph" }]
|
||||
|
||||
[tool.poetry.dependencies]
|
||||
python = "^3.9.0,<4.0"
|
||||
python = "^3.9.0"
|
||||
langgraph-checkpoint = "^1.0.0"
|
||||
aiosqlite = "^0.20.0"
|
||||
|
||||
[tool.poetry.group.dev.dependencies]
|
||||
|
||||
@@ -11,7 +11,6 @@ from typing import (
|
||||
List,
|
||||
NamedTuple,
|
||||
Optional,
|
||||
TypedDict,
|
||||
Union,
|
||||
overload,
|
||||
)
|
||||
@@ -31,6 +30,7 @@ from langgraph_sdk.schema import (
|
||||
MultitaskStrategy,
|
||||
OnConflictBehavior,
|
||||
Run,
|
||||
RunCreate,
|
||||
StreamMode,
|
||||
Thread,
|
||||
ThreadState,
|
||||
@@ -40,23 +40,8 @@ from langgraph_sdk.schema import (
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class RunCreate(TypedDict):
|
||||
"""Payload for creating a background run."""
|
||||
|
||||
thread_id: Optional[str]
|
||||
assistant_id: str
|
||||
input: Optional[dict]
|
||||
metadata: Optional[dict]
|
||||
config: Optional[Config]
|
||||
checkpoint_id: Optional[str]
|
||||
interrupt_before: Optional[list[str]]
|
||||
interrupt_after: Optional[list[str]]
|
||||
webhook: Optional[str]
|
||||
multitask_strategy: Optional[MultitaskStrategy]
|
||||
|
||||
|
||||
def get_client(
|
||||
*, url: str = "http://localhost:8123", api_key: Optional[str] = None
|
||||
*, url: Optional[str] = None, api_key: Optional[str] = None
|
||||
) -> LangGraphClient:
|
||||
"""Get a LangGraphClient instance.
|
||||
|
||||
@@ -69,6 +54,17 @@ def get_client(
|
||||
3. LANGSMITH_API_KEY
|
||||
4. LANGCHAIN_API_KEY
|
||||
"""
|
||||
transport: Optional[httpx.AsyncBaseTransport] = None
|
||||
if url is None:
|
||||
try:
|
||||
from langgraph_api.server import app # type: ignore
|
||||
|
||||
url = "http://api"
|
||||
transport = httpx.ASGITransport(app, root_path="/noauth")
|
||||
except Exception:
|
||||
url = "http://localhost:8123"
|
||||
if transport is None:
|
||||
transport = httpx.AsyncHTTPTransport(retries=5)
|
||||
headers = {
|
||||
"User-Agent": f"langgraph-sdk-py/{langgraph_sdk.__version__}",
|
||||
}
|
||||
@@ -77,7 +73,7 @@ def get_client(
|
||||
headers["x-api-key"] = api_key
|
||||
client = httpx.AsyncClient(
|
||||
base_url=url,
|
||||
transport=httpx.AsyncHTTPTransport(retries=5),
|
||||
transport=transport,
|
||||
timeout=httpx.Timeout(connect=5, read=60, write=60, pool=5),
|
||||
headers=headers,
|
||||
)
|
||||
|
||||
@@ -133,3 +133,18 @@ class Cron(TypedDict):
|
||||
"""The last time the cron was updated."""
|
||||
payload: dict
|
||||
"""The run payload to use for creating new run."""
|
||||
|
||||
|
||||
class RunCreate(TypedDict):
|
||||
"""Payload for creating a background run."""
|
||||
|
||||
thread_id: Optional[str]
|
||||
assistant_id: str
|
||||
input: Optional[dict]
|
||||
metadata: Optional[dict]
|
||||
config: Optional[Config]
|
||||
checkpoint_id: Optional[str]
|
||||
interrupt_before: Optional[list[str]]
|
||||
interrupt_after: Optional[list[str]]
|
||||
webhook: Optional[str]
|
||||
multitask_strategy: Optional[MultitaskStrategy]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[tool.poetry]
|
||||
name = "langgraph-sdk"
|
||||
version = "0.1.26"
|
||||
version = "0.1.27"
|
||||
description = "SDK for interacting with LangGraph API"
|
||||
authors = []
|
||||
license = "MIT"
|
||||
|
||||
Reference in New Issue
Block a user