Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate with agentprotocol.ai #683

Closed
AntonOsika opened this issue Sep 7, 2023 · 1 comment
Closed

Integrate with agentprotocol.ai #683

AntonOsika opened this issue Sep 7, 2023 · 1 comment
Labels
duplicate This issue or pull request already exists

Comments

@AntonOsika
Copy link
Owner

AntonOsika commented Sep 7, 2023

gpt-engineer is proud to be supporting AEIF, the foundation behind agent protocol.

Would be nice to be integrated! 🚀

It's quite straightforward, and gives an API and automatic evaluation for gpt-engineer:

  1. Create a file called api.py
  2. Set up a "create task" handler and "access step" handler in there
  3. Only support one "step" in the beginning: Generate a codebase
  4. See below pseudocode for how to do it
from agent_protocol import Agent, Step, Task

def generate_code(task: Task, step: Step) -> Step:
    # only this is gpt-engineer specific
    path = Agent.get_workspace(task.task_id)
    
    dbs = DBs(DB(path / "input"), DB(path / "memory"), ...)
    ai = AI(...)
    for gpte_step in STEPS[StepConfig.simple]:
         gpte_step(ai, dbs)
         
    path = Path("./" + file_path)
    files = chat_to_files(dbs.workspace['all_output.txt'])
    for f, _ in files:
        await Agent.db.create_artifact(
            task_id=task.task_id,
            step_id=step.step_id,
            relative_path= (Path('workspace') / f).parent,
            file_name=Path(f).name
        )
    return step


async def task_handler(task: Task) -> None:
    await Agent.db.create_step(task.task_id, "generate_code")


async def step_handler(step: Step):
    task = await Agent.db.get_task(step.task_id)
    generate_code(task, step)


Agent.setup_agent(task_handler, step_handler).start()
@AntonOsika
Copy link
Owner Author

🚀

@AntonOsika AntonOsika added the duplicate This issue or pull request already exists label Sep 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

1 participant