Skip to content

Commit

Permalink
ghost coder is now working, agent protocol running
Browse files Browse the repository at this point in the history
now you can run :
  ` sudo docker-compose up -d mockopenai ghostcoder `
  ` sudo docker-compose logs -f mockopenai ghostcoder &`
  ` sudo docker-compose run arena`
  • Loading branch information
mike dupont committed Oct 19, 2023
1 parent cf5fdd2 commit a7712e6
Show file tree
Hide file tree
Showing 14 changed files with 120 additions and 6 deletions.
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -187,3 +187,9 @@
[submodule "vendor/vikyw89"]
path = vendor/vikyw89
url = https://github.com/vikyw89/Auto-GPT
[submodule "vendor/agent-protocol-client-python"]
path = vendor/agent-protocol-client-python
url = https://github.com/AI-Engineer-Foundation/agent-protocol-client-python
[submodule "vendor/agent-protocol-sdk-python"]
path = vendor/agent-protocol-sdk-python
url = https://github.com/AI-Engineer-Foundation/agent-protocol-sdk-python
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,7 @@ we start with the results of the download of the change stats Auto-GPT/stats/fil
`sudo docker-compose build`
`sudo docker-compose up mockopenai`
`sudo docker-compose run auto-gpt-chat-gpt-prompts `


# Example of verbose build
`sudo docker-compose --progress=plain --log-level DEBUG --ansi=never --verbose build ghostcoder`
8 changes: 7 additions & 1 deletion arena/Dockerfile
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
from debian
from h4ckermike/act_base
add vendor/agent-protocol-client-python/ /opt/agent-protocol
add vendor/agent-protocol-sdk-python/ /opt/agent-protocol-sdk
add arena/agent.json /tmp/
add arena/run.py /tmp/
RUN pip install /opt/agent-protocol
RUN pip install /opt/agent-protocol-sdk
6 changes: 6 additions & 0 deletions arena/agent.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"input":"Write hello",
"additional_input":{
"test_run_id": "123"
}
}
47 changes: 47 additions & 0 deletions arena/run.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import asyncio

from agent_protocol.models import StepRequestBody
from agent_protocol_client import (
Configuration,
ApiClient,
StepRequestBody,
TaskRequestBody,
AgentApi,
)

# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = Configuration(host="http://ghostcoder:8000")


async def main():
# Enter a context with an instance of the API client
async with ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = AgentApi(api_client)
task_request_body = TaskRequestBody(input="Write 'Hello world!' to hi.txt.")

response = await api_instance.create_agent_task(
task_request_body=task_request_body
)
print("The response of AgentApi->create_agent_task:\n")
print(response)
print("\n\n")

task_id = response.task_id
i = 1

while (
step := await api_instance.execute_agent_task_step(
task_id=task_id, step_request_body=StepRequestBody(input=str(i))
)
) and step.is_last is False:
print("The response of AgentApi->execute_agent_task_step:\n")
print(step)
print("\n\n")
i += 1

print("Agent finished its work!")


asyncio.run(main())
6 changes: 6 additions & 0 deletions data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"input":"Write hello",
"additional_input":{
"test_run_id": "123"
}
}
31 changes: 29 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
version: '3'
services:

arena:
depends_on:
- mockopenai
- the_agency_1
- ghostcoder
build:
context : arena
context : .
dockerfile: arena/Dockerfile
#entrypoint: bash -c "curl -d @/tmp/agent.json --request POST http://ghostcoder:8000/ap/v1/agent/tasks "
entrypoint: python /tmp/run.py

act_base: #root base of action
build: vendor/act_base
Expand Down Expand Up @@ -356,3 +360,26 @@ services:
#poetry run agent start forge --setup
#poetry run agbenchmark --mock
#poetry run agbenchmark --test=WriteFile

ghostcoder:
#ports:
# - "8001:8000" # we can expose ports for each bot
#CMD ["poetry", "run", "python", "autogpt/__main__.py"]
entrypoint: bash -c "poetry run python -m forge agent start ghostcoder"
#entrypoint: bash
environment:
- GITHUB_PAT="${GITHUB_PAT}"
- GITHUB_REPO="jmikedupont2/ai-ticket"
- OPENAI_API_KEY=your-openai-api-key
- OPENAI_API_BASE=http://mockopenai:5000/v1
- AGENT_WORKSPACE=/tmp/workspace/
- DATABASE_STRING=sqlite:///agent.db
build:
context: vendor/aorwall/
dockerfile: autogpts/ghostcoder/Dockerfile
args:
BASE_IMAGE: h4ckermike/basic_agent
volumes:
- ./vendor/aorwall/benchmark:/benchmark
- ./vendor/aorwall/autogpts/ghostcoder:/app/ #mount the source in for editing witho
- ./tests/ai_settings.yaml:/tmp/ai_settings.yaml
1 change: 1 addition & 0 deletions logs/todo.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 0 additions & 1 deletion vendor/Mutant-AI
Submodule Mutant-AI deleted from 2f79ca
2 changes: 1 addition & 1 deletion vendor/act_base
Submodule act_base updated 1 files
+13 −11 Dockerfile
1 change: 1 addition & 0 deletions vendor/agent-protocol-client-python
1 change: 1 addition & 0 deletions vendor/agent-protocol-sdk-python
2 changes: 1 addition & 1 deletion vendor/aorwall
Submodule aorwall updated 337 files
10 changes: 10 additions & 0 deletions vendor/bored.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
git submodule add https://github.com/jinho-kim-osd/osGPT
git submodule add https://github.com/bsenst/FritzGPT
git submodule add https://github.com/murnanedaniel/Asimov
git submodule add https://github.com/polywrap/evo.ninja
git submodule add https://github.com/cluna80/Mutant-AI
git submodule add https://github.com/gordonwilliamsburg/test gordonwilliamsburg
git submodule add https://github.com/joslangarica/AutoGPT joslangarica
git submodule add https://github.com/isayahc/AutoGPT isayahc
git submodule add https://github.com/merwanehamadi/Auto-GPT merwanehamadi
git submodule add https://github.com/HMDCrew/AutoGPT HMDCrew

0 comments on commit a7712e6

Please sign in to comment.