UNPKG

auto-gpt-ts

Version:

my take of Auto-GPT in typescript

52 lines (51 loc) 1.68 kB
import { Loggable } from "../logging"; import { AIConfig } from "../config/ai-config"; import { Config } from "../config/config"; import { LogCycleHandler } from "../logging/log-cycle"; import { Workspace } from "../workspace/workspace"; import { MemoryProvider } from "../memory/base"; import { Message } from "../llm/base"; export interface Thoughts { reasoning: string; plan: string; thoughts: string; criticism: string; } export interface InteractionState { commandName: string; args: string; parsedArgs?: { [key: string]: any; }; userInput: string; isDone: boolean; } /** * a base agent class that can be extended to create an agent with a specific AI role. */ export declare class Agent extends Loggable { aiName: string; memory: MemoryProvider; fullMessageHistory: Message[]; nextActionCount: number; config: AIConfig; systemPrompt: string; triggeringPrompt: string; summaryMemory: string; lastMemoryIndex: number; workspace: Workspace; created_at: string; cycleCount: number; logCycleHandler: LogCycleHandler; userInput: string; interactionState: InteractionState; cfg: Config; constructor(aiName: string, memory: MemoryProvider, fullMessageHistory: Message[], nextActionCount: number, config: AIConfig, systemPrompt: string, triggeringPrompt: string, workspace_directory: string); private _resolvePathlikeCommandArgs; private getSelfFeedback; protected shouldContinue(): Promise<boolean>; protected onInteractionLoopEnd(): Promise<void>; startInteractionLoop(): Promise<void>; private loopInteraction; private talkToAI; }