@@ -333,6 +333,10 @@ export class LangGraphAgent extends AbstractAgent {
333333 streamMode,
334334 input : payloadInput ,
335335 config : payloadConfig ,
336+ context : {
337+ ...context ,
338+ ...( payloadConfig ?. configurable ?? { } ) ,
339+ }
336340 } ;
337341
338342 // 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 {
947951 try {
948952 const graphSchema = await this . client . assistants . getSchemas ( this . assistant ! . assistant_id ) ;
949953 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+ }
950958 if ( graphSchema . config_schema ?. properties ) {
951959 configSchema = Object . keys ( graphSchema . config_schema . properties ) ;
952960 }
953961 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 } ;
955963 }
956964 const inputSchema = Object . keys ( graphSchema . input_schema . properties ) ;
957965 const outputSchema = Object . keys ( graphSchema . output_schema . properties ) ;
@@ -963,10 +971,11 @@ export class LangGraphAgent extends AbstractAgent {
963971 outputSchema && outputSchema . length
964972 ? [ ...outputSchema , ...this . constantSchemaKeys ]
965973 : null ,
974+ context : contextSchema ,
966975 config : configSchema ,
967976 } ;
968977 } catch ( e ) {
969- return { config : [ ] , input : this . constantSchemaKeys , output : this . constantSchemaKeys } ;
978+ return { config : [ ] , input : this . constantSchemaKeys , output : this . constantSchemaKeys , context : [ ] } ;
970979 }
971980 }
972981
0 commit comments