@@ -333,6 +333,10 @@ export class LangGraphAgent extends AbstractAgent {
333
333
streamMode,
334
334
input : payloadInput ,
335
335
config : payloadConfig ,
336
+ context : {
337
+ ...context ,
338
+ ...( payloadConfig ?. configurable ?? { } ) ,
339
+ }
336
340
} ;
337
341
338
342
// If there are still outstanding unresolved interrupts, we must force resolution of them before moving forward
@@ -947,11 +951,15 @@ export class LangGraphAgent extends AbstractAgent {
947
951
try {
948
952
const graphSchema = await this . client . assistants . getSchemas ( this . assistant ! . assistant_id ) ;
949
953
let configSchema = null ;
954
+ let contextSchema : string [ ] = [ ]
955
+ if ( 'context_schema' in graphSchema && graphSchema . context_schema ?. properties ) {
956
+ contextSchema = Object . keys ( graphSchema . context_schema . properties ) ;
957
+ }
950
958
if ( graphSchema . config_schema ?. properties ) {
951
959
configSchema = Object . keys ( graphSchema . config_schema . properties ) ;
952
960
}
953
961
if ( ! graphSchema . input_schema ?. properties || ! graphSchema . output_schema ?. properties ) {
954
- return { config : [ ] , input : null , output : null } ;
962
+ return { config : [ ] , input : null , output : null , context : contextSchema } ;
955
963
}
956
964
const inputSchema = Object . keys ( graphSchema . input_schema . properties ) ;
957
965
const outputSchema = Object . keys ( graphSchema . output_schema . properties ) ;
@@ -963,10 +971,11 @@ export class LangGraphAgent extends AbstractAgent {
963
971
outputSchema && outputSchema . length
964
972
? [ ...outputSchema , ...this . constantSchemaKeys ]
965
973
: null ,
974
+ context : contextSchema ,
966
975
config : configSchema ,
967
976
} ;
968
977
} catch ( e ) {
969
- return { config : [ ] , input : this . constantSchemaKeys , output : this . constantSchemaKeys } ;
978
+ return { config : [ ] , input : this . constantSchemaKeys , output : this . constantSchemaKeys , context : [ ] } ;
970
979
}
971
980
}
972
981
0 commit comments