Skip to content

Commit 83ed806

Browse files
cr
1 parent bae1d06 commit 83ed806

File tree

3 files changed

+2
-9
lines changed

3 files changed

+2
-9
lines changed

libs/langchain/src/agents/middlewareAgent/ReactAgent.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -114,14 +114,6 @@ export class ReactAgent<
114114
...middlewareTools,
115115
];
116116

117-
/**
118-
* append tools from middleware
119-
*/
120-
const middlewareTools = (this.options.middleware
121-
?.filter((m) => m.tools)
122-
.flatMap((m) => m.tools) ?? []) as (ClientTool | ServerTool)[];
123-
toolClasses.push(...middlewareTools);
124-
125117
/**
126118
* If any of the tools are configured to return_directly after running,
127119
* our graph needs to check if these were called

libs/langchain/src/agents/middlewareAgent/nodes/AgentNode.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ export class AgentNode<
162162
/**
163163
* there can only be one provider strategy
164164
*/
165-
strategy: strategies[0],
165+
strategy: strategies[0] as ProviderStrategy,
166166
};
167167
}
168168

libs/langchain/src/agents/middlewareAgent/nodes/middleware.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ export abstract class MiddlewareNode<
7676
writer: config?.writer,
7777
interrupt: config?.interrupt,
7878
signal: config?.signal,
79+
tools: this.middleware.tools ?? [],
7980
terminate: (
8081
result?: Partial<TStateSchema> | Error
8182
): ControlAction<TStateSchema> => {

0 commit comments

Comments
 (0)