From 4702dc627d76deec7f4fa7ca81c1ea501f067715 Mon Sep 17 00:00:00 2001 From: isamu Date: Sun, 29 Dec 2024 14:56:37 +0900 Subject: [PATCH] Separate namespace of config for each agent --- packages/graphai/src/node.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/graphai/src/node.ts b/packages/graphai/src/node.ts index 6046c6cf..12453138 100644 --- a/packages/graphai/src/node.ts +++ b/packages/graphai/src/node.ts @@ -78,6 +78,7 @@ export class ComputedNode extends Node { public readonly params: NodeDataParams; // Agent-specific parameters private readonly filterParams: AgentFilterParams; public readonly nestedGraph?: GraphData | DataSource; + private readonly config?: any; public readonly retryLimit: number; public retryCount: number = 0; private readonly agentId?: string; @@ -120,6 +121,7 @@ export class ComputedNode extends Node { const agent = data.agent; this.agentFunction = async ({ namedInputs, params }) => agent(namedInputs, params); } + this.config = this.agentId ? (this.graph.config ?? {})[this.agentId] ?? {} : {}, this.anyInput = data.anyInput ?? false; this.inputs = data.inputs;