UNPKG

auto-gpt-ts

Version:

my take of Auto-GPT in typescript

49 lines 3.52 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.buildDefaultPromptGenerator = exports.DEFAULT_TRIGGERING_PROMPT = exports.REMINDER_PROMPT = exports.responseFormat = void 0; const prompt_base_1 = require("./prompt-base"); exports.responseFormat = { thoughts: { text: "thought", reasoning: "reasoning", plan: "- short bulleted\n- list that conveys\n- long-term plan", criticism: "constructive self-criticism", speak: "thoughts summary to say to user", }, command: { name: "command name", args: { "arg name": "value" } }, }; exports.REMINDER_PROMPT = `Response Format: \n${JSON.stringify(exports.responseFormat, null, 4)} \nEnsure the response can be parsed by javascript JSON.parse.\n Please respond using the format specified above: `; exports.DEFAULT_TRIGGERING_PROMPT = `Determine which next command to use, and respond using the format specified above: `; /** * This function generates a prompt string that includes various constraints, * commands, resources, and performance evaluations. */ const buildDefaultPromptGenerator = (promptGenerator = new prompt_base_1.PromptGenerator()) => { // Add constraints to the PromptGenerator object promptGenerator.addConstraint(`~4000 word limit for short term memory. Your short term memory is short, so` + ` immediately save important information to files.`); promptGenerator.addConstraint(`If you are unsure how you previously did something or want to recall past` + ` events, thinking about similar events will help you remember.`); ///************************************************* */ promptGenerator.addConstraint(`If you are unsure how you execute a goal, searching google might help.`); promptGenerator.addConstraint(`If a task is too difficult, you can delegate it to an agent.`); promptGenerator.addConstraint(`If a task is too complicated, break it down into smaller tasks, and pass it to different agents.`); promptGenerator.addConstraint(`don't suggest solutions to the user, execute them yourself`); //************************************************************* */ promptGenerator.addConstraint(`No user assistance`); promptGenerator.addConstraint(`Exclusively use the commands listed in double quotes e.g. "command name"`); // Add resources to the PromptGenerator object promptGenerator.addResource(`Internet access for searches and information gathering.`); promptGenerator.addResource(`Long Term memory management.`); promptGenerator.addResource(`GPT-3.5 powered Agents for delegation of simple tasks.`); promptGenerator.addResource(`File output.`); // Add performance evaluations to the PromptGenerator object promptGenerator.addPerformanceEvaluation(`Continuously review and analyze your actions to ensure you are performing to`, ` the best of your abilities.`); promptGenerator.addPerformanceEvaluation(`Constructively self-criticize your big-picture behavior constantly.`); promptGenerator.addPerformanceEvaluation(`Reflect on past decisions and strategies to refine your approach.`); promptGenerator.addPerformanceEvaluation(`Every command has a cost, so be smart and efficient. Aim to complete tasks in`, ` the least number of steps.`); promptGenerator.addPerformanceEvaluation(`Write all code to a file`); return promptGenerator; }; exports.buildDefaultPromptGenerator = buildDefaultPromptGenerator; //# sourceMappingURL=prompt-generator.js.map