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

Add API via agent-protocol SDK #5044

Merged
merged 2 commits into from
Jul 24, 2023

Conversation

ValentaTomas
Copy link
Contributor

@ValentaTomas ValentaTomas commented Jul 23, 2023

Background

After a conversation with @merwanehamadi we came up with a minimal agent communication protocol that we think could be useful for the community — if more agents use a universal protocol people can way more easily benchmark, develop, deploy and use agents.

We formalized the spec in a repository and also added SDK wrappers to get rid of the boilerplate when implementing the spec. We also started adding the protocol support to agents like smol developer, beebot and babyagi.

As I mentioned, the spec is minimal — we plan to support workspaces/artifacts and other functionality, but the core has to be usable and make sense, that's why we are starting with a minimal spec and plan to iteratively add more.

Changes

I made changes to the cli_web_app runner that was not actively developed — I reused the original CLI methods and let the user start a server via the agent-protocol package.

The user can then interact (this is the minimal interaction) with the API via POST /tasks for creating a task that AutoGPT should run and POST /agent/tasks/{task_id}/steps for a repeated execution of steps from the AutoGPT loop while optionally adding user_input that the execution can process.
For this, I used a modified run_interaction_loop function that only executes one step of the loop and waits for another API POST /agent/tasks/{task_id}/steps request to continue.

Now the next step is to implement calling this API via a CLI as was the original plan of the CLI web app runner.

Documentation

I need to document the changes and the new functionality.

Test Plan

I still need to thoroughly test these changes.

PR Quality Checklist

  • My pull request is atomic and focuses on a single change.
  • I have thoroughly tested my changes with multiple different prompts.
  • I have considered potential risks and mitigations for my changes.
  • I have documented my changes clearly and comprehensively.
  • I have not snuck in any "extra" small tweaks changes.
  • I have run the following commands against my code to ensure it passes our linters:
    black .
    isort .
    mypy
    autoflake --remove-all-unused-imports --recursive --ignore-init-module-imports --ignore-pass-after-docstring autogpt tests --in-place

@github-actions
Copy link
Contributor

This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request.

@github-actions github-actions bot added conflicts Automatically applied to PRs with merge conflicts size/l and removed conflicts Automatically applied to PRs with merge conflicts labels Jul 23, 2023
@netlify
Copy link

netlify bot commented Jul 23, 2023

Deploy Preview for auto-gpt-docs failed.

Name Link
🔨 Latest commit 49eace4
🔍 Latest deploy log https://app.netlify.com/sites/auto-gpt-docs/deploys/64bd9786acdc0000081b2e2e

@waynehamadi waynehamadi marked this pull request as ready for review July 24, 2023 03:54
@waynehamadi waynehamadi requested a review from collijk as a code owner July 24, 2023 03:54
@waynehamadi
Copy link
Contributor

@ValentaTomas here is how we're going to do this one.
I have a lot of questions about this, I didn't realize there would be an interaction_step and all that.

But I know :

  • e2b has our back if we have any issue.
  • this web server is not even used now.

So let's trust. Let's iterate and adjust.

And we'll ask e2b to help us adjust as we go.

So I am going to merge but see this as an iterative process.

I will write tests against this interface, using agbenchmark.

@waynehamadi waynehamadi merged commit 7b4cd8c into Significant-Gravitas:master Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants