* Method that checks if the agent execution should continue based on the * number of iterations. * @param iterations The current number of iterations. * @returns A boolean indicating whether the agent execution should continue.
(iterations: number)
| 355 | * @returns A boolean indicating whether the agent execution should continue. |
| 356 | */ |
| 357 | private shouldContinue(iterations: number): boolean { |
| 358 | return this.maxIterations === undefined || iterations < this.maxIterations |
| 359 | } |
| 360 | |
| 361 | async _call(inputs: ChainValues, runManager?: CallbackManagerForChainRun, config?: RunnableConfig): Promise<AgentExecutorOutput> { |
| 362 | const toolsByName = Object.fromEntries(this.tools.map((t) => [t.name?.toLowerCase(), t])) |