Significant-Gravitas / AutoGPT

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.
https://agpt.co
Other
168.36k stars 44.41k forks source link

Command chaining/piping #6256

Open Pwuts opened 1 year ago

Pwuts commented 1 year ago

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

Related:

Notes & ideas for implementation

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:

Currently, it would be more like:

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

github-actions[bot] commented 10 months ago

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[bot] commented 9 months ago

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

github-actions[bot] commented 7 months ago

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.