Comments (4)
This API also fits well with my StoryManager
concept illustrated in #83
from gpt-pilot.
There's only a partial alignment with the current naming:
GPT Pilot | Agent Protocol |
---|---|
db.model.UserStories | Task |
project.user_stories | |
{app_id}-{i} or {app_id}#{jira/github issue} | task_id |
story title | input |
app_id, user_id, sprint | additional_input |
steps | |
artifacts | |
db.model.DevelopmentSteps | Step |
(just used for replaying?) | |
as above | task_id |
id | step_id |
is_last | |
messages (role=user)? | input |
previous_step? | additional_input |
name | |
status: created/completed | |
messages (role=assistant)? | output |
llm_response | additional_output |
llm_response.function_calls (type=code_change) (not c_c_description?) | artifacts |
artifacts[0].artifact_id | |
name | artifacts[0].file_name |
path | artifacts[0].relative_path |
content | |
db.model.File | Artifact |
{app_id}-id | artifact_id |
name | file_name |
path | relative_path |
full_path | |
description | |
app |
from gpt-pilot.
For maximum compatibility & seamless interaction with arbitrary clients (IDE plugins, web UIs, CLI tools...) the endpoints should make minimal assumptions about how they will be called, other than what is strictly described in the Agent Protocol spec.
My interpretation is that a Task
is simply a container for the client to add Step
s which are a mechanism to interact between the user and AI.
additional_input
can be used for GPT Pilot specific args, config, options etc, but should work with defaults.
Use case: New Project
POST /agent/tasks
{
"input": "chat app"
"additional_input": {}
}
Response:
{
"task_id": "chat_app",
"artifacts": []
}
Use case: "TestWriteFile" benchmark
POST /agent/tasks/chat_app/steps
{
"input": "Write the word 'Washington' to a .txt file"
}
Response:
{
"task_id": "chat_app",
"step_id": "1",
"name": "Implement code change",
"status": "created",
"output": "File `washington.txt` saved to the disk and currently looks like this:\n```\nWashington\n```",
"additional_output": {},
"artifacts": [{
"artifact_id": "1",
"agent_created": true,
"file_name": "washington.txt",
"relative_path": ""
}]
"is_last": true,
}
Use case: "Project description for a non-trivial app"
POST /agent/tasks/chat_app/steps
{
"input": "A simple chat app with real time communication"
}
Response:
{
"task_id": "chat_app",
"step_id": "1",
"name": "Project clarification",
"status": "running or completed?",
"output": "Should the chat app support chat groups as well as one-to-one messaging?",
"additional_output": {},
"artifacts": []
"is_last": false,
}
The conversation continues using POST /agent/tasks/chat_app/steps { "input": prompt }
-> { "output": Pilot/LLM response/question }
UserStory and DevelopmentStep
...so contrary to what I've said above, the Task
is the App
and every user interaction is a Step
. So how can we work with Epic
, Sprint
, Story
and DevelopmentStep
?
Use case: User suggests New Feature as first prompt
POST /agent/tasks/chat_app/steps
{
"input": "Users should be sent a notification when they are tagged in a chat message",
"additional_input": {
},
}
{ "name": "FeatureClarification",
Use case: Schedule sync with Jira/GitHub Issues
For this use case it's acceptable to assume the client has knowledge of additional_input
.
POST /agent/tasks
{
"input": "Implement Agent Protocol",
"additional_input": {
"task_type": "UserStory",
"app_id": "chat_app",
"issue": "89",
"description": "As a 3rd party developer I want to be able to Interact with Pilot Agent from an API so that users can use the agent from their IDE etc",
"comments": [{ "user": "saltman", "message": "Yeah, great idea!" }],
"labels": ["gpt-pilot"],
"milestone": ""
},
}
The TechLead
may use the artifacts
to list BDD scenarios that have been written , or maybe list DevelopmentSteps
?
Response:
{
"task_id": "chat_app#89",
"artifacts": [{
"artifact_id": "chat_app#89-1",
"agent_created": true,
"file_name": "scenario-1.feature",
"relative_path": "features/89-Implement_Agent_Protocol"
}]
}
Use case: SprintManager
dispatches UserStory
to Developer
NOTE it would be possible to have multiple Developer
s distributed in separate processes/machines.
GET /agent/tasks?app_id=chat_app&sprint=1&include=steps&label=gpt-pilot
Could also ask to include artifacts
, but that is probably more useful when testing.
Response:
[{
"task_id": "chat_app#89",
"input": "Implement Agent Protocol",
"additional_input": {
"task_type": "UserStory",
"app_id": "chat_app",
"issue": "89",
"description": "As a 3rd party developer I want to be able to Interact with Pilot Agent from an API so that users can use the agent from their IDE etc",
"comments": [{ "user": "saltman", "message": "Yeah, great idea!" }]
},
"steps": [{...}, ...],
}, ...]
Use case: Client wants to monitor the progress of the DevelopmentSteps
GET /agent/tasks/chat_app/steps/stream?task_type=UserStory
The /stream
suffix is for subscribing to Server Sent Events.
If task_type=UserStory
is not specified, the stream would yield the user interaction steps:
Should the chat app support chat groups as well as one-to-one messaging?
With the task_type=UserStory
, client receives a stream of:
{
"task_id": "chat_app#89", // or "chat_app-1" for in-memory UserStories
"step_id": "1",
"name": "Implement code change",
"status": "created",
"output": "File `washington.txt` saved to the disk and currently looks like this:\n```\nWashington\n```",
"additional_output": {
// line number or diff may be handy
},
"artifacts": [{
"artifact_id": "1",
"agent_created": true,
"file_name": "washington.txt",
"relative_path": ""
}]
"is_last": true,
}
Use case: User interacts with story through conversation
It's simpler for the user (and clients) if the user interacts with the single Project
task chat_app
rather than the UserStory
task.
POST /agent/tasks/chat_app/steps
{
"input": "Issue 89 is done"
}
Issue Manager closes issue #89.
Response:
{
"task_id": "chat_app",
"step_id": "2341234",
"name": "IssueResolved",
"status": "completed",
"output": "That's great",
"additional_output": {
"issue_url": "https://github.com/Pythagora-io/gpt-pilot/issues/89",
"status": "DONE"
},
"artifacts": []
"is_last": true,
}
from gpt-pilot.
Note, the AutoGPT UI sends the same message to the initial POST /task
and POST task/id/steps
. This allows a UX similar to ChatGPT where your first message is used to generate a name for the conversation.
It doesn't allow for the agent to initiate the conversation with an instructional greeting like "what's the project name/description".
We should cater for both scenarios:
- initial task message includes the project description. LLM suggests a name
- Initial task message is empty. Agent prompts for name and description
String newTaskId = await taskViewModel.createTask(message);
widget.viewModel.setCurrentTaskId(newTaskId);
widget.viewModel.sendChatMessage(
(message == "") ? null : message,
continuousModeSteps: Provider.of<SettingsViewModel>(
context,
listen: false)
.continuousModeSteps);
from gpt-pilot.
Related Issues (20)
- [Bug]: HOT 10
- [Bug]: start new project HOT 1
- [Bug]: Error parsing LLM response in a laravel simple project! HOT 7
- [Bug]: can't find python file. HOT 2
- [Bug]: When selecting "Load App", I get a spin wheel. HOT 4
- [Bug]: Crash when running python main.py: MissingGreenlet: greenlet_spawn has not been called HOT 3
- [Bug]: AttributeError: 'SpecWriter' object has no attribute 'telemetry' HOT 2
- [Enhancement]: MS-SQL Support
- [Howto]: i accidently closed the app tab
- [Bug]:After loading the app, the front-end reported an error: Error connecting to the LLM: API error: Error code: 400 - {'error': {'message': 'Unrecognized request argument supplied: stream_options (request id: 20240617162225973326812zW5O0B98)', 'type': 'invalid_request_error', 'param': '', 'code': None}}
- Error connecting to the LLM: Error parsing response: Expected a single code block, got 0[Pythagora] Would you like to retry the failed request?
- [Bug]: KeyError: 'user_feedback_qa' HOT 9
- [Bug]: New claude sonnet adds comments/descriptions into code files, making them unusable HOT 3
- [Bug]: New Claude Sonnet CodeMonkey describes every file in env
- [Bug]: API error: Error code: 400 - {'error': {'message': "Unknown parameter: 'stream_options' HOT 4
- [Enhancement]: Integrate Wiseflow for Dynamic Knowledge Management
- [Bug]: ValueError: Empty message content HOT 3
- [Bug]: HOT 2
- [Enhancement]: Local database in the project's folder HOT 2
- [Bug]: AttributeError: 'NoneType' object has no attribute 'steps' HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gpt-pilot.