mirror of
https://github.com/langchain-ai/langgraph.git
synced 2026-08-31 12:19:58 +02:00
Merge pull request #2237 from langchain-ai/jacob/sdk
feat(sdk-js): Support if_not_exists in SDK runs
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@langchain/langgraph-sdk",
|
||||
"version": "0.0.19",
|
||||
"version": "0.0.20",
|
||||
"description": "Client library for interacting with the LangGraph API",
|
||||
"type": "module",
|
||||
"packageManager": "yarn@1.22.19",
|
||||
|
||||
@@ -160,6 +160,7 @@ export class CronsClient extends BaseClient {
|
||||
interrupt_after: payload?.interruptAfter,
|
||||
webhook: payload?.webhook,
|
||||
multitask_strategy: payload?.multitaskStrategy,
|
||||
if_not_exists: payload?.ifNotExists,
|
||||
};
|
||||
return this.fetch<Run>(`/threads/${threadId}/runs/crons`, {
|
||||
method: "POST",
|
||||
@@ -187,6 +188,7 @@ export class CronsClient extends BaseClient {
|
||||
interrupt_after: payload?.interruptAfter,
|
||||
webhook: payload?.webhook,
|
||||
multitask_strategy: payload?.multitaskStrategy,
|
||||
if_not_exists: payload?.ifNotExists,
|
||||
};
|
||||
return this.fetch<Run>(`/runs/crons`, {
|
||||
method: "POST",
|
||||
@@ -698,6 +700,7 @@ export class RunsClient extends BaseClient {
|
||||
on_completion: payload?.onCompletion,
|
||||
on_disconnect: payload?.onDisconnect,
|
||||
after_seconds: payload?.afterSeconds,
|
||||
if_not_exists: payload?.ifNotExists,
|
||||
};
|
||||
|
||||
const endpoint =
|
||||
@@ -779,6 +782,7 @@ export class RunsClient extends BaseClient {
|
||||
checkpoint_id: payload?.checkpointId,
|
||||
multitask_strategy: payload?.multitaskStrategy,
|
||||
after_seconds: payload?.afterSeconds,
|
||||
if_not_exists: payload?.ifNotExists,
|
||||
};
|
||||
return this.fetch<Run>(`/threads/${threadId}/runs`, {
|
||||
method: "POST",
|
||||
@@ -849,6 +853,7 @@ export class RunsClient extends BaseClient {
|
||||
on_completion: payload?.onCompletion,
|
||||
on_disconnect: payload?.onDisconnect,
|
||||
after_seconds: payload?.afterSeconds,
|
||||
if_not_exists: payload?.ifNotExists,
|
||||
};
|
||||
const endpoint =
|
||||
threadId == null ? `/runs/wait` : `/threads/${threadId}/runs/wait`;
|
||||
|
||||
@@ -95,6 +95,11 @@ interface RunsInvokePayload {
|
||||
* Use to schedule future runs.
|
||||
*/
|
||||
afterSeconds?: number;
|
||||
|
||||
/**
|
||||
* Behavior if the specified run doesn't exist. Defaults to "reject".
|
||||
*/
|
||||
ifNotExists?: "create" | "reject";
|
||||
}
|
||||
|
||||
export interface RunsStreamPayload extends RunsInvokePayload {
|
||||
|
||||
Reference in New Issue
Block a user