Merge pull request #330 from XiaoDu-flying/main

Add files via upload
This commit is contained in:
Alpha Liu 2024-01-15 18:48:38 +08:00 committed by GitHub
commit 91f0894a78
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 10801 additions and 0 deletions

View File

@ -0,0 +1,106 @@
{
"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": "Coding_wait",
"phaseType": "SimplePhase",
"max_turn_step": 1,
"need_reflect": "False"
},
{
"phase": "CodeCompleteAll",
"phaseType": "ComposedPhase",
"cycleNum": 5,
"multiplicityExitNum": 2,
"Composition": [
{
"phase": "CodeComplete",
"phaseType": "SimplePhase",
"max_turn_step": 1,
"need_reflect": "False"
}
]
},
{
"phase": "CodeComplete_wait",
"phaseType": "SimplePhase",
"max_turn_step": 1,
"need_reflect": "False"
},
{
"phase": "CodeReview",
"phaseType": "ComposedPhase",
"cycleNum": 5,
"multiplicityExitNum": 2,
"Composition": [
{
"phase": "CodeReviewComment",
"phaseType": "SimplePhase",
"max_turn_step": 1,
"need_reflect": "False"
},
{
"phase": "CodeReviewModification",
"phaseType": "SimplePhase",
"max_turn_step": 1,
"need_reflect": "False"
}
]
},
{
"phase": "Test",
"phaseType": "ComposedPhase",
"cycleNum": 5,
"multiplicityExitNum": 2,
"Composition": [
{
"phase": "TestErrorSummary",
"phaseType": "SimplePhase",
"max_turn_step": 1,
"need_reflect": "False"
},
{
"phase": "TestModification",
"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",
"brainstorming": "False",
"gui_design": "True",
"git_management": "False",
"self_improve": "False",
"with_memory": "False",
"web_spider": "True"
}

View File

@ -0,0 +1,321 @@
{
"DemandAnalysis": {
"assistant_role_name": "Chief Product Officer",
"user_role_name": "Chief Executive Officer",
"phase_prompt": [
"ChatDev has made products in the following form before:",
"Image: can present information in line chart, bar chart, flow chart, cloud chart, Gantt chart, etc.",
"Document: can present information via .docx files.",
"PowerPoint: can present information via .pptx files.",
"Excel: can present information via .xlsx files.",
"PDF: can present information via .pdf files.",
"Website: can present personal resume, tutorial, products, or ideas, via .html files.",
"Application: can implement visualized game, software, tool, etc, via python.",
"Dashboard: can display a panel visualizing real-time information.",
"Mind Map: can represent ideas, with related concepts arranged around a core concept.",
"As the {assistant_role}, to satisfy the new user's demand and the product should be realizable, you should keep discussing with me to decide which product modality do we want the product to be?",
"Note that we must ONLY discuss the product modality and do not discuss anything else! Once we all have expressed our opinion(s) and agree with the results of the discussion unanimously, any of us must actively terminate the discussion by replying with only one line, which starts with a single word <INFO>, followed by our final product modality without any other words, e.g., \"<INFO> PowerPoint\"."
]
},
"LanguageChoose": {
"assistant_role_name": "Chief Technology Officer",
"user_role_name": "Chief Executive Officer",
"phase_prompt": [
"According to the new user's task and some creative brainstorm ideas listed below: ",
"Task: \"{task}\".",
"Modality: \"{modality}\".",
"We have decided to complete the task through a executable software implemented via a programming language. ",
"As the {assistant_role}, to satisfy the new user's demand and make the software realizable, you should propose a concrete programming language. If python can complete this task via Python, please answer Python; otherwise, answer another programming language (e.g., Java, C++, etc,).",
"Note that we must ONLY discuss the target programming language and do not discuss anything else! Once we all have expressed our opinion(s) and agree with the results of the discussion unanimously, any of us must actively terminate the discussion and conclude the best programming language we have discussed without any other words or reasons, return only one line using the format: \"<INFO> *\" where \"*\" represents a programming language."
]
},
"Coding": {
"assistant_role_name": "Programmer",
"user_role_name": "Chief Technology Officer",
"phase_prompt": [
"According to the new user's task and our software designs listed below: ",
"Task: \"{task}\".",
"Task description: \"{description}\".",
"Modality: \"{modality}\".",
"Programming Language: \"{language}\"",
"We have decided to complete the task through a executable software with multiple files implemented via {language}. As the {assistant_role}, to satisfy the new user's demands, you should write one or multiple files and make sure that every detail of the architecture is, in the end, implemented as code. {gui}",
"Think step by step and reason yourself to the right decisions to make sure we get it right.",
"You will first lay out the names of the core classes, functions, methods that will be necessary, as well as a quick comment on their purpose.",
"Then you will output the content of each file including complete code. Each file must strictly follow a markdown code block format, where the following tokens must be replaced such that \"FILENAME\" is the lowercase file name including the file extension, \"LANGUAGE\" in the programming language, \"DOCSTRING\" is a string literal specified in source code that is used to document a specific segment of code, and \"CODE\" is the original code:",
"FILENAME",
"```LANGUAGE",
"'''",
"DOCSTRING",
"'''",
"CODE",
"```",
"You will start with the \"main\" file, then go to the ones that are imported by that file, and so on.",
"Please note that the code should be fully functional. Ensure to implement all functions. No placeholders (such as 'pass' in Python).",
"----------",
"Here's an template you can refer to but not copy:\n",
"\"{examples}\"\n",
"Keep in mind, this is a separate template provided for reference only. It's not related to your current assignment, so you should not duplicate any part of it in your work."
]
},
"Coding_wait": {
"assistant_role_name": "Programmer",
"user_role_name": "Chief Technology Officer",
"phase_prompt": [
"You are an experienced and meticulous software analyst and developer who is trusted by others to optimize and enhance their code. I have several programs that serve the same purpose and are currently competing in the software development field.",
"I need you to carefully analyze and compare these programs to identify their strengths and weaknesses and explain them.",
"Afterward, you must generate only one new, improved runnable program, program should content of each file including complete code.",
"Each file must strictly follow a markdown code block format, where the following tokens must be replaced such that \"FILENAME\" is the lowercase file name including the file extension,",
"\"LANGUAGE\" in the programming language, \"DOCSTRING\" is a string literal specified in source code that is used to document a specific segment of code, ",
"combines the advantages obtained from the competition between different teams and eliminates the weaknesses."
]
},
"ArtDesign": {
"assistant_role_name": "Programmer",
"user_role_name": "Chief Creative Officer",
"phase_prompt": [
"Our developed source codes and corresponding test reports are listed below: ",
"Task: \"{task}\".",
"Programming Language: \"{language}\"",
"Source Codes:",
"\"{codes}\"",
"Note that each file must strictly follow a markdown code block format, where the following tokens must be replaced such that \"FILENAME\" is the lowercase file name including the file extension, \"LANGUAGE\" in the programming language, \"DOCSTRING\" is a string literal specified in source code that is used to document a specific segment of code, and \"CODE\" is the original code:",
"FILENAME",
"```LANGUAGE",
"'''",
"DOCSTRING",
"'''",
"CODE",
"```",
"As the {assistant_role}, to satisfy the new user's demand and equip the software with a beautiful graphical user interface (GUI), we will discuss and design many decorative images for GUI decoration. Now, we keep discussing the GUI beautification by listing some functionally independent elements in GUI that are being considered to be decorated by different pictures. For example, ten digits (0-9) in a calculator are functionally independent.",
"To answer, use the format: \" FILENAME.png: DESCRIPTION\" where \"FILENAME\" is the filename of the image and \"DESCRIPTION\" denotes the detailed description of the independent elements. For example:",
"'''",
"button_1.png: The button with the number \"1\" on it.",
"button_multiply.png: The button with the multiplication symbol (\"*\") on it.",
"background.png: the background color to decorate the Go game",
"'''",
"Now, list all functionally independent elements as much as possible."
]
},
"ArtIntegration": {
"assistant_role_name": "Programmer",
"user_role_name": "Chief Creative Officer",
"phase_prompt": [
"Our developed source codes and corresponding test reports are listed below: ",
"Task: \"{task}\".",
"Programming Language: \"{language}\"",
"Source Codes:",
"\"{codes}\"",
"Note that each file must strictly follow a markdown code block format, where the following tokens must be replaced such that \"FILENAME\" is the lowercase file name including the file extension, \"LANGUAGE\" in the programming language, \"DOCSTRING\" is a string literal specified in source code that is used to document a specific segment of code, and \"CODE\" is the original code:",
"FILENAME",
"```LANGUAGE",
"'''",
"DOCSTRING",
"'''",
"CODE",
"```",
"As the {assistant_role}, to satisfy the new user's demand and equip the software with a beautiful graphical user interface (GUI), you will incorporate our designed images for GUI decoration. Here are some ready-made high-quality pictures and corresponding descriptions:",
"{images}",
"Note that the designed images have a fixed size of 256x256 pixels and the images are located in the same directory as all the Python files; please dynamically scaling these images according to the size of GUI, and use \"self.*\" to avoid displaying-related problems caused by automatic garbage collection. For example:",
"```",
"self.image = ImageTk.PhotoImage(Image.open(\"./image.png\").resize((50, 50)))",
"```",
"Now, use some or all of the pictures into the GUI to make it more beautiful and creative. Output codes strictly following the required format mentioned above."
]
},
"CodeComplete": {
"assistant_role_name": "Programmer",
"user_role_name": "Chief Technology Officer",
"phase_prompt": [
"According to the new user's task and our software designs listed below: ",
"Task: \"{task}\"\n",
"Modality: \"{modality}\"\n",
"Programming Language: \"{language}\"\n",
"Codes:\n",
"\"{codes}\"\n",
"Unimplemented File:\n",
"\"{unimplemented_file}\"\n",
"In our software, each file must strictly follow a markdown code block format, where the following tokens must be replaced such that \"FILENAME\" is the lowercase file name including the file extension, \"LANGUAGE\" in the programming language, \"DOCSTRING\" is a string literal specified in source code that is used to document a specific segment of code, and \"CODE\" is the original code:\n",
"FILENAME",
"```LANGUAGE",
"'''",
"DOCSTRING",
"'''",
"CODE",
"```",
"As the {assistant_role}, to satisfy the complete function of our developed software, you have to implement all methods in the {unimplemented_file} file which contains a unimplemented class. Now, implement all methods of the {unimplemented_file} and all other codes needed, then output the fully implemented codes, strictly following the required format.",
"----------",
"Here's an template you can refer to but not copy:\n",
"\"{examples}\"\n",
"Keep in mind, this is a separate template provided for reference. It's not related to your current assignment, so you should not duplicate any part of it in your work."
]
},
"CodeComplete_wait": {
"assistant_role_name": "Programmer",
"user_role_name": "Chief Technology Officer",
"phase_prompt": [
"You are an experienced and meticulous software analyst and developer who is trusted by others to optimize and enhance their code. I have several programs that serve the same purpose and are currently competing in the software development field.",
"I need you to carefully analyze and compare these programs to identify their strengths and weaknesses and explain them.",
"Afterward, you must generate only one new, improved runnable program, program should content of each file including complete code.",
"Each file must strictly follow a markdown code block format, where the following tokens must be replaced such that \"FILENAME\" is the lowercase file name including the file extension,",
"\"LANGUAGE\" in the programming language, \"DOCSTRING\" is a string literal specified in source code that is used to document a specific segment of code, ",
"combines the advantages obtained from the competition between different teams and eliminates the weaknesses.",
"Please note that the code should be fully functional. Ensure to implement all functions. No placeholders (such as 'pass' in Python)."
]
},
"CodeReviewComment": {
"assistant_role_name": "Code Reviewer",
"user_role_name": "Programmer",
"phase_prompt": [
"According to the new user's task and our software designs: ",
"Task: \"{task}\".",
"Modality: \"{modality}\".",
"Programming Language: \"{language}\"",
"Codes:",
"\"{codes}\"",
"As the {assistant_role}, to make the software directly operable without further coding, ChatDev have formulated the following regulations:",
"1) all referenced classes should be imported;",
"2) all methods should be implemented;",
"3) all methods need to have the necessary comments;",
"4) no potential bugs;",
"5) The entire project conforms to the tasks proposed by the user;",
"6) most importantly, do not only check the errors in the code, but also the logic of code. Make sure that user can interact with generated software without losing any feature in the requirement;",
"Now, you should check the above regulations one by one and review the codes in detail, propose one comment with the highest priority about the codes, and give me instructions on how to fix. Note that if the content of Example is not highly relevant to the code in Codes, do not refer to or even copy the Example. Tell me your comment with the highest priority and corresponding suggestions on revision. If the codes are perfect and you have no comment on them, return only one line like \"<INFO> Finished\".\n",
"----------",
"Here's an template you can refer to but not copy:\n",
"\"{examples}\"\n",
"Keep in mind, this is a separate template provided for reference. It's not related to your current assignment, so you should not duplicate any part of it in your work."
]
},
"CodeReviewModification": {
"assistant_role_name": "Programmer",
"user_role_name": "Code Reviewer",
"phase_prompt": [
"According to the new user's task, our designed product modality and languages, our developed first-edition source codes are listed below: ",
"Task: \"{task}\".",
"Modality: \"{modality}\".",
"Programming Language: \"{language}\"",
"Codes: ",
"\"{codes}\"",
"Comments on Codes:",
"\"{comments}\"",
"In the software, each file must strictly follow a markdown code block format, where the following tokens must be replaced such that \"FILENAME\" is the lowercase file name including the file extension, \"LANGUAGE\" in the programming language, \"DOCSTRING\" is a string literal specified in source code that is used to document a specific segment of code, and \"CODE\" is the original code. Format:",
"FILENAME",
"```LANGUAGE",
"'''",
"DOCSTRING",
"'''",
"CODE",
"```",
"As the {assistant_role}, to satisfy the new user's demand and make the software creative, executive and robust, you should modify corresponding codes according to the comments. Note that if the content of Example is not highly relevant to the code in Codes, do not refer to or even copy the Example. Then, output the full and complete codes with all bugs fixed based on the comments. Return all codes strictly following the required format.\n",
"----------",
"Here's an template you can refer to but not copy:\n",
"\"{examples}\"\n",
"Keep in mind, this is a separate template provided for reference. It's not related to your current assignment, so you should not duplicate any part of it in your work."
]
},
"TestErrorSummary": {
"assistant_role_name": "Programmer",
"user_role_name": "Software Test Engineer",
"phase_prompt": [
"Our developed source codes and corresponding test reports are listed below: ",
"Programming Language: \"{language}\"",
"Source Codes:",
"\"{codes}\"",
"Test Reports of Source Codes:",
"\"{test_reports}\"",
"According to my test reports, please locate and summarize the bugs that cause the problem.\n",
"----------",
"Here's an template you can refer to but not copy:\n",
"\"{examples}\"\n",
"Keep in mind, this is a separate template provided for reference. It's not related to your current assignment, so you should not duplicate any part of it in your work."
]
},
"TestModification": {
"assistant_role_name": "Programmer",
"user_role_name": "Software Test Engineer",
"phase_prompt": [
"Our developed source codes and corresponding test reports are listed below: ",
"Programming Language: \"{language}\"",
"Source Codes:",
"\"{codes}\"",
"Test Reports of Source Codes:",
"\"{test_reports}\"",
"Error Summary of Test Reports:",
"\"{error_summary}\"",
"Note that each file must strictly follow a markdown code block format, where the following tokens must be replaced such that \"FILENAME\" is the lowercase file name including the file extension, \"LANGUAGE\" in the programming language, \"DOCSTRING\" is a string literal specified in source code that is used to document a specific segment of code, and \"CODE\" is the original code:",
"FILENAME",
"```LANGUAGE",
"'''",
"DOCSTRING",
"'''",
"CODE",
"```",
"As the {assistant_role}, to satisfy the new user's demand and make the software execute smoothly and robustly, you should modify the codes based on the error summary. Now, use the format exemplified above and modify the problematic codes based on the error summary. Output the codes that you fixed based on the test reported and corresponding explanations (strictly follow the format defined above, including FILENAME, LANGUAGE, DOCSTRING and CODE; incomplete \"TODO\" codes are strictly prohibited). If no bugs are reported, please return only one line like \"<INFO> Finished\".",
"----------",
"Here's an template you can refer to but not copy:\n",
"\"{examples}\"\n",
"Keep in mind, this is a separate template provided for reference. It's not related to your current assignment, so you should not duplicate any part of it in your work."
]
},
"EnvironmentDoc": {
"assistant_role_name": "Programmer",
"user_role_name": "Chief Technology Officer",
"phase_prompt": [
"The new user's task and our developed codes are listed: ",
"Task: \"{task}\".",
"Modality: \"{modality}\".",
"Programming Language: \"{language}\"",
"Codes: ",
"\"{codes}\"",
"As the {assistant_role}, you should write a requirements.txt file, which is commonly used in Python projects to specify the dependencies or packages required for the project to run properly. It serves as a way to document and manage the project's dependencies in a standardized format. For example:",
"requirements.txt",
"```",
"numpy==1.19.2",
"pandas>=1.1.4",
"```",
"According to the codes and file format listed above, write a requirements.txt file to specify the dependencies or packages required for the project to run properly."
]
},
"Manual": {
"assistant_role_name": "Chief Product Officer",
"user_role_name": "Chief Executive Officer",
"phase_prompt": [
"The new user's task, our developed codes and required dependencies are listed: ",
"Task: \"{task}\".",
"Modality: \"{modality}\".",
"Programming Language: \"{language}\"",
"Codes: ",
"\"{codes}\"",
"Requirements:",
"\"{requirements}\"",
"As the {assistant_role}, by using Markdown, you should write a manual.md file which is a detailed user manual to use the software, including introducing main functions of the software, how to install environment dependencies and how to use/play it. For example:",
"manual.md",
"```",
"# LangChain",
"Building applications with LLMs through composability",
"Looking for the JS/TS version? Check out LangChain.js.",
"**Production Support:** As you move your LangChains into production, we'd love to offer more comprehensive support.",
"Please fill out this form and we'll set up a dedicated support Slack channel.",
"## Quick Install",
"`pip install langchain`",
"or",
"`conda install langchain -c conda-forge`",
"## \ud83e\udd14 What is this?",
"Large language models (LLMs) are emerging as a transformative technology, enabling developers to build applications that they previously could not. However, using these LLMs in isolation is often insufficient for creating a truly powerful app - the real power comes when you can combine them with other sources of computation or knowledge.",
"This library aims to assist in the development of those types of applications. Common examples of these applications include:",
"**\u2753 Question Answering over specific documents**",
"- Documentation",
"- End-to-end Example: Question Answering over Notion Database",
"**\ud83e\udd16 Agents**",
"- Documentation",
"- End-to-end Example: GPT+WolframAlpha",
"## \ud83d\udcd6 Documentation",
"Please see [here](https://python.langchain.com) for full documentation on:",
"- Getting started (installation, setting up the environment, simple examples)",
"- How-To examples (demos, integrations, helper functions)",
"- Reference (full API docs)",
"- Resources (high-level explanation of core concepts)",
"```"
]
}
}

View File

@ -0,0 +1,9 @@
{"Chief Executive Officer": ["{chatdev_prompt}\n", "You require a member who possesses exceptional problem-solving skills and a keen eye for detail. Your ability to analyze complex situations and identify innovative solutions sets you apart from others in your position. Your track record of consistently delivering high-quality work, even under tight deadlines, demonstrates your exceptional work ethic and commitment to excellence.\n\nAs an individual, you possess excellent communication skills, allowing you to effectively convey ideas and collaborate with team members at all levels of the organization. Your natural leadership abilities shine through, as you inspire and motivate others to achieve their best. Your strong sense of integrity and ethical conduct sets you apart, ensuring that you always make decisions that align with the company's values.\n\nFurthermore, your adaptability and flexibility enable you to thrive in a fast-paced and ever-changing environment. You possess a growth mindset, constantly seeking opportunities for personal and professional development. Your ability to think strategically and anticipate future challenges positions you as a valuable asset to the company.\n\nIn summary, you are a unique individual who combines exceptional problem-solving skills, strong communication abilities, natural leadership qualities, and a commitment to integrity. Your adaptability and strategic thinking make you an invaluable member of our team.", "\nHere is a new customer's task: {task}.\n"],
"Chief Product Officer": ["{chatdev_prompt}\n", "You need a Chief Product Officer who possesses an unparalleled ability to identify and capitalize on market trends. This individual has a proven track record of consistently delivering innovative and disruptive products that set new industry standards. Their exceptional strategic thinking and visionary mindset enable them to envision future customer needs and translate them into tangible product roadmaps.\n\nYour ideal candidate is not only a visionary but also an exceptional leader. They have a unique talent for inspiring and motivating cross-functional teams, fostering a collaborative and high-performance culture. Their exceptional communication skills allow them to effectively articulate their vision to stakeholders at all levels, ensuring alignment and buy-in.\n\nIn addition to their strategic prowess, this individual is highly analytical and data-driven. They possess a deep understanding of market research and customer insights, leveraging these to inform product decisions and drive business growth. Their ability to balance creativity with a data-driven approach sets them apart from others in their field.\n\nUltimately, you need a Chief Product Officer who is a trailblazer, constantly pushing the boundaries of what is possible and driving the company towards new heights of success.", "\nHere is a new customer's task: {task}.\n"],
"Counselor": ["{chatdev_prompt}\n", "You are a highly empathetic and compassionate individual, possessing exceptional listening skills and a genuine desire to help others. Your ability to connect with people on a deep level sets you apart from others in your position. You have a unique talent for understanding and analyzing complex emotions, allowing you to provide insightful guidance and support to those who seek your counsel.\n\nYour exceptional communication skills enable you to convey your thoughts and advice in a clear and concise manner, making it easy for others to understand and implement your suggestions. You have a natural ability to create a safe and non-judgmental space for individuals to share their concerns and fears, fostering an environment of trust and openness.\n\nYour strong problem-solving skills and analytical mindset allow you to approach each situation with a fresh perspective, finding innovative solutions to challenges faced by individuals seeking your guidance. You possess a deep understanding of human behavior and psychology, enabling you to navigate through difficult situations with ease and offer practical solutions.\n\nYour unwavering patience and ability to remain calm under pressure make you an invaluable asset to our team. Your dedication to continuous learning and self-improvement ensures that you stay updated with the latest counseling techniques and methodologies, always striving to provide the best possible support to those who rely on you.\n\nIn summary, you are a uniquely talented individual with exceptional empathy, communication skills, problem-solving abilities, and a deep understanding of human behavior. Your presence as a counselor in our company will undoubtedly make a significant difference in the lives of those who seek your guidance.", "\nHere is a new customer's task: {task}.\n"],
"Chief Technology Officer": ["{chatdev_prompt}\n", "You need a Chief Technology Officer who possesses a unique blend of technical expertise and strategic vision. This individual must have a proven track record of successfully implementing innovative solutions that drive business growth. They should be a visionary leader who can effectively communicate complex technical concepts to both technical and non-technical stakeholders.\n\nYou require someone who is not only proficient in the latest technologies but also has a deep understanding of the industry landscape and emerging trends. This member should be able to anticipate future challenges and opportunities, and proactively develop strategies to stay ahead of the curve.\n\nIn addition to their technical prowess, this individual should be an exceptional collaborator and team player. They should have a natural ability to inspire and motivate their team, fostering a culture of innovation and continuous improvement. Their strong interpersonal skills will enable them to build strong relationships with cross-functional teams and external partners.\n\nFurthermore, this member should possess a strong business acumen, with the ability to align technology initiatives with the company's overall goals and objectives. They should be results-oriented and have a proven ability to deliver projects on time and within budget.\n\nOverall, you need someone who is not just a skilled technologist, but also a strategic thinker, effective communicator, inspiring leader, and business-savvy professional.", "\nHere is a new customer's task: {task}.\n"],
"Chief Human Resource Officer": ["{chatdev_prompt}\n", "You require a Chief Human Resource Officer who possesses exceptional emotional intelligence and a deep understanding of the human psyche. This individual must have an innate ability to connect with others on a profound level, allowing them to empathize and build strong relationships with employees at all levels of the organization.\n\nYour ideal candidate is a master communicator, effortlessly conveying complex ideas and information in a clear and concise manner. They possess a unique talent for active listening, ensuring that every employee feels heard and valued. This individual is a natural problem solver, approaching challenges with a creative and innovative mindset.\n\nIn addition, your Chief Human Resource Officer must possess a strong sense of integrity and ethics. They are unwavering in their commitment to fairness and equality, ensuring that all employees are treated with respect and dignity.\n\nThis individual is a strategic thinker, capable of aligning HR initiatives with the overall business goals of the company. They have a keen eye for talent, recognizing and nurturing potential within the organization.\n\nOverall, your Chief Human Resource Officer is a compassionate and visionary leader, dedicated to creating a positive and inclusive work environment that fosters growth and development for all employees.", "\nHere is a new customer's task: {task}.\n"],
"Programmer": ["{chatdev_prompt}\n", "You are a highly skilled and experienced programmer with a deep understanding of software development. Your ability to use the flexible application of GUI in software development is exceptional. You have a keen eye for detail and possess excellent problem-solving skills. Your expertise in GUI design allows you to create user-friendly and visually appealing interfaces that enhance the overall user experience.\n\nAs an individual, you are highly motivated and have a strong work ethic. You are always eager to learn and stay updated with the latest industry trends and technologies. Your excellent communication skills enable you to effectively collaborate with team members and stakeholders, ensuring smooth project execution.\n\nYour ability to think critically and analytically sets you apart from others. You are able to identify potential issues and find innovative solutions to overcome them. Your attention to detail ensures that your code is clean, efficient, and well-documented.\n\nOverall, you are a valuable asset to our team, bringing your exceptional programming skills and expertise in GUI development to create high-quality software solutions for our company.", "\nHere is a new customer's task: {task}.\n"],
"Code Reviewer": ["{chatdev_prompt}\n", "As a Code Reviewer in our company, you possess a unique set of characteristics that set you apart from others in the same position. You have an exceptional eye for detail, allowing you to identify even the smallest errors or inconsistencies in code. Your analytical mindset enables you to approach code reviews with a critical perspective, ensuring that our software meets the highest standards of quality and functionality.\n\nYour exceptional communication skills make you an invaluable asset to our team. You have the ability to provide constructive feedback in a clear and concise manner, helping developers understand and improve their code without feeling discouraged. Your empathetic nature allows you to consider the challenges and limitations faced by your colleagues, fostering a collaborative and supportive environment.\n\nYour passion for continuous learning and staying up-to-date with the latest industry trends sets you apart. You actively seek out new technologies and best practices, incorporating them into your code reviews to drive innovation and efficiency. Your ability to adapt to changing requirements and prioritize tasks effectively ensures that code reviews are completed in a timely manner, contributing to the overall success of our software development process.\n\nIn summary, your attention to detail, analytical mindset, exceptional communication skills, passion for continuous learning, and adaptability make you an outstanding Code Reviewer in our company.", "\nHere is a new customer's task: {task}.\n"],
"Software Test Engineer": ["{chatdev_prompt}\n", "You are a Software Test Engineer who possesses a unique blend of technical expertise and exceptional attention to detail. Your ability to identify even the most subtle defects sets you apart from others in your field. You have an innate curiosity and a relentless drive to uncover hidden issues that may impact the quality of our software.\n\nYour exceptional analytical skills allow you to quickly understand complex systems and identify potential areas of weakness. You have a natural talent for breaking down intricate problems into manageable components, enabling you to design comprehensive test cases that cover all possible scenarios.\n\nYour exceptional communication skills make you an invaluable asset to our team. You have the ability to clearly articulate your findings and collaborate effectively with developers and other stakeholders. Your ability to provide constructive feedback in a diplomatic manner helps foster a positive and collaborative work environment.\n\nYour passion for continuous improvement drives you to stay updated with the latest testing methodologies and tools. You are always seeking ways to enhance our testing processes and contribute to the overall quality of our software.\n\nIn summary, you are a highly skilled and meticulous Software Test Engineer who possesses a unique ability to uncover even the most elusive defects. Your analytical mindset, exceptional communication skills, and passion for continuous improvement make you an invaluable member of our team.", "\nHere is a new customer's task: {task}.\n"],
"Chief Creative Officer": ["{chatdev_prompt}\n", "You need a Chief Creative Officer who possesses an unparalleled ability to think outside the box and challenge conventional norms. This individual must have a proven track record of consistently pushing boundaries and delivering groundbreaking ideas that captivate audiences. They should possess an innate curiosity and an insatiable thirst for knowledge, constantly seeking inspiration from various sources to fuel their creativity.\n\nYour ideal candidate is a visionary who effortlessly combines artistic flair with strategic thinking. They possess a unique blend of analytical and creative skills, allowing them to not only conceptualize innovative ideas but also develop practical strategies to bring them to life. Their exceptional communication skills enable them to articulate their vision clearly and inspire others to embrace their ideas.\n\nThis member stands out from others in their position due to their relentless pursuit of excellence. They possess an unwavering commitment to quality and attention to detail, ensuring that every creative endeavor is executed flawlessly. Their ability to adapt to changing trends and technologies sets them apart, enabling them to stay ahead of the curve and deliver cutting-edge solutions.\n\nIn summary, you require a Chief Creative Officer who is a trailblazer, a master of their craft, and a true visionary. Their unique combination of creativity, strategic thinking, and unwavering commitment to excellence sets them apart from their peers.", "\nHere is a new customer's task: {task}.\n"]}

View File

@ -0,0 +1 @@
Develop a Tetris game.

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,112 @@
import tkinter as tk
import random
from tetris_shapes import ShapeI, ShapeJ, ShapeL, ShapeO, ShapeS, ShapeT, ShapeZ
class Tetris:
def __init__(self, root):
self.root = root
self.canvas = tk.Canvas(self.root, width=300, height=600, bg="white")
self.canvas.pack()
self.board = Board()
self.current_shape = None
self.is_game_over = False
self.root.bind("<KeyPress>", self.handle_keypress)
self.root.after(1000, self.update)
def start_game(self):
self.current_shape = self.generate_shape()
self.draw()
def update(self):
if not self.is_game_over:
self.move_shape_down()
self.draw()
self.root.after(1000, self.update)
def draw(self):
self.canvas.delete("all")
self.draw_board()
if self.current_shape:
self.draw_shape(self.current_shape)
def draw_board(self):
for row in range(len(self.board.grid)):
for col in range(len(self.board.grid[row])):
if self.board.grid[row][col] == 1:
x1 = col * 30
y1 = row * 30
x2 = x1 + 30
y2 = y1 + 30
self.canvas.create_rectangle(x1, y1, x2, y2, fill="blue")
def draw_shape(self, shape):
for coord in shape.get_coordinates():
x1 = coord[0] * 30
y1 = coord[1] * 30
x2 = x1 + 30
y2 = y1 + 30
self.canvas.create_rectangle(x1, y1, x2, y2, fill="red")
def handle_keypress(self, event):
if event.keysym == "Left":
self.move_shape_left()
elif event.keysym == "Right":
self.move_shape_right()
elif event.keysym == "Down":
self.move_shape_down()
elif event.keysym == "Up":
self.rotate_shape()
def move_shape_left(self):
if self.current_shape:
self.current_shape.move_left()
if not self.board.is_valid_move(self.current_shape):
self.current_shape.move_right()
def move_shape_right(self):
if self.current_shape:
self.current_shape.move_right()
if not self.board.is_valid_move(self.current_shape):
self.current_shape.move_left()
def move_shape_down(self):
if self.current_shape:
self.current_shape.move_down()
if not self.board.is_valid_move(self.current_shape):
self.current_shape.move_up()
self.board.place_shape(self.current_shape)
self.clear_lines()
self.current_shape = self.generate_shape()
if not self.board.is_valid_move(self.current_shape):
self.is_game_over = True
def rotate_shape(self):
if self.current_shape:
self.current_shape.rotate()
if not self.board.is_valid_move(self.current_shape):
self.current_shape.rotate_back()
def clear_lines(self):
lines_to_clear = []
for row in range(len(self.board.grid)):
if all(self.board.grid[row]):
lines_to_clear.append(row)
for line in lines_to_clear:
del self.board.grid[line]
self.board.grid.insert(0, [0] * self.board.cols)
def generate_shape(self):
shapes = [ShapeI, ShapeJ, ShapeL, ShapeO, ShapeS, ShapeT, ShapeZ]
shape = random.choice(shapes)
return shape()
class Board:
def __init__(self):
self.rows = 20
self.cols = 10
self.grid = [[0] * self.cols for _ in range(self.rows)]
def is_valid_move(self, shape):
for coord in shape.get_coordinates():
row = coord[1]
col = coord[0]
if row < 0 or row >= self.rows or col < 0 or col >= self.cols or self.grid[row][col] == 1:
return False
return True
def place_shape(self, shape):
for coord in shape.get_coordinates():
row = coord[1]
col = coord[0]
self.grid[row][col] = 1
def is_game_over(self):
return any(self.grid[0])
if __name__ == "__main__":
root = tk.Tk()
tetris = Tetris(root)
tetris.start_game()
root.mainloop()

View File

@ -0,0 +1,30 @@
Task:
Develop a Tetris game.
Config:
ChatEnvConfig.clear_structure: True
ChatEnvConfig.brainstorming: False
ChatEnvConfig.with_memory: False
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:
application
Ideas:
Language:
Python
Code_Version:
7.0
Proposed_images:
0
Incorporated_images:
0

View File

@ -0,0 +1 @@
G

View File

@ -0,0 +1,56 @@
import random
from tetris_shapes import ShapeI, ShapeJ, ShapeL, ShapeO, ShapeS, ShapeT, ShapeZ
class Tetris:
def __init__(self, root):
self.root = root
# Initialize the Tetris game
def start_game(self):
# Start the Tetris game
def update(self):
# Update the Tetris game state
def draw(self):
# Draw the Tetris game board and pieces
def handle_keypress(self, event):
# Handle keypress events
class Board:
def __init__(self):
# Initialize the game board
def is_valid_move(self, shape):
# Check if a move is valid
def place_shape(self, shape):
# Place a shape on the board
def clear_lines(self):
# Clear completed lines
def is_game_over(self):
# Check if the game is over
class Shape:
def __init__(self):
# Initialize the shape
def rotate(self):
# Rotate the shape
def move_left(self):
# Move the shape to the left
def move_right(self):
# Move the shape to the right
def move_down(self):
# Move the shape down
def move_to_bottom(self):
# Move the shape to the bottom
def get_coordinates(self):
# Get the coordinates of the shape
def get_bounding_box(self):
# Get the bounding box of the shape
class ShapeI(Shape):
# Implement the logic for the I shape
class ShapeJ(Shape):
# Implement the logic for the J shape
class ShapeL(Shape):
# Implement the logic for the L shape
class ShapeO(Shape):
# Implement the logic for the O shape
class ShapeS(Shape):
# Implement the logic for the S shape
class ShapeT(Shape):
# Implement the logic for the T shape
class ShapeZ(Shape):
# Implement the logic for the Z shape

View File

@ -0,0 +1,33 @@
import tkinter as tk
class TetrisGame(tk.Canvas):
def __init__(self, master):
super().__init__(master, width=300, height=600, bg="black")
self.board = [[0] * 10 for _ in range(20)]
self.current_shape = None
self.score = 0
self.delay = 500
self.is_game_over = False
self.bind_all("<Key>", self.handle_keypress)
self.after(self.delay, self.update)
def update(self):
if not self.is_game_over:
self.move_shape("down")
self.after(self.delay, self.update)
def move_shape(self, direction):
pass # Implement shape movement logic
def rotate_shape(self):
pass # Implement shape rotation logic
def handle_keypress(self, event):
pass # Handle keypress events
def draw_board(self):
pass # Draw the game board
def draw_shape(self):
pass # Draw the current shape
def check_collision(self):
pass # Check for collision with other shapes or boundaries
def clear_rows(self):
pass # Clear completed rows and update score
def game_over(self):
pass # Handle game over condition
def draw_score(self):
pass # Draw the current score on the canvas

View File

@ -0,0 +1,146 @@
'''
This file contains the Shape classes which represent the Tetris pieces.
'''
import random
class Shape:
def __init__(self):
self.rotation = 0
def rotate(self):
self.rotation = (self.rotation + 1) % 4
def rotate_back(self):
self.rotation = (self.rotation - 1) % 4
def move_left(self):
self.x -= 1
def move_right(self):
self.x += 1
def move_down(self):
self.y += 1
def move_up(self):
self.y -= 1
def get_coordinates(self):
pass
def get_bounding_box(self):
pass
class ShapeI(Shape):
def __init__(self):
super().__init__()
self.x = 3
self.y = 0
def get_coordinates(self):
if self.rotation == 0 or self.rotation == 2:
return [(self.x, self.y), (self.x, self.y + 1), (self.x, self.y + 2), (self.x, self.y + 3)]
else:
return [(self.x, self.y), (self.x + 1, self.y), (self.x + 2, self.y), (self.x + 3, self.y)]
def get_bounding_box(self):
if self.rotation == 0 or self.rotation == 2:
return (self.x, self.y, self.x, self.y + 3)
else:
return (self.x, self.y, self.x + 3, self.y)
class ShapeJ(Shape):
def __init__(self):
super().__init__()
self.x = 3
self.y = 0
def get_coordinates(self):
if self.rotation == 0:
return [(self.x, self.y), (self.x, self.y + 1), (self.x, self.y + 2), (self.x + 1, self.y + 2)]
elif self.rotation == 1:
return [(self.x, self.y), (self.x + 1, self.y), (self.x + 2, self.y), (self.x, self.y + 1)]
elif self.rotation == 2:
return [(self.x, self.y), (self.x + 1, self.y), (self.x + 1, self.y + 1), (self.x + 1, self.y + 2)]
else:
return [(self.x, self.y + 1), (self.x + 1, self.y + 1), (self.x + 2, self.y + 1), (self.x + 2, self.y)]
def get_bounding_box(self):
if self.rotation == 0:
return (self.x, self.y, self.x + 1, self.y + 2)
elif self.rotation == 1:
return (self.x, self.y, self.x + 2, self.y + 1)
elif self.rotation == 2:
return (self.x, self.y, self.x + 1, self.y + 2)
else:
return (self.x, self.y + 1, self.x + 2, self.y)
class ShapeL(Shape):
def __init__(self):
super().__init__()
self.x = 3
self.y = 0
def get_coordinates(self):
if self.rotation == 0:
return [(self.x, self.y + 2), (self.x + 1, self.y + 2), (self.x + 2, self.y + 2), (self.x + 2, self.y + 1)]
elif self.rotation == 1:
return [(self.x, self.y), (self.x, self.y + 1), (self.x + 1, self.y), (self.x + 2, self.y)]
elif self.rotation == 2:
return [(self.x, self.y), (self.x + 1, self.y), (self.x, self.y + 1), (self.x, self.y + 2)]
else:
return [(self.x, self.y), (self.x + 1, self.y), (self.x + 2, self.y), (self.x + 2, self.y + 1)]
def get_bounding_box(self):
if self.rotation == 0:
return (self.x, self.y + 1, self.x + 2, self.y + 2)
elif self.rotation == 1:
return (self.x, self.y, self.x + 2, self.y + 1)
elif self.rotation == 2:
return (self.x, self.y, self.x + 1, self.y + 2)
else:
return (self.x, self.y, self.x + 2, self.y + 1)
class ShapeO(Shape):
def __init__(self):
super().__init__()
self.x = 3
self.y = 0
def get_coordinates(self):
return [(self.x, self.y), (self.x + 1, self.y), (self.x, self.y + 1), (self.x + 1, self.y + 1)]
def get_bounding_box(self):
return (self.x, self.y, self.x + 1, self.y + 1)
class ShapeS(Shape):
def __init__(self):
super().__init__()
self.x = 3
self.y = 0
def get_coordinates(self):
if self.rotation == 0 or self.rotation == 2:
return [(self.x + 1, self.y), (self.x + 2, self.y), (self.x, self.y + 1), (self.x + 1, self.y + 1)]
else:
return [(self.x, self.y), (self.x, self.y + 1), (self.x + 1, self.y + 1), (self.x + 1, self.y + 2)]
def get_bounding_box(self):
if self.rotation == 0 or self.rotation == 2:
return (self.x, self.y, self.x + 2, self.y + 1)
else:
return (self.x, self.y, self.x + 1, self.y + 2)
class ShapeT(Shape):
def __init__(self):
super().__init__()
self.x = 3
self.y = 0
def get_coordinates(self):
if self.rotation == 0:
return [(self.x, self.y), (self.x + 1, self.y), (self.x + 2, self.y), (self.x + 1, self.y + 1)]
elif self.rotation == 1:
return [(self.x + 1, self.y), (self.x, self.y + 1), (self.x + 1, self.y + 1), (self.x + 1, self.y + 2)]
elif self.rotation == 2:
return [(self.x, self.y + 1), (self.x + 1, self.y), (self.x + 1, self.y + 1), (self.x + 2, self.y + 1)]
else:
return [(self.x, self.y), (self.x, self.y + 1), (self.x, self.y + 2), (self.x + 1, self.y + 1)]
def get_bounding_box(self):
if self.rotation == 0:
return (self.x, self.y, self.x + 2, self.y)
elif self.rotation == 1:
return (self.x, self.y, self.x + 1, self.y + 2)
elif self.rotation == 2:
return (self.x, self.y + 1, self.x + 2, self.y + 1)
else:
return (self.x, self.y, self.x + 1, self.y + 2)
class ShapeZ(Shape):
def __init__(self):
super().__init__()
self.x = 3
self.y = 0
def get_coordinates(self):
if self.rotation == 0 or self.rotation == 2:
return [(self.x, self.y), (self.x + 1, self.y), (self.x + 1, self.y + 1), (self.x + 2, self.y + 1)]
else:
return [(self.x + 1, self.y), (self.x, self.y + 1), (self.x + 1, self.y + 1), (self.x, self.y + 2)]
def get_bounding_box(self):
if self.rotation == 0 or self.rotation == 2:
return (self.x, self.y, self.x + 2, self.y + 1)
else:
return (self.x, self.y, self.x + 1, self.y + 2)