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

Command chaining/piping #6256

Open
Pwuts opened this issue Nov 15, 2023 · 3 comments · May be fixed by #7142
Open

Command chaining/piping #6256

Pwuts opened this issue Nov 15, 2023 · 3 comments · May be fixed by #7142
Labels
AI efficacy command system fridge Items that can't be processed right now but can be of use or inspiration later function: run shell commands

Comments

@Pwuts
Copy link
Member

Pwuts commented Nov 15, 2023

The ability to chain multiple commands or actions together could significantly increase the efficiency of AutoGPT.

Related:

Notes & ideas for implementation

  • Execution MUST stop when a command in the chain fails. In case of an execution tree, the branches other than the failed branch can continue executing.

The simplest way?

The simplest way is probably to amend the current command execution interface to support calling multiple functions which are executed in order, and of which the output can be used as arguments for the next command:

"thoughts": "[thoughts]",
"commands": [
  {
    "name": "get_text_from_webpage",
    "args": {
      "url": "https://en.wikipedia.org/wiki/Otters"
    },
    "outputs": {
      "content": "$otters_content"
    }
  },
  {
    "name": "write_file",
    "args": {
      "content": "$otters_content"
    }
  }
]

Execution tree

More complex, harder to implement and probably more error prone, but worth considering:

"thoughts": "[thoughts]",
"commands": [
  {
    "name": "get_text_from_webpage",
    "args": {
      "url": "https://en.wikipedia.org/wiki/Otters"
    },
    "outputs": {
      "content": "$otters_content",
    },
    "pipe_into": [
      {
        "name": "write_file",
        "args": {
          "content": "$otters_content"
        }
      }
    ]
  }
]

Command interface -> script-like execution

We could profit from totally rethinking the command execution interface. For example, if we implement #6253 + #5132, and we exposed all available commands as functions that can be imported or executed in that environment, it could be as simple as this:

  • User: Please scrape the content of https://en.wikipedia.org/wiki/Otters and write it to a text file```

  • AutoGPT:

    <execute>
    content = get_text_from_webpage("https://en.wikipedia.org/wiki/Otters")
    write_file("otters.txt", content)
    </execute>
    

    I have written the content of the webpage to the file otters.txt!

Currently, it would be more like:

  • User: Please scrape the content of https://en.wikipedia.org/wiki/Otters and write it to a text file```

  • AutoGPT: I will now get the content from the webpage.
    Executing get_text_from_webpage("https://en.wikipedia.org/wiki/Otters")

  • AutoGPT: Now that I have scraped the webpage, I will save the content to a file called otters.txt.
    Executing write_file("otters.txt", "[lots of text/tokens here, very expensive and possibly slow!]")

This is both slower and significantly more expensive, because we're copy-pasting data using an LLM.

Copy link
Contributor

github-actions bot commented Jan 5, 2024

This issue has automatically been marked as stale because it has not had any activity in the last 50 days. You can unstale it by commenting or removing the label. Otherwise, this issue will be closed in 10 days.

@github-actions github-actions bot added the Stale label Jan 5, 2024
Copy link
Contributor

This issue was closed automatically because it has been stale for 10 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jan 25, 2024
@Pwuts Pwuts reopened this Jan 26, 2024
@Pwuts Pwuts removed the Stale label Jan 26, 2024
Copy link
Contributor

github-actions bot commented Apr 3, 2024

This issue has automatically been marked as stale because it has not had any activity in the last 50 days. You can unstale it by commenting or removing the label. Otherwise, this issue will be closed in 10 days.

@github-actions github-actions bot added the Stale label Apr 3, 2024
@Pwuts Pwuts added fridge Items that can't be processed right now but can be of use or inspiration later and removed Stale labels Apr 4, 2024
@Pwuts Pwuts reopened this Jun 29, 2024
@Pwuts Pwuts linked a pull request Jun 29, 2024 that will close this issue
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AI efficacy command system fridge Items that can't be processed right now but can be of use or inspiration later function: run shell commands
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants