From 3e8be7fd796b99cb1e3f7605144e92e6efd299ed Mon Sep 17 00:00:00 2001 From: bracesproul Date: Thu, 3 Oct 2024 09:40:10 -0700 Subject: [PATCH 1/2] fix(js): Add afterSeconds run arg --- libs/sdk-js/src/client.ts | 3 +++ libs/sdk-js/src/types.ts | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/libs/sdk-js/src/client.ts b/libs/sdk-js/src/client.ts index 07125ee9f..3f2d99edd 100644 --- a/libs/sdk-js/src/client.ts +++ b/libs/sdk-js/src/client.ts @@ -677,6 +677,7 @@ export class RunsClient extends BaseClient { multitask_strategy: payload?.multitaskStrategy, on_completion: payload?.onCompletion, on_disconnect: payload?.onDisconnect, + after_seconds: payload?.afterSeconds, }; const endpoint = @@ -755,6 +756,7 @@ export class RunsClient extends BaseClient { webhook: payload?.webhook, checkpoint_id: payload?.checkpointId, multitask_strategy: payload?.multitaskStrategy, + after_seconds: payload?.afterSeconds, }; return this.fetch(`/threads/${threadId}/runs`, { method: "POST", @@ -823,6 +825,7 @@ export class RunsClient extends BaseClient { multitask_strategy: payload?.multitaskStrategy, on_completion: payload?.onCompletion, on_disconnect: payload?.onDisconnect, + after_seconds: payload?.afterSeconds, }; const endpoint = threadId == null ? `/runs/wait` : `/threads/${threadId}/runs/wait`; diff --git a/libs/sdk-js/src/types.ts b/libs/sdk-js/src/types.ts index b044d57bd..aba80405d 100644 --- a/libs/sdk-js/src/types.ts +++ b/libs/sdk-js/src/types.ts @@ -84,6 +84,12 @@ interface RunsInvokePayload { * - "continue": Continue the run. */ onDisconnect?: DisconnectMode; + + /** + * The number of seconds to wait before starting the run. + * Use to schedule future runs. + */ + afterSeconds?: number; } export interface RunsStreamPayload extends RunsInvokePayload { From 92e75aac17ce1b8960c0d45be615159e93759604 Mon Sep 17 00:00:00 2001 From: bracesproul Date: Thu, 3 Oct 2024 09:40:37 -0700 Subject: [PATCH 2/2] cr --- libs/sdk-js/src/types.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/sdk-js/src/types.ts b/libs/sdk-js/src/types.ts index aba80405d..c3ca16ef0 100644 --- a/libs/sdk-js/src/types.ts +++ b/libs/sdk-js/src/types.ts @@ -84,7 +84,7 @@ interface RunsInvokePayload { * - "continue": Continue the run. */ onDisconnect?: DisconnectMode; - + /** * The number of seconds to wait before starting the run. * Use to schedule future runs.