///
import { PromptFunctions, PromptMemory, PromptSection, Tokenizer } from "promptrix";
import { PromptCompletionModel } from "alphawave";
import { StrictEventEmitter } from "strict-event-emitter-types";
import { EventEmitter } from "events";
import { TaskResponse, AgentThought, Command, TaskContext } from "./types";
import { SchemaBasedCommand } from "./SchemaBasedCommand";
export interface AgentOptions {
model: PromptCompletionModel;
context_variable?: string;
prompt: string | string[] | PromptSection;
agent_variable?: string;
functions?: PromptFunctions;
history_variable?: string;
initial_thought?: AgentThought;
input_variable?: string;
logRepairs?: boolean;
max_history_messages?: number;
max_repair_attempts?: number;
max_steps?: number;
max_time?: number;
memory?: PromptMemory;
retry_invalid_responses?: boolean;
step_delay?: number;
tokenizer?: Tokenizer;
}
export interface ConfiguredAgentOptions {
agent_variable: string;
model: PromptCompletionModel;
context_variable: string;
functions: PromptFunctions;
history_variable: string;
initial_thought: AgentThought | undefined;
input_variable: string;
logRepairs: boolean;
max_history_messages: number;
max_repair_attempts: number;
max_steps: number;
max_time: number;
memory: PromptMemory;
prompt: string | string[] | PromptSection;
retry_invalid_responses: boolean;
step_delay: number;
tokenizer: Tokenizer;
}
export interface AgentCommandInput {
agentId: string;
input: string;
}
export interface AgentState {
totalSteps: number;
context?: string;
child?: {
agentId: string;
title: string;
};
}
export interface AgentEvents {
newThought: (thought: AgentThought) => void;
beforeCommand: (command: Command, input: Record) => void;
afterCommand: (command: Command, input: Record, response: any) => void;
}
export type AgentEmitter = StrictEventEmitter;
export declare class Agent extends SchemaBasedCommand {
private readonly _commands;
private readonly _options;
private readonly _events;
constructor(options: AgentOptions, title?: string, description?: string);
get events(): AgentEmitter;
get functions(): PromptFunctions;
get memory(): PromptMemory;
get options(): ConfiguredAgentOptions;
get model(): PromptCompletionModel;
get tokenizer(): Tokenizer;
addCommand(command: Command): this;
getCommand(title: string): Command | undefined;
hasCommand(title: string): boolean;
completeTask(input?: string, context?: TaskContext): Promise;
private completeTaskImpl;
execute(context: TaskContext, input: AgentCommandInput): Promise;
getAgentState(agentId?: string): AgentState;
setAgentState(state: AgentState, agentId?: string): void;
getAgentHistoryVariable(agentId?: string): string;
private executeNextStep;
private executeCommand;
}
//# sourceMappingURL=Agent.d.ts.map