Skip to content

Commit

Permalink
Merge branch 'OpenBMB:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
suhasasumukh authored Jan 11, 2024
2 parents 7f24c7c + ea458c8 commit 35a6151
Show file tree
Hide file tree
Showing 11 changed files with 5,432 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
{
"chain": [
{
"phase": "DemandAnalysis",
"phaseType": "SimplePhase",
"max_turn_step": -1,
"need_reflect": "True"
},
{
"phase": "LanguageChoose",
"phaseType": "SimplePhase",
"max_turn_step": -1,
"need_reflect": "True"
},
{
"phase": "Coding",
"phaseType": "SimplePhase",
"max_turn_step": 1,
"need_reflect": "False"
},
{
"phase": "CodeCompleteAll",
"phaseType": "ComposedPhase",
"cycleNum": 10,
"Composition": [
{
"phase": "CodeComplete",
"phaseType": "SimplePhase",
"max_turn_step": 1,
"need_reflect": "False"
}
]
},
{
"phase": "CodeReview",
"phaseType": "ComposedPhase",
"cycleNum": 3,
"Composition": [
{
"phase": "CodeReviewComment",
"phaseType": "SimplePhase",
"max_turn_step": 1,
"need_reflect": "False"
},
{
"phase": "CodeReviewModification",
"phaseType": "SimplePhase",
"max_turn_step": 1,
"need_reflect": "False"
}
]
},
{
"phase": "HumanAgentInteraction",
"phaseType": "ComposedPhase",
"cycleNum": 5,
"Composition": [
{
"phase": "CodeReviewHuman",
"phaseType": "SimplePhase",
"max_turn_step": 1,
"need_reflect": "False"
}
]
},
{
"phase": "Test",
"phaseType": "ComposedPhase",
"cycleNum": 3,
"Composition": [
{
"phase": "TestErrorSummary",
"phaseType": "SimplePhase",
"max_turn_step": 1,
"need_reflect": "False"
},
{
"phase": "TestModification",
"phaseType": "SimplePhase",
"max_turn_step": 1,
"need_reflect": "False"
}
]
},
{
"phase": "EnvironmentDoc",
"phaseType": "SimplePhase",
"max_turn_step": 1,
"need_reflect": "True"
},
{
"phase": "Manual",
"phaseType": "SimplePhase",
"max_turn_step": 1,
"need_reflect": "False"
}
],
"recruitments": [
"Chief Executive Officer",
"Counselor",
"Chief Human Resource Officer",
"Chief Product Officer",
"Chief Technology Officer",
"Programmer",
"Code Reviewer",
"Software Test Engineer",
"Chief Creative Officer"
],
"clear_structure": "True",
"gui_design": "True",
"git_management": "False",
"self_improve": "False",
"web_spider": "False",
"incremental_develop": "False",
"background_prompt": "ChatDev is a software company powered by multiple intelligent agents, such as chief executive officer, chief human resources officer, chief product officer, chief technology officer, etc, with a multi-agent organizational structure and the mission of 'changing the digital world through programming'."
}

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{
"Chief Executive Officer": [
"{chatdev_prompt}",
"You are Chief Executive Officer. Now, we are both working at ChatDev and we share a common interest in collaborating to successfully complete a task assigned by a new customer.",
"Your main responsibilities include being an active decision-maker on users' demands and other key policy issues, leader, manager, and executor. Your decision-making role involves high-level decisions about policy and strategy; and your communicator role can involve speaking to the organization's management and employees.",
"Here is a new customer's task: {task}.",
"To complete the task, I will give you one or more instructions, and you must help me to write a specific solution that appropriately solves the requested instruction based on your expertise and my needs."
],
"Chief Product Officer": [
"{chatdev_prompt}",
"You are Chief Product Officer. we are both working at ChatDev. We share a common interest in collaborating to successfully complete a task assigned by a new customer.",
"You are responsible for all product-related matters in ChatDev. Usually includes product design, product strategy, product vision, product innovation, project management and product marketing.",
"Here is a new customer's task: {task}.",
"To complete the task, you must write a response that appropriately solves the requested instruction based on your expertise and customer's needs."
],
"Counselor": [
"{chatdev_prompt}",
"You are Counselor. Now, we share a common interest in collaborating to successfully complete a task assigned by a new customer.",
"Your main responsibilities include asking what user and customer think and provide your valuable suggestions. ",
"Here is a new customer's task: {task}.",
"To complete the task, I will give you one or more instructions, and you must help me to write a specific solution that appropriately solves the requested instruction based on your expertise and my needs."
],
"Chief Technology Officer": [
"{chatdev_prompt}",
"You are Chief Technology Officer. we are both working at ChatDev. We share a common interest in collaborating to successfully complete a task assigned by a new customer.",
"You are very familiar to information technology. You will make high-level decisions for the overarching technology infrastructure that closely align with the organization's goals, while you work alongside the organization's information technology (\"IT\") staff members to perform everyday operations.",
"Here is a new customer's task: {task}.",
"To complete the task, You must write a response that appropriately solves the requested instruction based on your expertise and customer's needs."
],
"Chief Human Resource Officer": [
"{chatdev_prompt}",
"You are Chief Human Resource Officer. Now, we are both working at ChatDev and we share a common interest in collaborating to successfully complete a task assigned by a new customer.",
"You are a corporate officer who oversees all aspects of human resource management and industrial relations policies, practices and operations for an organization. You will be involved in board staff recruitment, member selection, executive compensation, and succession planning. Besides, You report directly to the chief executive officer (CEO) and am a member of the most senior-level committees of a company (e.g., executive committee or office of CEO).",
"Here is a new customer's task: {task}.",
"To complete the task, you must write a response that appropriately solves the requested instruction based on your expertise and customer's needs."
],
"Programmer": [
"{chatdev_prompt}",
"You are Programmer. we are both working at ChatDev. We share a common interest in collaborating to successfully complete a task assigned by a new customer.",
"You can write/create computer software or applications by providing a specific programming language to the computer. You have extensive computing and coding experience in many varieties of programming languages and platforms, such as Python, Java, C, C++, HTML, CSS, JavaScript, XML, SQL, PHP, etc,.",
"Here is a new customer's task: {task}.",
"To complete the task, you must write a response that appropriately solves the requested instruction based on your expertise and customer's needs."
],
"Code Reviewer": [
"{chatdev_prompt}",
"You are Code Reviewer. we are both working at ChatDev. We share a common interest in collaborating to successfully complete a task assigned by a new customer.",
"You can help programmers to assess source codes for software troubleshooting, fix bugs to increase code quality and robustness, and offer proposals to improve the source codes.",
"Here is a new customer's task: {task}.",
"To complete the task, you must write a response that appropriately solves the requested instruction based on your expertise and customer's needs."
],
"Software Test Engineer": [
"{chatdev_prompt}",
"You are Software Test Engineer. we are both working at ChatDev. We share a common interest in collaborating to successfully complete a task assigned by a new customer.",
"You can use the software as intended to analyze its functional properties, design manual and automated test procedures to evaluate each software product, build and implement software evaluation test programs, and run test programs to ensure that testing protocols evaluate the software correctly.",
"Here is a new customer's task: {task}.",
"To complete the task, you must write a response that appropriately solves the requested instruction based on your expertise and customer's needs."
],
"Chief Creative Officer": [
"{chatdev_prompt}",
"You are Chief Creative Officer. we are both working at ChatDev. We share a common interest in collaborating to successfully complete a task assigned by a new customer.",
"You direct ChatDev's creative software's and develop the artistic design strategy that defines the company's brand. You create the unique image or music of our produced software's and deliver this distinctive design to consumers to create a clear brand image which is a fundamental and essential work throughout the company.",
"Here is a new customer's task: {task}.",
"To complete the task, you must write a response that appropriately solves the requested instruction based on your expertise and customer's needs."
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import tkinter as tk
from raindrop import Raindrop
import random
class MainApp:
def __init__(self, root):
self.root = root
self.canvas = tk.Canvas(root, width=800, height=600)
self.canvas.pack()
self.umbrella = self.canvas.create_oval(0, 0, 50, 50, fill='blue')
self.canvas.bind('<Motion>', self.move_umbrella)
self.raindrops = []
self.create_raindrop() # Start creating raindrops
self.root.after(100, self.check_raindrop_collision) # Check collision periodically
def move_umbrella(self, event):
x, y = event.x, event.y
self.canvas.coords(self.umbrella, x-25, y-25, x+25, y+25)
def check_raindrop_collision(self):
umbrella_coords = self.canvas.coords(self.umbrella)
for raindrop in self.raindrops:
raindrop_coords = self.canvas.coords(raindrop.id)
if self.is_collision(umbrella_coords, raindrop_coords):
self.canvas.delete(raindrop.id)
self.raindrops.remove(raindrop)
self.root.after(100, self.check_raindrop_collision) # Check collision periodically
def is_collision(self, coords1, coords2):
if len(coords2) < 4:
return False
x1, y1, x2, y2 = coords1
x3, y3, x4, y4 = coords2
if x3 < x2 and x4 > x1 and y3 < y2 and y4 > y1:
return True
return False
def create_raindrop(self):
x = random.randint(0, self.canvas.winfo_width()) # Random x position
raindrop = Raindrop(self.canvas, x)
self.raindrops.append(raindrop)
self.canvas.after(10, self.create_raindrop)
root = tk.Tk()
app = MainApp(root)
root.mainloop()
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# Raindrop Game User Manual

Welcome to the Raindrop Game! This user manual will guide you through the installation process and explain how to play the game.

## Table of Contents
1. [Installation](#installation)
2. [Game Overview](#game-overview)
3. [Controls](#controls)
4. [Gameplay](#gameplay)
5. [Troubleshooting](#troubleshooting)

## 1. Installation <a name="installation"></a>

To play the Raindrop Game, you need to have Python installed on your computer. Follow these steps to install the necessary dependencies:

1. Open a terminal or command prompt.
2. Navigate to the directory where you have saved the `main.py` and `raindrop.py` files.
3. Run the following command to install the required dependencies:

```
pip install tkinter
```

Once the installation is complete, you are ready to play the game!

## 2. Game Overview <a name="game-overview"></a>

The Raindrop Game is a simple interactive game where raindrops fall down the screen, and your mouse cursor acts as an umbrella to catch the raindrops. The objective is to prevent the raindrops from falling underneath the umbrella.

## 3. Controls <a name="controls"></a>

The game controls are straightforward:

- Move your mouse cursor to control the position of the umbrella.
- The umbrella will follow the movement of your mouse cursor.

## 4. Gameplay <a name="gameplay"></a>

To start the game, follow these steps:

1. Open a terminal or command prompt.
2. Navigate to the directory where you have saved the `main.py` and `raindrop.py` files.
3. Run the following command to start the game:

```
python main.py
```

Once the game starts, raindrops will begin falling from the top of the screen. Move your mouse cursor to position the umbrella and catch the raindrops. If a raindrop touches the umbrella, it will disappear. The game continues until you close the game window.

## 5. Troubleshooting <a name="troubleshooting"></a>

If you encounter any issues while installing or playing the game, please try the following troubleshooting steps:

1. Make sure you have Python installed on your computer. You can check your Python version by running the following command in a terminal or command prompt:

```
python --version
```

2. Ensure that you have installed the `tkinter` library correctly by running the following command:

```
pip show tkinter
```

If the library is not installed, please reinstall it using the command provided in the installation section.

3. If the game does not start or you experience any other issues, please check the terminal or command prompt for any error messages. If you see any error messages, try searching for a solution online or seek assistance from the ChatDev support team.

That's it! You are now ready to enjoy the Raindrop Game. Have fun playing and remember to keep those raindrops away from the umbrella!
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
Task:
rain drops are falling down the screen, and the mouse cursor is an umbrella, where rain drops don't fall underneath the umbrella

Config:
ChatEnvConfig.clear_structure: True
ChatEnvConfig.git_management: False
ChatEnvConfig.gui_design: True
ChatEnvConfig.incremental_develop: False
ChatEnvConfig.background_prompt: ChatDev is a software company powered by multiple intelligent agents, such as chief executive officer, chief human resources officer, chief product officer, chief technology officer, etc, with a multi-agent organizational structure and the mission of 'changing the digital world through programming'.


Roster:
Chief Executive Officer, Counselor, Chief Human Resource Officer, Chief Product Officer, Chief Technology Officer, Programmer, Code Reviewer, Software Test Engineer, Chief Creative Officer

Modality:
website

Ideas:


Language:
Python

Code_Version:
9.0

Proposed_images:
0

Incorporated_images:
0

Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import tkinter as tk
import random
class Raindrop:
def __init__(self, canvas, x):
self.canvas = canvas
self.x = x
self.y = 0
self.id = self.canvas.create_oval(self.x-5, self.y-5, self.x+5, self.y+5, fill='gray')
self.canvas.move(self.id, 0, self.y)
self.fall_speed = random.randint(1, 5)
self.canvas.after(50, self.fall)
def fall(self):
self.y += self.fall_speed
self.canvas.move(self.id, 0, self.fall_speed)
if self.y < self.canvas.winfo_height():
self.canvas.after(50, self.fall)
else:
self.canvas.delete(self.id)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pip install tkinter
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rain drops are falling down the screen, and the mouse cursor is an umbrella, where rain drops don't fall underneath the umbrella
Loading

0 comments on commit 35a6151

Please sign in to comment.