UNPKG

auto-gpt-ts

Version:

my take of Auto-GPT in typescript

56 lines (55 loc) 2.02 kB
import { Loggable } from '../logging'; import { AIConfig } from "../config/ai-config"; import { CommandRegistry } from "../commands"; export interface PromptCommand { label: string; name: string; args: object; function?: (...args: any[]) => any; } export declare class PromptGenerator extends Loggable { private constraints; private resources; private performanceEvaluation; commands: PromptCommand[]; commandRegistry: CommandRegistry; goals: string[]; name: string; role: string; private responseFormat; /** * Add a constraint to the constraints list. * @param constraint The constraint to be added. */ addConstraint(...constraints: string[]): void; /** * Add a command to the commands list with a label, name, and optional arguments. * @param commandLabel The label of the command. * @param commandName The name of the command. * @param args A dictionary containing argument names and their values. * @param commandFunction A callable function to be called when the command is executed. */ addCommand(commandLabel: string, commandName: string, args?: any, commandFunction?: (...args: any[]) => any): void; /** * Add a resource to the resources list. * @param resource The resource to be added. */ addResource(resource: string): void; /** * Add a performance evaluation item to the performance_evaluation list. * @param evaluation The evaluation item to be added. */ addPerformanceEvaluation(...evaluation: string[]): void; /** * Generate a prompt string based on the constraints, commands, resources, and performance evaluations. */ generatePromptString(): string[]; /** * Generate a formatted string representation of a command. * @param command */ private generateCommandString; private generateNumberedList; private generateCommandsStrings; } export declare function constructMainAiConfig(): Promise<AIConfig>;