update with latest
#2
by
Tonic
- opened
- .gitignore +0 -5
- OAI_CONFIG_LIST.json +0 -48
- README.md +0 -83
- requirements.txt +0 -1
- snake_dev_team.py +0 -88
.gitignore
DELETED
@@ -1,5 +0,0 @@
|
|
1 |
-
./
|
2 |
-
|
3 |
-
.cache/
|
4 |
-
|
5 |
-
.env
|
|
|
|
|
|
|
|
|
|
|
|
OAI_CONFIG_LIST.json
DELETED
@@ -1,48 +0,0 @@
|
|
1 |
-
[
|
2 |
-
{
|
3 |
-
"model": "gpt-3.5-turbo",
|
4 |
-
"api_key": ""
|
5 |
-
},
|
6 |
-
{
|
7 |
-
"model": "gpt-3.5-turbo-0301",
|
8 |
-
"api_key": ""
|
9 |
-
},
|
10 |
-
{
|
11 |
-
"model": "gpt-3.5-turbo-0613",
|
12 |
-
"api_key": ""
|
13 |
-
},
|
14 |
-
{
|
15 |
-
"model": "gpt-3.5-turbo-16k",
|
16 |
-
"api_key": ""
|
17 |
-
},
|
18 |
-
{
|
19 |
-
"model": "gpt-3.5-turbo-16k-0613",
|
20 |
-
"api_key": ""
|
21 |
-
},
|
22 |
-
{
|
23 |
-
"model": "gpt-4",
|
24 |
-
"api_key": ""
|
25 |
-
},
|
26 |
-
{
|
27 |
-
"model": "gpt-4-0314",
|
28 |
-
"api_key": ""
|
29 |
-
},
|
30 |
-
{
|
31 |
-
"model": "gpt-4-0613",
|
32 |
-
"api_key": ""
|
33 |
-
},
|
34 |
-
{
|
35 |
-
"model": "gpt-4-32k",
|
36 |
-
"api_key": "",
|
37 |
-
"api_base": "https://*.openai.azure.com/openai/deployments/*/chat/completions",
|
38 |
-
"api_type": "azure",
|
39 |
-
"api_version": "2023-06-01-preview"
|
40 |
-
},
|
41 |
-
{
|
42 |
-
"model": "gpt-35-turbo-16k",
|
43 |
-
"api_key": "",
|
44 |
-
"api_base": "https://*.openai.azure.com/openai/deployments/*/chat/completions",
|
45 |
-
"api_type": "azure",
|
46 |
-
"api_version": "2023-06-01-preview"
|
47 |
-
}
|
48 |
-
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
README.md
DELETED
@@ -1,83 +0,0 @@
|
|
1 |
-
---
|
2 |
-
title: Snake Game Development with AutoGen
|
3 |
-
emoji: 🐍🤖
|
4 |
-
colorFrom: green
|
5 |
-
colorTo: yellow
|
6 |
-
sdk: static
|
7 |
-
app_file: README.md
|
8 |
-
pinned: false
|
9 |
-
license: mit
|
10 |
-
---
|
11 |
-
|
12 |
-
|
13 |
-
# Snake Game Development with AutoGen
|
14 |
-
|
15 |
-
Welcome to the Snake Game Development project. In this project, we aim to design, implement, and test a snake game that is both entertaining and challenging. We leverage the power of the `autogen` library, a framework by Microsoft, to facilitate collaboration between different agents, each with its unique role.
|
16 |
-
|
17 |
-
## Table of Contents
|
18 |
-
|
19 |
-
- [Overview](#overview)
|
20 |
-
- [About AutoGen](#about-autogen)
|
21 |
-
- [Roles and Responsibilities](#roles-and-responsibilities)
|
22 |
-
- [Setup and Configuration](#setup-and-configuration)
|
23 |
-
- [Usage](#usage)
|
24 |
-
- [Contributing](#contributing)
|
25 |
-
- [License](#license)
|
26 |
-
|
27 |
-
## Overview
|
28 |
-
|
29 |
-
The project is structured around a group chat setup where different agents collaborate to bring the snake game to life. Each agent has a specific role and responsibility, and they communicate and collaborate through the group chat.
|
30 |
-
|
31 |
-
## About AutoGen
|
32 |
-
|
33 |
-
[AutoGen](https://microsoft.github.io/autogen/docs/Getting-Started) is a framework developed by Microsoft that enables the development of LLM (Language Model) applications using multiple agents. These agents can converse with each other to solve tasks. AutoGen agents are known for their customizability, conversational capabilities, and the seamless integration of human participation. They can operate in various modes, employing combinations of LLMs, human inputs, and tools. For more details, refer to the [official documentation](https://microsoft.github.io/autogen/docs/Getting-Started).
|
34 |
-
|
35 |
-
## Roles and Responsibilities
|
36 |
-
|
37 |
-
- **Player**: Provides feedback on the gameplay and collaborates with the Game Designer to ensure the game meets desired expectations.
|
38 |
-
|
39 |
-
- **Game Designer**: Designs the snake game, ensuring all details are documented in 'game_design.txt'. Collaborates with the Player to align the design with feedback and expectations.
|
40 |
-
|
41 |
-
- **Programmer**: Responsible for coding the snake game. Collaborates with the Code Executor for code execution and consults the Game Tester for feedback.
|
42 |
-
|
43 |
-
- **Game Tester**: Playtests the game, providing feedback on gameplay mechanics and user experience. Reports any bugs or glitches and collaborates with the Programmer for necessary adjustments.
|
44 |
-
|
45 |
-
- **Code Executor**: Executes the provided code in a designated environment, ensuring it follows best practices. Collaborates with the Programmer for any necessary code adjustments.
|
46 |
-
|
47 |
-
## Setup and Configuration
|
48 |
-
|
49 |
-
1. **Dependencies**: Before running the project, ensure you have all the required dependencies installed. You can install them using:
|
50 |
-
|
51 |
-
```bash
|
52 |
-
pip install -r requirements.txt
|
53 |
-
```
|
54 |
-
|
55 |
-
2. **OpenAI Key**: Make sure to add your OpenAI key to the `OAI_CONFIG_LIST.json` file. This is crucial for the proper functioning of the GPT-4 configurations.
|
56 |
-
|
57 |
-
3. **Configuration**: The project uses a configuration file `OAI_CONFIG_LIST.json` for GPT-4 settings. Ensure this file is present in the root directory and has the necessary OpenAI key added.
|
58 |
-
|
59 |
-
4. **Working Directory**: All relevant game files, including the game's code and design document, are stored in the `game_files` directory.
|
60 |
-
|
61 |
-
## Usage
|
62 |
-
|
63 |
-
To initiate the project on Windows, navigate to the project directory in your terminal or command prompt and run the following command:
|
64 |
-
|
65 |
-
```bash
|
66 |
-
python snake_dev_team.py
|
67 |
-
```
|
68 |
-
|
69 |
-
This will start the group chat, and the Player will initiate the conversation with the message:
|
70 |
-
|
71 |
-
```plaintext
|
72 |
-
"Let's design and implement a snake game. I aim for it to be entertaining and challenging."
|
73 |
-
```
|
74 |
-
|
75 |
-
From there, the agents will collaborate based on their roles and responsibilities.
|
76 |
-
|
77 |
-
## Contributing
|
78 |
-
|
79 |
-
Contributions are welcome! Please read the contributing guidelines to get started.
|
80 |
-
|
81 |
-
## License
|
82 |
-
|
83 |
-
This project is licensed under the MIT License. See the `LICENSE` file for details.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
requirements.txt
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
pyautogen
|
|
|
|
snake_dev_team.py
DELETED
@@ -1,88 +0,0 @@
|
|
1 |
-
from autogen import AssistantAgent, UserProxyAgent, config_list_from_json, GroupChat, GroupChatManager
|
2 |
-
|
3 |
-
# Load the configuration for GPT-4 from a JSON file
|
4 |
-
config_list_gpt4 = config_list_from_json(
|
5 |
-
"../OAI_CONFIG_LIST.json",
|
6 |
-
filter_dict={
|
7 |
-
"model": ["gpt-4-0613, gpt-4-32k, gpt-4, gpt-4-0314"],
|
8 |
-
},
|
9 |
-
)
|
10 |
-
|
11 |
-
# Define the GPT-4 configuration parameters
|
12 |
-
gpt4_config = {
|
13 |
-
"seed": 42,
|
14 |
-
"temperature": 0,
|
15 |
-
"config_list": config_list_gpt4,
|
16 |
-
"request_timeout": 1200,
|
17 |
-
}
|
18 |
-
|
19 |
-
# Define the common working directory for all agents
|
20 |
-
working_directory = "game_files"
|
21 |
-
|
22 |
-
# Initialize the Player agent, responsible for providing gameplay feedback
|
23 |
-
player = UserProxyAgent(
|
24 |
-
name="Player",
|
25 |
-
system_message="Player: Your role is to provide feedback on the gameplay. Collaborate with the Game Designer to ensure the game meets desired expectations.",
|
26 |
-
code_execution_config={
|
27 |
-
"work_dir": working_directory,
|
28 |
-
"use_docker": False,
|
29 |
-
"timeout": 120,
|
30 |
-
"last_n_messages": 1,
|
31 |
-
},
|
32 |
-
)
|
33 |
-
|
34 |
-
# Initialize the Game Designer agent, responsible for designing the game
|
35 |
-
game_designer = AssistantAgent(
|
36 |
-
name="Game_Designer",
|
37 |
-
llm_config=gpt4_config,
|
38 |
-
system_message="Game Designer: Design the snake game, ensuring all details are documented in 'game_design.txt'. Collaborate with the Player to align the design with feedback and expectations."
|
39 |
-
)
|
40 |
-
|
41 |
-
# Initialize the Programmer agent, responsible for coding the game
|
42 |
-
programmer = AssistantAgent(
|
43 |
-
name="Programmer",
|
44 |
-
llm_config=gpt4_config,
|
45 |
-
system_message="Programmer: Code the snake game and save it in the working directory. For code execution, collaborate with the Code Executor. If feedback is needed, consult the Game Tester."
|
46 |
-
)
|
47 |
-
|
48 |
-
# Initialize the Game Tester agent, responsible for playtesting the game
|
49 |
-
game_tester = UserProxyAgent(
|
50 |
-
name="Game_Tester",
|
51 |
-
system_message="Game Tester: Playtest the game and provide feedback on gameplay mechanics and user experience. Report any bugs or glitches. Collaborate with the Programmer for any necessary adjustments.",
|
52 |
-
code_execution_config={
|
53 |
-
"work_dir": working_directory,
|
54 |
-
"use_docker": False,
|
55 |
-
"timeout": 120,
|
56 |
-
"last_n_messages": 3,
|
57 |
-
},
|
58 |
-
human_input_mode="ALWAYS",
|
59 |
-
)
|
60 |
-
|
61 |
-
# Initialize the Code Executor agent, responsible for executing the game code
|
62 |
-
code_executor = UserProxyAgent(
|
63 |
-
name="Code_Executor",
|
64 |
-
system_message="Code Executor: Execute the provided code from the Programmer in the designated environment. Report outcomes and potential issues. Ensure the code follows best practices and recommend enhancements to the Programmer.",
|
65 |
-
code_execution_config={
|
66 |
-
"work_dir": working_directory,
|
67 |
-
"use_docker": False,
|
68 |
-
"timeout": 120,
|
69 |
-
"last_n_messages": 3,
|
70 |
-
},
|
71 |
-
human_input_mode="NEVER",
|
72 |
-
)
|
73 |
-
|
74 |
-
# Set up the group chat with all the agents
|
75 |
-
groupchat = GroupChat(
|
76 |
-
agents=[player, game_tester, game_designer, programmer, code_executor],
|
77 |
-
messages=[],
|
78 |
-
max_round=150
|
79 |
-
)
|
80 |
-
|
81 |
-
# Create a manager for the group chat using the GPT-4 configuration
|
82 |
-
manager = GroupChatManager(groupchat=groupchat, llm_config=gpt4_config)
|
83 |
-
|
84 |
-
# Start the conversation with the Player's message
|
85 |
-
player.initiate_chat(
|
86 |
-
manager,
|
87 |
-
message="Let's design and implement a snake game. I aim for it to be entertaining and challenging."
|
88 |
-
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|