Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion typescript-sdk/integrations/langgraph/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
},
"dependencies": {
"@langchain/core": "^0.3.66",
"@langchain/langgraph-sdk": "^0.0.105",
"@langchain/langgraph-sdk": "^0.1.2",
"partial-json": "^0.1.7",
"rxjs": "7.8.1"
},
Expand Down
13 changes: 11 additions & 2 deletions typescript-sdk/integrations/langgraph/src/agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,10 @@ export class LangGraphAgent extends AbstractAgent {
streamMode,
input: payloadInput,
config: payloadConfig,
context: {
...context,
...(payloadConfig?.configurable ?? {}),
}
};

// If there are still outstanding unresolved interrupts, we must force resolution of them before moving forward
Expand Down Expand Up @@ -947,11 +951,15 @@ export class LangGraphAgent extends AbstractAgent {
try {
const graphSchema = await this.client.assistants.getSchemas(this.assistant!.assistant_id);
let configSchema = null;
let contextSchema: string[] = []
if ('context_schema' in graphSchema && graphSchema.context_schema?.properties) {
contextSchema = Object.keys(graphSchema.context_schema.properties);
}
if (graphSchema.config_schema?.properties) {
configSchema = Object.keys(graphSchema.config_schema.properties);
}
if (!graphSchema.input_schema?.properties || !graphSchema.output_schema?.properties) {
return { config: [], input: null, output: null };
return { config: [], input: null, output: null, context: contextSchema };
}
const inputSchema = Object.keys(graphSchema.input_schema.properties);
const outputSchema = Object.keys(graphSchema.output_schema.properties);
Expand All @@ -963,10 +971,11 @@ export class LangGraphAgent extends AbstractAgent {
outputSchema && outputSchema.length
? [...outputSchema, ...this.constantSchemaKeys]
: null,
context: contextSchema,
config: configSchema,
};
} catch (e) {
return { config: [], input: this.constantSchemaKeys, output: this.constantSchemaKeys };
return { config: [], input: this.constantSchemaKeys, output: this.constantSchemaKeys, context: [] };
}
}

Expand Down
1 change: 1 addition & 0 deletions typescript-sdk/integrations/langgraph/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export interface StateEnrichment {
export type SchemaKeys = {
input: string[] | null;
output: string[] | null;
context: string[] | null;
config: string[] | null;
} | null;

Expand Down
30 changes: 22 additions & 8 deletions typescript-sdk/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading