import { BaseMemory } from '../../memory/base.js'; import { AssistantMessage } from '../../backend/message.js'; import { C as Callback } from '../../emitter-kHxkUxco.js'; import { ToolCallingAgentSystemPrompt, ToolCallingAgentTaskPrompt } from './prompts.js'; import { ZodSchema } from 'zod'; import '../../errors.js'; import '../../internals/types.js'; import '../../internals/helpers/guards.js'; import '../../internals/serializable.js'; import 'ai'; import '../../template.js'; import 'ajv'; /** * Copyright 2025 © BeeAI a Series of LF Projects, LLC * SPDX-License-Identifier: Apache-2.0 */ interface ToolCallingAgentRunInput { prompt?: string; context?: string; expectedOutput?: string | ZodSchema; } interface ToolCallingAgentRunOutput { result: AssistantMessage; memory: BaseMemory; } interface ToolCallingAgentRunState { result?: AssistantMessage; memory: BaseMemory; iteration: number; } interface ToolCallingAgentExecutionConfig { totalMaxRetries?: number; maxRetriesPerStep?: number; maxIterations?: number; } interface ToolCallingAgentRunOptions { signal?: AbortSignal; execution?: ToolCallingAgentExecutionConfig; } interface ToolCallingAgentCallbacks { start?: Callback<{ state: ToolCallingAgentRunState; }>; success?: Callback<{ state: ToolCallingAgentRunState; }>; } interface ToolCallingAgentTemplates { system: typeof ToolCallingAgentSystemPrompt; task: typeof ToolCallingAgentTaskPrompt; } export type { ToolCallingAgentCallbacks, ToolCallingAgentExecutionConfig, ToolCallingAgentRunInput, ToolCallingAgentRunOptions, ToolCallingAgentRunOutput, ToolCallingAgentRunState, ToolCallingAgentTemplates };