gpt_engineer.core.default.simple_agent.SimpleAgent

class gpt_engineer.core.default.simple_agent.SimpleAgent(memory: MutableMapping[str | Path, str], execution_env: BaseExecutionEnv, ai: AI = None, preprompts_holder: PrepromptsHolder = None)[source]

Bases: BaseAgent

An agent that uses AI to generate and improve code based on a given prompt.

This agent is capable of initializing a codebase from a prompt and improving an existing codebase based on user input. It uses an AI model to generate and refine code, and it interacts with a repository and an execution environment to manage and execute the code.

memory

The memory interface where the code and related data are stored.

Type:

BaseMemory

execution_env

The execution environment in which the code is executed.

Type:

BaseExecutionEnv

ai

The AI model used for generating and improving code.

Type:

AI

preprompts_holder

The holder for preprompt messages that guide the AI model.

Type:

PrepromptsHolder

improve(files_dict: FilesDict, prompt: Prompt, execution_command: str | None = None) FilesDict[source]
init(prompt: Prompt) FilesDict[source]
classmethod with_default_config(path: str, ai: AI = None, preprompts_holder: PrepromptsHolder = None)[source]