UNPKG

agentlang

Version:

The easiest way to build the most reliable AI agents - enterprise-grade teams of AI agents that collaborate with each other and humans

68 lines 2.87 kB
import { Environment } from '../interpreter.js'; import { Decision, Instance } from '../module.js'; import { AgentServiceProvider } from '../agents/provider.js'; import { FlowStep } from '../agents/flows.js'; export declare const CoreAIModuleName: string; export declare const AgentEntityName = "Agent"; export declare const LlmEntityName = "LLM"; declare const _default: string; export default _default; export declare const AgentFqName: string; export declare class AgentInstance { llm: string; name: string; moduleName: string; instruction: string; type: string; tools: string | undefined; documents: string | undefined; channels: string | undefined; runWorkflows: boolean; role: string | undefined; flows: string | undefined; validate: string | undefined; retry: string | undefined; private toolsArray; private hasModuleTools; private withSession; private fqName; private decisionExecutor; private retryObj; private addContext; private constructor(); static FromInstance(agentInstance: Instance): AgentInstance; static FromFlowStep(step: FlowStep, flowAgent: AgentInstance, context: string): AgentInstance; static FromDecision(desc: Decision, flowAgent: AgentInstance, context: string): AgentInstance; swapInstruction(newIns: string): string; disableSession(): AgentInstance; enableSession(): AgentInstance; hasSession(): boolean; isPlanner(): boolean; isFlowExecutor(): boolean; markAsDecisionExecutor(): AgentInstance; isDecisionExecutor(): boolean; private directivesAsString; private getFullInstructions; private static maybeRewriteTemplatePatterns; maybeValidateJsonResponse(response: string | undefined): object | undefined; getFqName(): string; markAsFlowExecutor(): AgentInstance; getScratchNames(): Set<string> | undefined; maybeAddScratchData(env: Environment): AgentInstance; invoke(message: string, env: Environment): Promise<void>; private maybeAddFlowContext; private invokeValidator; private handleValidation; private getValidationEvent; private getExternalToolSpecs; private maybeAddRelevantDocuments; private static ToolsCache; private toolsAsString; } export declare function findAgentByName(name: string, env: Environment): Promise<AgentInstance>; export declare function findProviderForLLM(llmName: string, env: Environment): Promise<AgentServiceProvider>; export declare function findAgentChatSession(chatId: string, env: Environment): Promise<Instance | null>; export declare function saveAgentChatSession(chatId: string, messages: any[], env: Environment): Promise<void>; export declare function agentName(agentInstance: Instance): string; export declare function trimGeneratedCode(code: string | undefined): string; //# sourceMappingURL=ai.d.ts.map