File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
typescript-sdk/integrations/langgraph/src Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -126,6 +126,7 @@ export class LangGraphAgent extends AbstractAgent {
126
126
subscriber : Subscriber < ProcessedEvents > ;
127
127
constantSchemaKeys : string [ ] = DEFAULT_SCHEMA_KEYS ;
128
128
config : LangGraphAgentConfig ;
129
+ abortController = new AbortController ( ) ;
129
130
130
131
constructor ( config : LangGraphAgentConfig ) {
131
132
super ( config ) ;
@@ -160,6 +161,10 @@ export class LangGraphAgent extends AbstractAgent {
160
161
} ) ;
161
162
}
162
163
164
+ abortRun ( ) {
165
+ this . abortController . abort ( ) ;
166
+ }
167
+
163
168
async runAgentStream ( input : RunAgentExtendedInput , subscriber : Subscriber < ProcessedEvents > ) {
164
169
this . activeRun = {
165
170
id : input . runId ,
@@ -213,6 +218,7 @@ export class LangGraphAgent extends AbstractAgent {
213
218
// @ts -ignore
214
219
checkpointId : fork . checkpoint . checkpoint_id ! ,
215
220
streamMode,
221
+ signal : this . abortController . signal ,
216
222
} ;
217
223
return {
218
224
streamResponse : this . client . runs . stream ( threadId , this . assistant . assistant_id , payload ) ,
@@ -331,7 +337,8 @@ export class LangGraphAgent extends AbstractAgent {
331
337
context : {
332
338
...context ,
333
339
...( payloadConfig ?. configurable ?? { } ) ,
334
- }
340
+ } ,
341
+ signal : this . abortController . signal ,
335
342
} ;
336
343
337
344
// If there are still outstanding unresolved interrupts, we must force resolution of them before moving forward
You can’t perform that action at this time.
0 commit comments