File tree Expand file tree Collapse file tree 3 files changed +2
-9
lines changed
libs/langchain/src/agents/middlewareAgent Expand file tree Collapse file tree 3 files changed +2
-9
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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 > => {
You can’t perform that action at this time.
0 commit comments