UNPKG

taskforce-aiagent

Version:

TaskForce is a modular, open-source, production-ready TypeScript agent framework for orchestrating AI agents, LLM-powered autonomous agents, task pipelines, dynamic toolchains, RAG workflows and memory/retrieval systems.

73 lines (72 loc) 2.98 kB
import { GenerationOptions } from "../llm/aiClient.js"; import { LLMModel } from "../configs/aiConfig.js"; import { ToolExecutor } from "../tools/toolWorker/toolExecutor.js"; import { Tool } from "../tools/base/baseTool.js"; import { VectorMemoryProvider } from "../memory/vectorMemoryProviders/vectorMemoryProvider.js"; import { ExecutionMode, MemoryScope, SupportedModel } from "../configs/enum.js"; import { Retriever } from "../memory/retrievals/retrieval.interface.js"; import { AgentTrainingResult } from "../agentTraining/agentTraining.types.js"; import { TaskForce } from "../engine/taskForce.js"; export declare class Agent { name: string; role: string; goal: string; backstory: string; model?: SupportedModel | string; /** * @param modelOptions Generation options for the underlying LLM (e.g., temperature, top_p, etc.) * @example * modelOptions: { * temperature: 0.2, * top_p: 0.95 * } * * @note These settings may be ignored if the selected model does not support them. For best compatibility, use OpenAI models like gpt-4 or gpt-3.5. * * @see See full compatibility chart in docs/agents/README.md#generation-options-compatibility */ modelOptions?: GenerationOptions; tools?: (Tool | (new () => Tool) | (() => Tool))[]; guardrails?: string[]; memoryScope?: MemoryScope; memoryProvider?: VectorMemoryProvider; systemPrompt?: string; allowDelegation: boolean; retriever?: Retriever; readonly llmModel: LLMModel; private delegationCount; private readonly MAX_DELEGATION; private agentTools; toolExecutor: ToolExecutor; private verbose; private delegationDisallowed?; trained?: AgentTrainingResult; autoTruncateHistory?: boolean; constructor(agent: { name: string; role: string; goal: string; backstory: string; model?: SupportedModel | string; modelOptions?: GenerationOptions; tools?: (Tool | (new () => Tool) | (() => Tool))[]; guardrails?: string[]; memoryScope?: MemoryScope; systemPrompt?: string; allowDelegation?: boolean; memoryProvider?: VectorMemoryProvider; retriever?: Retriever; trainingPath?: string; taskForce?: TaskForce; autoTruncateHistory?: boolean; }); isClassConstructor(func: any): func is new () => Tool; setDelegationDisallowed(disallowed: boolean): void; getDelegationDisallowed(): boolean | undefined; setVerbose(verbose: boolean): void; getVerbose(): boolean; canUseTools(): boolean; canDelegate(): boolean; incrementDelegation(): void; runTask(inputs: Record<string, string>, taskDescription: string, outputFormat?: string, inputFromPrevious?: string, retryReason?: string, delegateReason?: string, rePlanReason?: string, executionMode?: ExecutionMode, retriever?: Retriever, isTraining?: boolean): Promise<string>; }