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 ,
@@ -212,6 +217,7 @@ export class LangGraphAgent extends AbstractAgent {
212
217
// @ts -ignore
213
218
checkpointId : fork . checkpoint . checkpoint_id ! ,
214
219
streamMode,
220
+ signal : this . abortController . signal ,
215
221
} ;
216
222
return {
217
223
streamResponse : this . client . runs . stream ( threadId , this . assistant . assistant_id , payload ) ,
@@ -330,7 +336,8 @@ export class LangGraphAgent extends AbstractAgent {
330
336
context : {
331
337
...context ,
332
338
...( payloadConfig ?. configurable ?? { } ) ,
333
- }
339
+ } ,
340
+ signal : this . abortController . signal ,
334
341
} ;
335
342
336
343
// 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