Skip to content

Commit 2e4711c

Browse files
committed
init
1 parent ec989ec commit 2e4711c

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

apps/web-v2/src/features/agent-inbox/contexts/ThreadContext.tsx

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ type ThreadContentType<
3535
_response: HumanResponse[],
3636
_options?: {
3737
stream?: TStream;
38+
afterSeconds?: number;
3839
},
3940
) => TStream extends true
4041
?
@@ -406,6 +407,7 @@ function ThreadsProviderInternal<
406407
response: HumanResponse[],
407408
options?: {
408409
stream?: TStream;
410+
afterSeconds?: number;
409411
},
410412
): TStream extends true
411413
?
@@ -432,19 +434,20 @@ function ThreadsProviderInternal<
432434
const client = createClient(deploymentId, session.accessToken);
433435

434436
try {
437+
const payload = {
438+
command: {
439+
resume: response,
440+
},
441+
...(options?.afterSeconds && { afterSeconds: options.afterSeconds }),
442+
};
443+
435444
if (options?.stream) {
436445
return client.runs.stream(threadId, assistantId, {
437-
command: {
438-
resume: response,
439-
},
446+
...payload,
440447
streamMode: "events",
441448
}) as any; // Type assertion needed due to conditional return type
442449
}
443-
return client.runs.create(threadId, assistantId, {
444-
command: {
445-
resume: response,
446-
},
447-
}) as any; // Type assertion needed due to conditional return type
450+
return client.runs.create(threadId, assistantId, payload) as any; // Type assertion needed due to conditional return type
448451
} catch (e: any) {
449452
logger.error("Error sending human response", e);
450453
throw e;

0 commit comments

Comments
 (0)