()
| 238 | } |
| 239 | |
| 240 | async _callNext(): Promise<Record<string, unknown>> { |
| 241 | // final output already reached: stopiteration (final output) |
| 242 | if (this.finalOutputs) { |
| 243 | throw new Error(`Final outputs already reached: ${JSON.stringify(this.finalOutputs, null, 2)}`) |
| 244 | } |
| 245 | // timeout/max iterations: stopiteration (stopped response) |
| 246 | if (!this.agentExecutor.shouldContinueGetter(this.iterations)) { |
| 247 | return this._stop() |
| 248 | } |
| 249 | const nextStepOutput = await this._executeNextStep(this.runManager) |
| 250 | const output = await this._processNextStepOutput(nextStepOutput, this.runManager) |
| 251 | this.updateIterations() |
| 252 | return output |
| 253 | } |
| 254 | } |
| 255 | |
| 256 | export class AgentExecutor extends BaseChain<ChainValues, AgentExecutorOutput> { |
no test coverage detected