crewai-ts
Version:
TypeScript port of crewAI for agent-based workflows
55 lines • 1.96 kB
TypeScript
/**
* Agent Builder
* Concrete implementation of BaseAgentBuilder for creating optimized agents
*/
import { BaseAgentBuilder } from './BaseAgentBuilder.js';
import { AgentConfig, BaseAgent, TaskExecutionResult } from '../BaseAgent.js';
import { BaseTool } from '../../tools/BaseTool.js';
import { Task } from '../../task/Task.js';
/**
* Complete agent implementation with optimized execution and memory management
*/
export declare class AgentBuilder extends BaseAgentBuilder {
private agentExecutor?;
private executionStats;
/**
* Constructor for the AgentBuilder
* @param config Configuration for the agent
*/
constructor(config: AgentConfig);
/**
* Execute a task with this agent
* Optimized with token tracking and efficient resource usage
* @param task Task to execute
* @param context Additional context for the task
* @param tools Optional tools for the task
*/
executeTask(task: Task, context?: string, tools?: BaseTool[]): Promise<TaskExecutionResult>;
/**
* Get tools for delegating tasks to other agents
* Creates optimized tool representations of other agents
* @param agents Agents that can be delegated to
*/
getDelegationTools(agents: BaseAgent[]): BaseTool[];
/**
* Create a deep copy of the Agent
* Optimized to avoid unnecessary duplication of resources
*/
copy(): AgentBuilder;
/**
* Create an agent executor for the agent
* This is lazily initialized when needed with optimizations for reuse
* @param tools Optional tools to use
* @param task Optional task to execute
*/
protected createAgentExecutor(tools?: BaseTool[], task?: Task): Promise<any>;
/**
* Reset execution stats for a new execution
*/
private resetExecutionStats;
/**
* Get the execution time in milliseconds
*/
private getExecutionTime;
}
//# sourceMappingURL=AgentBuilder.d.ts.map