AI-Engineer-Foundation / agent-protocol

Common interface for interacting with AI agents. The protocol is tech stack agnostic - you can use it with any framework for building agents.
https://agentprotocol.ai
MIT License
999 stars 120 forks source link

RFC: Output for New Task #102

Open nalbion opened 9 months ago

nalbion commented 9 months ago

Output for New Task

Feature name Output for New Task
Author(s) Nicholas Albion (nalbion@yahoo.com)
RFC PR: Leave blank
Updated 2024-02-11

Summary

POST /ap/v1/agent/task should allow an output

Motivation

I struggle to understand how people would be using POST /ap/v1/agent/task, which accepts an optional (!!) input but allows for no output. Can you imagine calling somebody on the phone and the person at the other end picks up, but doesn't say anything? You generally want to hear "Hi, thanks for calling XYZ, if you're calling about ..." - or atleast "Hello..."

An agent could:

Agent Builders Benefit

Agents would be able to provide a welcome message, guiding the user on what to say first.

This allows for greater flexibility & more options:

task.inputtask.ouputcomments
Write the word 'Washington' to a .txt file" undefined AutoGPT logs `task.input`.
User initiates conversation in `POST /agent/task/id/step`
Write the word 'Washington' to a .txt file" "Sorry, I'm unable to write to files" Agent responds to `task.input`
maybe sets `"is_last": true`?
undefined "Hi, welcome to XYZ bank, can we start with your account number?" Agent initiates with welcome prompt
undefined undefined User initiates conversation in `POST /agent/task/id/step`

Design Proposal

Alternatives Considered

Compatibility

AutoGPT seems to be sending the same message to createTask() and sendChatMessage() in chat_view.dart#L126:

                  if (widget.viewModel.currentTaskId != null) {
...
                  } else {
                    String newTaskId = await taskViewModel.createTask(message);
                    widget.viewModel.setCurrentTaskId(newTaskId);
                    widget.viewModel.sendChatMessage(
                        (message == "") ? null : message,

In ForgeAgent they suggest that in create_task you might just log the task.input.

   async def create_task(self, task_request: TaskRequestBody) -> Task:
        """
        The agent protocol, which is the core of the Forge, works by creating a task and then
        executing steps for that task. This method is called when the agent is asked to create
        a task.

        We are hooking into function to add a custom log message. Though you can do anything you
        want here.
        """
        task = await super().create_task(task_request)
        LOG.info(
            f"📦 Task created: {task.task_id} input: {task.input[:40]}{'...' if len(task.input) > 40 else ''}"
        )
        return task

Questions and Discussion Topics

Add open questions or options you require feedback on from the community.

vercel[bot] commented 9 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment | Name | Status | Preview | Comments | Updated (UTC) | | :--- | :----- | :------ | :------- | :------ | | **agentprotocolai** | ⬜️ Ignored ([Inspect](https://vercel.com/ai-engineers-foundation/agentprotocolai/3mvDXrScabDgztGz6kJhgwYRqeRj)) | [Visit Preview](https://agentprotocolai-git-fork-nalbion-bc7a02-ai-engineers-foundation.vercel.app) | | Feb 10, 2024 4:17pm |
nalbion commented 9 months ago

as raised in #63