mirror of
https://github.com/langchain-ai/langgraph.git
synced 2026-08-27 01:52:25 +02:00
Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
307f35a204 | ||
|
|
d73902ae76 |
@@ -126,11 +126,3 @@ This NAT gateway will have several static ip addresses depending on the region y
|
||||
| 34.169.88.30 | 34.90.157.44 |
|
||||
| 34.19.93.202 | 34.141.242.180 |
|
||||
| 34.19.34.50 | 34.32.141.108 |
|
||||
| 34.59.244.194 | |
|
||||
| 34.9.99.224 | |
|
||||
| 34.68.27.146 | |
|
||||
| 34.41.178.137 | |
|
||||
| 34.123.151.210 | |
|
||||
| 34.135.61.140 | |
|
||||
| 34.121.166.52 | |
|
||||
| 34.31.121.70 | |
|
||||
|
||||
@@ -1520,6 +1520,73 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/threads/{thread_id}/stream": {
|
||||
"get": {
|
||||
"tags": [
|
||||
"Threads"
|
||||
],
|
||||
"summary": "Join Thread Stream",
|
||||
"description": "This endpoint streams output in real-time from a thread. The stream will include the output of each run executed sequentially on the thread and will remain open indefinitely. It is the responsibility of the calling client to close the connection.",
|
||||
"operationId": "join_thread_stream_threads__thread_id__stream_get",
|
||||
"parameters": [
|
||||
{
|
||||
"description": "The ID of the thread.",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"format": "uuid",
|
||||
"title": "Thread Id",
|
||||
"description": "The ID of the thread."
|
||||
},
|
||||
"name": "thread_id",
|
||||
"in": "path"
|
||||
},
|
||||
{
|
||||
"required": false,
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"title": "Last Event ID",
|
||||
"description": "The ID of the last event received. Used to resume streaming from a specific point. Pass '-' to resume from the beginning."
|
||||
},
|
||||
"name": "Last-Event-ID",
|
||||
"in": "header"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Success",
|
||||
"content": {
|
||||
"text/event-stream": {
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"description": "The server will send a stream of events in SSE format.\n\n**Example event**:\n\nid: 1\n\nevent: message\n\ndata: {}"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"404": {
|
||||
"description": "Not Found",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/ErrorResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"422": {
|
||||
"description": "Validation Error",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/ErrorResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/threads/{thread_id}/runs": {
|
||||
"get": {
|
||||
"tags": [
|
||||
|
||||
@@ -92,14 +92,6 @@ All traffic from deployments created after January 6th 2025 will come through a
|
||||
| 34.169.88.30 | 34.91.238.184 |
|
||||
| 34.19.93.202 | 35.204.101.241 |
|
||||
| 34.19.34.50 | 35.204.48.32 |
|
||||
| 34.59.244.194 | |
|
||||
| 34.9.99.224 | |
|
||||
| 34.68.27.146 | |
|
||||
| 34.41.178.137 | |
|
||||
| 34.123.151.210 | |
|
||||
| 34.135.61.140 | |
|
||||
| 34.121.166.52 | |
|
||||
| 34.31.121.70 | |
|
||||
|
||||
### Custom Postgres
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from langgraph_sdk.auth import Auth
|
||||
from langgraph_sdk.client import get_client, get_sync_client
|
||||
|
||||
__version__ = "0.2.2"
|
||||
__version__ = "0.2.3"
|
||||
|
||||
__all__ = ["Auth", "get_client", "get_sync_client"]
|
||||
|
||||
@@ -991,6 +991,34 @@ class AssistantsClient:
|
||||
params=params,
|
||||
)
|
||||
|
||||
async def count(
|
||||
self,
|
||||
*,
|
||||
metadata: Json = None,
|
||||
graph_id: str | None = None,
|
||||
headers: Mapping[str, str] | None = None,
|
||||
params: QueryParamTypes | None = None,
|
||||
) -> int:
|
||||
"""Count assistants matching filters.
|
||||
|
||||
Args:
|
||||
metadata: Metadata to filter by. Exact match for each key/value.
|
||||
graph_id: Optional graph id to filter by.
|
||||
headers: Optional custom headers to include with the request.
|
||||
params: Optional query parameters to include with the request.
|
||||
|
||||
Returns:
|
||||
int: Number of assistants matching the criteria.
|
||||
"""
|
||||
payload: dict[str, Any] = {}
|
||||
if metadata:
|
||||
payload["metadata"] = metadata
|
||||
if graph_id:
|
||||
payload["graph_id"] = graph_id
|
||||
return await self.http.post(
|
||||
"/assistants/count", json=payload, headers=headers, params=params
|
||||
)
|
||||
|
||||
async def get_versions(
|
||||
self,
|
||||
assistant_id: str,
|
||||
@@ -1340,6 +1368,38 @@ class ThreadsClient:
|
||||
params=params,
|
||||
)
|
||||
|
||||
async def count(
|
||||
self,
|
||||
*,
|
||||
metadata: Json = None,
|
||||
values: Json = None,
|
||||
status: ThreadStatus | None = None,
|
||||
headers: Mapping[str, str] | None = None,
|
||||
params: QueryParamTypes | None = None,
|
||||
) -> int:
|
||||
"""Count threads matching filters.
|
||||
|
||||
Args:
|
||||
metadata: Thread metadata to filter on.
|
||||
values: State values to filter on.
|
||||
status: Thread status to filter on.
|
||||
headers: Optional custom headers to include with the request.
|
||||
params: Optional query parameters to include with the request.
|
||||
|
||||
Returns:
|
||||
int: Number of threads matching the criteria.
|
||||
"""
|
||||
payload: dict[str, Any] = {}
|
||||
if metadata:
|
||||
payload["metadata"] = metadata
|
||||
if values:
|
||||
payload["values"] = values
|
||||
if status:
|
||||
payload["status"] = status
|
||||
return await self.http.post(
|
||||
"/threads/count", json=payload, headers=headers, params=params
|
||||
)
|
||||
|
||||
async def copy(
|
||||
self,
|
||||
thread_id: str,
|
||||
@@ -2855,6 +2915,34 @@ class CronClient:
|
||||
"/runs/crons/search", json=payload, headers=headers, params=params
|
||||
)
|
||||
|
||||
async def count(
|
||||
self,
|
||||
*,
|
||||
assistant_id: str | None = None,
|
||||
thread_id: str | None = None,
|
||||
headers: Mapping[str, str] | None = None,
|
||||
params: QueryParamTypes | None = None,
|
||||
) -> int:
|
||||
"""Count cron jobs matching filters.
|
||||
|
||||
Args:
|
||||
assistant_id: Assistant ID to filter by.
|
||||
thread_id: Thread ID to filter by.
|
||||
headers: Optional custom headers to include with the request.
|
||||
params: Optional query parameters to include with the request.
|
||||
|
||||
Returns:
|
||||
int: Number of crons matching the criteria.
|
||||
"""
|
||||
payload: dict[str, Any] = {}
|
||||
if assistant_id:
|
||||
payload["assistant_id"] = assistant_id
|
||||
if thread_id:
|
||||
payload["thread_id"] = thread_id
|
||||
return await self.http.post(
|
||||
"/runs/crons/count", json=payload, headers=headers, params=params
|
||||
)
|
||||
|
||||
|
||||
class StoreClient:
|
||||
"""Client for interacting with the graph's shared storage.
|
||||
@@ -3974,6 +4062,34 @@ class SyncAssistantsClient:
|
||||
params=params,
|
||||
)
|
||||
|
||||
def count(
|
||||
self,
|
||||
*,
|
||||
metadata: Json = None,
|
||||
graph_id: str | None = None,
|
||||
headers: Mapping[str, str] | None = None,
|
||||
params: QueryParamTypes | None = None,
|
||||
) -> int:
|
||||
"""Count assistants matching filters.
|
||||
|
||||
Args:
|
||||
metadata: Metadata to filter by. Exact match for each key/value.
|
||||
graph_id: Optional graph id to filter by.
|
||||
headers: Optional custom headers to include with the request.
|
||||
params: Optional query parameters to include with the request.
|
||||
|
||||
Returns:
|
||||
int: Number of assistants matching the criteria.
|
||||
"""
|
||||
payload: dict[str, Any] = {}
|
||||
if metadata:
|
||||
payload["metadata"] = metadata
|
||||
if graph_id:
|
||||
payload["graph_id"] = graph_id
|
||||
return self.http.post(
|
||||
"/assistants/count", json=payload, headers=headers, params=params
|
||||
)
|
||||
|
||||
def get_versions(
|
||||
self,
|
||||
assistant_id: str,
|
||||
@@ -4306,6 +4422,38 @@ class SyncThreadsClient:
|
||||
"/threads/search", json=payload, headers=headers, params=params
|
||||
)
|
||||
|
||||
def count(
|
||||
self,
|
||||
*,
|
||||
metadata: Json = None,
|
||||
values: Json = None,
|
||||
status: ThreadStatus | None = None,
|
||||
headers: Mapping[str, str] | None = None,
|
||||
params: QueryParamTypes | None = None,
|
||||
) -> int:
|
||||
"""Count threads matching filters.
|
||||
|
||||
Args:
|
||||
metadata: Thread metadata to filter on.
|
||||
values: State values to filter on.
|
||||
status: Thread status to filter on.
|
||||
headers: Optional custom headers to include with the request.
|
||||
params: Optional query parameters to include with the request.
|
||||
|
||||
Returns:
|
||||
int: Number of threads matching the criteria.
|
||||
"""
|
||||
payload: dict[str, Any] = {}
|
||||
if metadata:
|
||||
payload["metadata"] = metadata
|
||||
if values:
|
||||
payload["values"] = values
|
||||
if status:
|
||||
payload["status"] = status
|
||||
return self.http.post(
|
||||
"/threads/count", json=payload, headers=headers, params=params
|
||||
)
|
||||
|
||||
def copy(
|
||||
self,
|
||||
thread_id: str,
|
||||
@@ -5781,6 +5929,34 @@ class SyncCronClient:
|
||||
"/runs/crons/search", json=payload, headers=headers, params=params
|
||||
)
|
||||
|
||||
def count(
|
||||
self,
|
||||
*,
|
||||
assistant_id: str | None = None,
|
||||
thread_id: str | None = None,
|
||||
headers: Mapping[str, str] | None = None,
|
||||
params: QueryParamTypes | None = None,
|
||||
) -> int:
|
||||
"""Count cron jobs matching filters.
|
||||
|
||||
Args:
|
||||
assistant_id: Assistant ID to filter by.
|
||||
thread_id: Thread ID to filter by.
|
||||
headers: Optional custom headers to include with the request.
|
||||
params: Optional query parameters to include with the request.
|
||||
|
||||
Returns:
|
||||
int: Number of crons matching the criteria.
|
||||
"""
|
||||
payload: dict[str, Any] = {}
|
||||
if assistant_id:
|
||||
payload["assistant_id"] = assistant_id
|
||||
if thread_id:
|
||||
payload["thread_id"] = thread_id
|
||||
return self.http.post(
|
||||
"/runs/crons/count", json=payload, headers=headers, params=params
|
||||
)
|
||||
|
||||
|
||||
class SyncStoreClient:
|
||||
"""A client for synchronous operations on a key-value store.
|
||||
|
||||
Reference in New Issue
Block a user