mirror of
https://github.com/langchain-ai/langgraph.git
synced 2026-09-12 04:37:51 +02:00
feat(js-sdk): Add status field in search args
This commit is contained in:
@@ -15,6 +15,7 @@ import {
|
||||
SearchItemsResponse,
|
||||
ListNamespaceResponse,
|
||||
Item,
|
||||
ThreadStatus,
|
||||
} from "./schema.js";
|
||||
import { AsyncCaller, AsyncCallerParams } from "./utils/async_caller.js";
|
||||
import {
|
||||
@@ -515,6 +516,11 @@ export class ThreadsClient extends BaseClient {
|
||||
* Offset to start from.
|
||||
*/
|
||||
offset?: number;
|
||||
/**
|
||||
* Thread status to filter on.
|
||||
* Must be one of 'idle', 'busy', 'interrupted' or 'error'.
|
||||
*/
|
||||
status?: ThreadStatus;
|
||||
}): Promise<Thread[]> {
|
||||
return this.fetch<Thread[]>("/threads/search", {
|
||||
method: "POST",
|
||||
@@ -522,6 +528,7 @@ export class ThreadsClient extends BaseClient {
|
||||
metadata: query?.metadata ?? undefined,
|
||||
limit: query?.limit ?? 10,
|
||||
offset: query?.offset ?? 0,
|
||||
status: query?.status,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ type RunStatus =
|
||||
| "timeout"
|
||||
| "interrupted";
|
||||
|
||||
type ThreadStatus = "idle" | "busy" | "interrupted" | "error";
|
||||
export type ThreadStatus = "idle" | "busy" | "interrupted" | "error";
|
||||
|
||||
type MultitaskStrategy = "reject" | "interrupt" | "rollback" | "enqueue";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user