feat(sdk-py): Support ids filtering in threads search (#6067)

This commit is contained in:
William FH
2025-09-02 17:49:11 -07:00
committed by GitHub
parent 7cf230defa
commit 6f4c5fefee
3 changed files with 12 additions and 1 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
from langgraph_sdk.auth import Auth
from langgraph_sdk.client import get_client, get_sync_client
__version__ = "0.2.4"
__version__ = "0.2.5"
__all__ = ["Auth", "get_client", "get_sync_client"]
+3
View File
@@ -489,6 +489,9 @@ class ThreadsSearch(typing.TypedDict, total=False):
offset: int
"""Offset for pagination."""
ids: Sequence[UUID] | None
"""typing.Optional list of thread IDs to filter by."""
thread_id: UUID | None
"""typing.Optional thread ID to filter by."""
+8
View File
@@ -1309,6 +1309,7 @@ class ThreadsClient:
*,
metadata: Json = None,
values: Json = None,
ids: Sequence[str] | None = None,
status: ThreadStatus | None = None,
limit: int = 10,
offset: int = 0,
@@ -1323,6 +1324,7 @@ class ThreadsClient:
Args:
metadata: Thread metadata to filter on.
values: State values to filter on.
ids: List of thread IDs to filter by.
status: Thread status to filter on.
Must be one of 'idle', 'busy', 'interrupted' or 'error'.
limit: Limit on number of threads to return.
@@ -1356,6 +1358,8 @@ class ThreadsClient:
payload["metadata"] = metadata
if values:
payload["values"] = values
if ids:
payload["ids"] = ids
if status:
payload["status"] = status
if sort_by:
@@ -4454,6 +4458,7 @@ class SyncThreadsClient:
*,
metadata: Json = None,
values: Json = None,
ids: Sequence[str] | None = None,
status: ThreadStatus | None = None,
limit: int = 10,
offset: int = 0,
@@ -4468,6 +4473,7 @@ class SyncThreadsClient:
Args:
metadata: Thread metadata to filter on.
values: State values to filter on.
ids: List of thread IDs to filter by.
status: Thread status to filter on.
Must be one of 'idle', 'busy', 'interrupted' or 'error'.
limit: Limit on number of threads to return.
@@ -4497,6 +4503,8 @@ class SyncThreadsClient:
payload["metadata"] = metadata
if values:
payload["values"] = values
if ids:
payload["ids"] = ids
if status:
payload["status"] = status
if sort_by: