mirror of
https://github.com/OpenBMB/ChatDev.git
synced 2024-11-07 18:40:13 +03:00
ModelBest1024
This commit is contained in:
parent
b51595d303
commit
cc863a4181
@ -0,0 +1 @@
|
||||
Help me design a tool. I input an article. You can help me find a suitable picture from the internet for this article from the Internet, and assign the picture to a suitable position in the article. At the same time, make a markdown based layout for the article as a whole, making the article look like a professional official account article
|
@ -0,0 +1,114 @@
|
||||
{
|
||||
"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",
|
||||
"brainstorming": "False",
|
||||
"gui_design": "True",
|
||||
"git_management": "False",
|
||||
"self_improve": "False"
|
||||
}
|
@ -0,0 +1,301 @@
|
||||
{
|
||||
"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}\".",
|
||||
"Ideas: \"{ideas}\".",
|
||||
"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}\".",
|
||||
"Modality: \"{modality}\".",
|
||||
"Programming Language: \"{language}\"",
|
||||
"Ideas:\"{ideas}\"",
|
||||
"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)."
|
||||
]
|
||||
},
|
||||
"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}\".",
|
||||
"Modality: \"{modality}\".",
|
||||
"Programming Language: \"{language}\"",
|
||||
"Codes:",
|
||||
"\"{codes}\"",
|
||||
"Unimplemented File:",
|
||||
"\"{unimplemented_file}\"",
|
||||
"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:",
|
||||
"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."
|
||||
]
|
||||
},
|
||||
"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}\"",
|
||||
"Ideas: \"{ideas}\"",
|
||||
"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. 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\"."
|
||||
]
|
||||
},
|
||||
"CodeReviewModification": {
|
||||
"assistant_role_name": "Programmer",
|
||||
"user_role_name": "Code Reviewer",
|
||||
"phase_prompt": [
|
||||
"According to the new user's task, our designed product modality, languages and ideas, our developed first-edition source codes are listed below: ",
|
||||
"Task: \"{task}\".",
|
||||
"Modality: \"{modality}\".",
|
||||
"Programming Language: \"{language}\"",
|
||||
"Ideas: \"{ideas}\"",
|
||||
"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. Then, output the full and complete codes with all bugs fixed based on the comments. Return all codes strictly following the required format."
|
||||
]
|
||||
},
|
||||
"CodeReviewHuman": {
|
||||
"assistant_role_name": "Programmer",
|
||||
"user_role_name": "Code Reviewer",
|
||||
"phase_prompt": [
|
||||
"According to the new user's task, our designed product modality and three creative ideas, our developed first-edition source codes are listed below: ",
|
||||
"Task: \"{task}\".",
|
||||
"Modality: \"{modality}\".",
|
||||
"Programming Language: \"{language}\"",
|
||||
"Ideas: \"{ideas}\"",
|
||||
"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. Then, output the full and complete codes with all bugs fixed based on the comments. Return all codes strictly following the required format."
|
||||
]
|
||||
},
|
||||
"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."
|
||||
]
|
||||
},
|
||||
"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\"."
|
||||
]
|
||||
},
|
||||
"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}\"",
|
||||
"Ideas: \"{ideas}\"",
|
||||
"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}\"",
|
||||
"Ideas: \"{ideas}\"",
|
||||
"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`",
|
||||
"## 🤔 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:",
|
||||
"**❓ Question Answering over specific documents**",
|
||||
"- Documentation",
|
||||
"- End-to-end Example: Question Answering over Notion Database",
|
||||
"**🤖 Agents**",
|
||||
"- Documentation",
|
||||
"- End-to-end Example: GPT+WolframAlpha",
|
||||
"## 📖 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)",
|
||||
"```"
|
||||
]
|
||||
}
|
||||
}
|
@ -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."
|
||||
]
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
'''
|
||||
This file contains the Article class that represents an article and its layout.
|
||||
'''
|
||||
class Article:
|
||||
def __init__(self):
|
||||
self.content = ""
|
||||
self.image_url = ""
|
||||
def assign_image(self, image_url):
|
||||
self.image_url = image_url
|
||||
def generate_layout(self, article_text):
|
||||
self.content = article_text
|
||||
# Generate markdown layout based on the article content and assigned image
|
||||
layout = f"![Article Image]({self.image_url})\n\n{self.content}"
|
||||
return layout
|
@ -0,0 +1,8 @@
|
||||
'''
|
||||
This file contains the ImageFinder class that is responsible for finding a suitable image for the article.
|
||||
'''
|
||||
class ImageFinder:
|
||||
def find_image(self, article_text):
|
||||
# Implement logic to find a suitable image based on the article text
|
||||
# Return the URL of the found image
|
||||
pass
|
@ -0,0 +1,35 @@
|
||||
'''
|
||||
This is the main file that will be executed to run the tool.
|
||||
'''
|
||||
import tkinter as tk
|
||||
from article import Article
|
||||
from image_finder import ImageFinder
|
||||
class ToolGUI:
|
||||
def __init__(self, root):
|
||||
self.root = root
|
||||
self.root.title("Article Tool")
|
||||
self.article = Article()
|
||||
self.image_finder = ImageFinder()
|
||||
self.create_widgets()
|
||||
def create_widgets(self):
|
||||
# Create input text box for the article
|
||||
self.article_text = tk.Text(self.root, height=10, width=50)
|
||||
self.article_text.pack()
|
||||
# Create button to find and assign image
|
||||
self.find_image_button = tk.Button(self.root, text="Find Image", command=self.find_and_assign_image)
|
||||
self.find_image_button.pack()
|
||||
# Create button to generate markdown layout
|
||||
self.generate_layout_button = tk.Button(self.root, text="Generate Layout", command=self.generate_layout)
|
||||
self.generate_layout_button.pack()
|
||||
def find_and_assign_image(self):
|
||||
article_text = self.article_text.get("1.0", tk.END)
|
||||
image_url = self.image_finder.find_image(article_text)
|
||||
self.article.assign_image(image_url)
|
||||
def generate_layout(self):
|
||||
article_text = self.article_text.get("1.0", tk.END)
|
||||
layout = self.article.generate_layout(article_text)
|
||||
# Display layout in a new window or save it to a file
|
||||
if __name__ == "__main__":
|
||||
root = tk.Tk()
|
||||
tool_gui = ToolGUI(root)
|
||||
root.mainloop()
|
@ -0,0 +1 @@
|
||||
Help me design a tool. I input an article. You can help me find a suitable picture from the internet for this article from the Internet, and assign the picture to a suitable position in the article. At the same time, make a markdown based layout for the article as a whole, making the article look like a professional official account article
|
File diff suppressed because one or more lines are too long
@ -0,0 +1,114 @@
|
||||
{
|
||||
"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",
|
||||
"brainstorming": "False",
|
||||
"gui_design": "True",
|
||||
"git_management": "False",
|
||||
"self_improve": "False"
|
||||
}
|
@ -0,0 +1,301 @@
|
||||
{
|
||||
"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}\".",
|
||||
"Ideas: \"{ideas}\".",
|
||||
"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}\".",
|
||||
"Modality: \"{modality}\".",
|
||||
"Programming Language: \"{language}\"",
|
||||
"Ideas:\"{ideas}\"",
|
||||
"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)."
|
||||
]
|
||||
},
|
||||
"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}\".",
|
||||
"Modality: \"{modality}\".",
|
||||
"Programming Language: \"{language}\"",
|
||||
"Codes:",
|
||||
"\"{codes}\"",
|
||||
"Unimplemented File:",
|
||||
"\"{unimplemented_file}\"",
|
||||
"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:",
|
||||
"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."
|
||||
]
|
||||
},
|
||||
"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}\"",
|
||||
"Ideas: \"{ideas}\"",
|
||||
"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. 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\"."
|
||||
]
|
||||
},
|
||||
"CodeReviewModification": {
|
||||
"assistant_role_name": "Programmer",
|
||||
"user_role_name": "Code Reviewer",
|
||||
"phase_prompt": [
|
||||
"According to the new user's task, our designed product modality, languages and ideas, our developed first-edition source codes are listed below: ",
|
||||
"Task: \"{task}\".",
|
||||
"Modality: \"{modality}\".",
|
||||
"Programming Language: \"{language}\"",
|
||||
"Ideas: \"{ideas}\"",
|
||||
"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. Then, output the full and complete codes with all bugs fixed based on the comments. Return all codes strictly following the required format."
|
||||
]
|
||||
},
|
||||
"CodeReviewHuman": {
|
||||
"assistant_role_name": "Programmer",
|
||||
"user_role_name": "Code Reviewer",
|
||||
"phase_prompt": [
|
||||
"According to the new user's task, our designed product modality and three creative ideas, our developed first-edition source codes are listed below: ",
|
||||
"Task: \"{task}\".",
|
||||
"Modality: \"{modality}\".",
|
||||
"Programming Language: \"{language}\"",
|
||||
"Ideas: \"{ideas}\"",
|
||||
"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. Then, output the full and complete codes with all bugs fixed based on the comments. Return all codes strictly following the required format."
|
||||
]
|
||||
},
|
||||
"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."
|
||||
]
|
||||
},
|
||||
"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\"."
|
||||
]
|
||||
},
|
||||
"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}\"",
|
||||
"Ideas: \"{ideas}\"",
|
||||
"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}\"",
|
||||
"Ideas: \"{ideas}\"",
|
||||
"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`",
|
||||
"## 🤔 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:",
|
||||
"**❓ Question Answering over specific documents**",
|
||||
"- Documentation",
|
||||
"- End-to-end Example: Question Answering over Notion Database",
|
||||
"**🤖 Agents**",
|
||||
"- Documentation",
|
||||
"- End-to-end Example: GPT+WolframAlpha",
|
||||
"## 📖 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)",
|
||||
"```"
|
||||
]
|
||||
}
|
||||
}
|
@ -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."
|
||||
]
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
'''
|
||||
This file contains the ArticleProcessor class which is responsible for processing the article.
|
||||
'''
|
||||
from markdown_maker import MarkdownMaker
|
||||
from image_finder import ImageFinder
|
||||
class ArticleProcessor:
|
||||
def __init__(self, article):
|
||||
self.article = article
|
||||
def process_article(self):
|
||||
# Find an image for the article
|
||||
finder = ImageFinder(self.article)
|
||||
image_url = finder.find_image()
|
||||
# Create the markdown
|
||||
maker = MarkdownMaker(self.article, image_url)
|
||||
markdown = maker.create_markdown()
|
||||
return markdown
|
@ -0,0 +1,17 @@
|
||||
'''
|
||||
This file contains the ImageFinder class which is responsible for finding an image related to the article.
|
||||
'''
|
||||
import requests
|
||||
from bs4 import BeautifulSoup
|
||||
class ImageFinder:
|
||||
def __init__(self, article):
|
||||
self.article = article
|
||||
def find_image(self):
|
||||
# Here we use a simple method to find an image: we search for the article title on Google Images and return the first result.
|
||||
# In a real application, you would want to use a more sophisticated method, such as a machine learning model trained to find relevant images.
|
||||
query = self.article.split(' ')[0] # Use the first word of the article as the query
|
||||
url = f"https://www.google.com/search?q={query}&tbm=isch"
|
||||
response = requests.get(url)
|
||||
soup = BeautifulSoup(response.text, 'html.parser')
|
||||
image_url = soup.find('img')['src']
|
||||
return image_url
|
@ -0,0 +1,15 @@
|
||||
'''
|
||||
This is the main page where the user can input their article.
|
||||
'''
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Article Processor</title>
|
||||
</head>
|
||||
<body>
|
||||
<form method="POST">
|
||||
<textarea name="article" required></textarea>
|
||||
<button type="submit">Process Article</button>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,19 @@
|
||||
'''
|
||||
This is the main file that will run our application.
|
||||
'''
|
||||
from flask import Flask, render_template, request
|
||||
from article_processor import ArticleProcessor
|
||||
app = Flask(__name__)
|
||||
@app.route('/', methods=['GET', 'POST'])
|
||||
def index():
|
||||
if request.method == 'POST':
|
||||
article = request.form['article']
|
||||
processor = ArticleProcessor(article)
|
||||
markdown = processor.process_article()
|
||||
return render_template('result.html', markdown=markdown)
|
||||
return render_template('index.html')
|
||||
if __name__ == "__main__":
|
||||
try:
|
||||
app.run(debug=True)
|
||||
except ImportError:
|
||||
print("Error: The watchdog library is not installed. Please install it by running 'pip install watchdog' in your terminal.")
|
@ -0,0 +1,39 @@
|
||||
# User Manual
|
||||
|
||||
## Introduction
|
||||
|
||||
Welcome to our Article Processor tool. This tool is designed to help you enhance your articles by automatically finding suitable images from the internet and placing them at suitable positions in your article. The tool also provides a markdown-based layout for your article, making it look like a professional official account article.
|
||||
|
||||
## Main Functions
|
||||
|
||||
1. **Image Finder**: This function takes your article as input and finds a suitable image from the internet that matches the context of your article.
|
||||
|
||||
2. **Markdown Layout**: This function takes your article and the found image and creates a markdown-based layout for your article. The image is placed at a suitable position in the article.
|
||||
|
||||
## Installation
|
||||
|
||||
To install the required dependencies for this tool, you need to have Python installed on your system. If you don't have Python installed, you can download it from the official Python website.
|
||||
|
||||
Once you have Python installed, open your terminal and navigate to the project directory. Then, run the following command to install the required dependencies:
|
||||
|
||||
```bash
|
||||
pip install -r requirements.txt
|
||||
```
|
||||
|
||||
This command will install Flask for web development, BeautifulSoup for parsing HTML and extracting data, Markdown for creating markdown-based layout for the article, and Requests for making HTTP requests to fetch images from the internet.
|
||||
|
||||
## How to Use
|
||||
|
||||
1. **Start the Application**: To start the application, open your terminal, navigate to the project directory, and run the following command:
|
||||
|
||||
```bash
|
||||
python main.py
|
||||
```
|
||||
|
||||
This command will start the Flask server and the application will be accessible at `http://localhost:5000`.
|
||||
|
||||
2. **Input Your Article**: Open your web browser and go to `http://localhost:5000`. You will see a text area where you can input your article. After inputting your article, click the `Process Article` button.
|
||||
|
||||
3. **View the Result**: After clicking the `Process Article` button, you will be redirected to a new page where you can see your article with the found image and the markdown-based layout.
|
||||
|
||||
Please note that the image finding process is based on the first word of your article. Therefore, make sure the first word of your article is a good representation of the overall context of the article.
|
@ -0,0 +1,15 @@
|
||||
'''
|
||||
This file contains the MarkdownMaker class which is responsible for creating the markdown.
|
||||
'''
|
||||
import markdown
|
||||
class MarkdownMaker:
|
||||
def __init__(self, article, image_url):
|
||||
self.article = article
|
||||
self.image_url = image_url
|
||||
def create_markdown(self):
|
||||
md = markdown.Markdown()
|
||||
md_article = md.convert(self.article)
|
||||
md_image = f"![Image]({self.image_url})"
|
||||
md_article = md_article.replace("\n", "\n\n" + md_image + "\n\n", 1)
|
||||
with open('output.md', 'w') as file:
|
||||
file.write(md_article)
|
@ -0,0 +1,30 @@
|
||||
Task:
|
||||
Help me design a tool. I input an article. You can help me find a suitable picture from the internet for this article from the Internet, and assign the picture to a suitable position in the article. At the same time, make a markdown based layout for the article as a whole, making the article look like a professional official account article
|
||||
|
||||
Config:
|
||||
ChatEnvConfig.clear_structure: True
|
||||
ChatEnvConfig.git_management: False
|
||||
ChatEnvConfig.gui_design: True
|
||||
|
||||
|
||||
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:
|
||||
12.0
|
||||
|
||||
Proposed_images:
|
||||
0
|
||||
|
||||
Incorporated_images:
|
||||
0
|
||||
|
@ -0,0 +1,5 @@
|
||||
|
||||
This file specifies that our project requires Flask for web development, BeautifulSoup for parsing HTML and extracting data, Markdown for creating markdown based layout for the article, and Requests for making HTTP requests to fetch images from the internet. The versions listed are the latest stable versions at the time of writing, but they can be adjusted as necessary for the project.
|
||||
|
||||
To install these dependencies, you can use pip, a package installer for Python. Simply run the following command in your terminal:
|
||||
|
@ -0,0 +1,12 @@
|
||||
'''
|
||||
This page displays the processed article in markdown format.
|
||||
'''
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Processed Article</title>
|
||||
</head>
|
||||
<body>
|
||||
<pre>{{ markdown }}</pre>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,114 @@
|
||||
{
|
||||
"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",
|
||||
"brainstorming": "False",
|
||||
"gui_design": "True",
|
||||
"git_management": "False",
|
||||
"self_improve": "False"
|
||||
}
|
@ -0,0 +1 @@
|
||||
Build a file content conversion tool. When I select a Python file, I add a line of comments at the end of each line of code in the file to praise the programmer. The perspectives of praise should be as diverse as possible, including the logical clarity of the code and the novelty of his ideas. If I cannot find praise, I will randomly select some from other good qualities to praise him
|
File diff suppressed because one or more lines are too long
@ -0,0 +1,301 @@
|
||||
{
|
||||
"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}\".",
|
||||
"Ideas: \"{ideas}\".",
|
||||
"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}\".",
|
||||
"Modality: \"{modality}\".",
|
||||
"Programming Language: \"{language}\"",
|
||||
"Ideas:\"{ideas}\"",
|
||||
"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)."
|
||||
]
|
||||
},
|
||||
"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}\".",
|
||||
"Modality: \"{modality}\".",
|
||||
"Programming Language: \"{language}\"",
|
||||
"Codes:",
|
||||
"\"{codes}\"",
|
||||
"Unimplemented File:",
|
||||
"\"{unimplemented_file}\"",
|
||||
"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:",
|
||||
"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."
|
||||
]
|
||||
},
|
||||
"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}\"",
|
||||
"Ideas: \"{ideas}\"",
|
||||
"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. 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\"."
|
||||
]
|
||||
},
|
||||
"CodeReviewModification": {
|
||||
"assistant_role_name": "Programmer",
|
||||
"user_role_name": "Code Reviewer",
|
||||
"phase_prompt": [
|
||||
"According to the new user's task, our designed product modality, languages and ideas, our developed first-edition source codes are listed below: ",
|
||||
"Task: \"{task}\".",
|
||||
"Modality: \"{modality}\".",
|
||||
"Programming Language: \"{language}\"",
|
||||
"Ideas: \"{ideas}\"",
|
||||
"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. Then, output the full and complete codes with all bugs fixed based on the comments. Return all codes strictly following the required format."
|
||||
]
|
||||
},
|
||||
"CodeReviewHuman": {
|
||||
"assistant_role_name": "Programmer",
|
||||
"user_role_name": "Code Reviewer",
|
||||
"phase_prompt": [
|
||||
"According to the new user's task, our designed product modality and three creative ideas, our developed first-edition source codes are listed below: ",
|
||||
"Task: \"{task}\".",
|
||||
"Modality: \"{modality}\".",
|
||||
"Programming Language: \"{language}\"",
|
||||
"Ideas: \"{ideas}\"",
|
||||
"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. Then, output the full and complete codes with all bugs fixed based on the comments. Return all codes strictly following the required format."
|
||||
]
|
||||
},
|
||||
"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."
|
||||
]
|
||||
},
|
||||
"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\"."
|
||||
]
|
||||
},
|
||||
"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}\"",
|
||||
"Ideas: \"{ideas}\"",
|
||||
"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}\"",
|
||||
"Ideas: \"{ideas}\"",
|
||||
"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`",
|
||||
"## 🤔 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:",
|
||||
"**❓ Question Answering over specific documents**",
|
||||
"- Documentation",
|
||||
"- End-to-end Example: Question Answering over Notion Database",
|
||||
"**🤖 Agents**",
|
||||
"- Documentation",
|
||||
"- End-to-end Example: GPT+WolframAlpha",
|
||||
"## 📖 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)",
|
||||
"```"
|
||||
]
|
||||
}
|
||||
}
|
@ -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."
|
||||
]
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
'''
|
||||
This file contains a function to process the selected Python file.
|
||||
The function reads the file, adds praises to each line, and writes the result to a new file.
|
||||
The new file has the same name as the original file, but with "praised_" added at the beginning.
|
||||
'''
|
||||
from praise_generator import generate_praise
|
||||
def process_file(filename):
|
||||
try:
|
||||
with open(filename, "r", encoding="utf8") as file:
|
||||
lines = file.readlines()
|
||||
except IOError as e:
|
||||
print(f"Unable to open file: {e}")
|
||||
return
|
||||
new_lines = []
|
||||
for line in lines:
|
||||
if line.strip() and not line.strip().startswith("#"):
|
||||
# Check if there is already a comment on the line
|
||||
if "#" not in line:
|
||||
line = line.rstrip() + " # " + generate_praise(line) + "\n"
|
||||
new_lines.append(line)
|
||||
try:
|
||||
with open("praised_" + filename.split('/')[-1], "w", encoding="utf8") as file:
|
||||
for line in new_lines:
|
||||
file.write(line)
|
||||
except IOError as e:
|
||||
print(f"Unable to write to file: {e}")
|
@ -0,0 +1,17 @@
|
||||
'''
|
||||
This is the main file that runs the application.
|
||||
When you run this application, a window will open with a button saying "Select Python File".
|
||||
Click on this button to select the Python file you want to process.
|
||||
The application will add a line of praise at the end of each line of code in the file.
|
||||
'''
|
||||
import tkinter as tk
|
||||
from tkinter import filedialog, messagebox
|
||||
from file_processor import process_file
|
||||
def select_file():
|
||||
filename = filedialog.askopenfilename(filetypes=[("Python files", "*.py")])
|
||||
process_file(filename)
|
||||
messagebox.showinfo("Information","Task Completed Successfully")
|
||||
root = tk.Tk()
|
||||
button = tk.Button(root, text="Select Python File", command=select_file)
|
||||
button.pack()
|
||||
root.mainloop()
|
@ -0,0 +1,91 @@
|
||||
manual.md
|
||||
|
||||
# Python Praise Generator
|
||||
|
||||
A tool to add praises to your Python code
|
||||
|
||||
## Quick Install
|
||||
|
||||
This application is built using Python. If you don't have Python installed, you can download it from [here](https://www.python.org/downloads/).
|
||||
|
||||
After installing Python, you need to install the tkinter library. You can do this by running the following command in your terminal:
|
||||
|
||||
`pip install tkinter`
|
||||
|
||||
## 🤔 What is this?
|
||||
|
||||
This is a simple application that adds praises to your Python code. When you select a Python file, the application will praise the programmer.
|
||||
|
||||
## 📖 Documentation
|
||||
|
||||
Please see below 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)
|
||||
|
||||
## Getting Started
|
||||
|
||||
After installing Python and tkinter, download the application files (main.py, praise_generator.py, and file_processor.py) and save them in the same directory.
|
||||
|
||||
To run the application, open your terminal, navigate to the directory where you saved the files, and run the following command:
|
||||
|
||||
`python main.py`
|
||||
|
||||
A window will open with a button saying "Select Python File". Click on this button to select the Python file you want to process. The application will add a line of praise at the end of each line of code in the file.
|
||||
|
||||
## How-To Examples
|
||||
|
||||
Here is an example of how the application works:
|
||||
|
||||
Original Python code:
|
||||
|
||||
```python
|
||||
def hello_world():
|
||||
print("Hello, world!")
|
||||
```
|
||||
|
||||
After processing with the application:
|
||||
|
||||
```python
|
||||
def hello_world(): # Incredible function definition!
|
||||
print("Hello, world!") # Excellent variable assignment!
|
||||
```
|
||||
|
||||
Also the appilication can also comment other information:
|
||||
|
||||
```python
|
||||
你挑着担
|
||||
我牵着马
|
||||
```
|
||||
|
||||
After processing with the application:
|
||||
|
||||
```python
|
||||
你挑着担 # Exceptional understanding of concepts!
|
||||
我牵着马 # Innovative approach!
|
||||
```
|
||||
|
||||
you mean, why don't I add more file formats in it? Because I'm poor and busy :P
|
||||
|
||||
## Reference
|
||||
|
||||
The application consists of three Python files:
|
||||
|
||||
- main.py: This is the main file that runs the application.
|
||||
|
||||
- praise_generator.py: This file contains a function to generate random praises.
|
||||
|
||||
- file_processor.py: This file contains a function to process the selected Python file.
|
||||
|
||||
## Resources
|
||||
|
||||
For more information about Python and tkinter, you can check out the following resources:
|
||||
|
||||
- [Python Documentation](https://docs.python.org/3/)
|
||||
|
||||
- [Tkinter Documentation](https://docs.python.org/3/library/tkinter.html)
|
@ -0,0 +1,30 @@
|
||||
Task:
|
||||
Build a file content conversion tool. When I select a Python file, I add a line of comments at the end of each line of code in the file to praise the programmer. The perspectives of praise should be as diverse as possible, including the logical clarity of the code and the novelty of his ideas. If I cannot find praise, I will randomly select some from other good qualities to praise him
|
||||
|
||||
Config:
|
||||
ChatEnvConfig.clear_structure: True
|
||||
ChatEnvConfig.git_management: False
|
||||
ChatEnvConfig.gui_design: True
|
||||
|
||||
|
||||
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:
|
||||
9.0
|
||||
|
||||
Proposed_images:
|
||||
0
|
||||
|
||||
Incorporated_images:
|
||||
0
|
||||
|
@ -0,0 +1,18 @@
|
||||
'''
|
||||
This file contains a function to generate random praises.
|
||||
The function checks the content of each line and generates a relevant praise.
|
||||
If the line does not contain any recognizable pattern, a random praise is generated.
|
||||
'''
|
||||
import random
|
||||
def generate_praise(line):
|
||||
if 'def' in line:
|
||||
return "Incredible function definition!"
|
||||
elif 'if' in line or 'else' in line:
|
||||
return "Outstanding use of conditionals!"
|
||||
elif 'for' in line or 'while' in line:
|
||||
return "Brilliant loop implementation!"
|
||||
elif '=' in line:
|
||||
return "Excellent variable assignment!"
|
||||
else:
|
||||
praises = ["Remarkable coding!", "Innovative approach!", "Exceptional understanding of concepts!"]
|
||||
return random.choice(praises)
|
@ -0,0 +1,2 @@
|
||||
你挑着担 # Exceptional understanding of concepts!
|
||||
我牵着马 # Innovative approach!
|
@ -0,0 +1,2 @@
|
||||
你挑着担
|
||||
我牵着马
|
@ -0,0 +1,101 @@
|
||||
{
|
||||
"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": "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",
|
||||
"brainstorming": "False",
|
||||
"gui_design": "True",
|
||||
"git_management": "False",
|
||||
"self_improve": "False"
|
||||
}
|
@ -0,0 +1,277 @@
|
||||
{
|
||||
"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}\".",
|
||||
"Ideas: \"{ideas}\".",
|
||||
"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}\".",
|
||||
"Modality: \"{modality}\".",
|
||||
"Programming Language: \"{language}\"",
|
||||
"Ideas:\"{ideas}\"",
|
||||
"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)."
|
||||
]
|
||||
},
|
||||
"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}\".",
|
||||
"Modality: \"{modality}\".",
|
||||
"Programming Language: \"{language}\"",
|
||||
"Codes:",
|
||||
"\"{codes}\"",
|
||||
"Unimplemented File:",
|
||||
"\"{unimplemented_file}\"",
|
||||
"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:",
|
||||
"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."
|
||||
]
|
||||
},
|
||||
"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}\"",
|
||||
"Ideas: \"{ideas}\"",
|
||||
"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. 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\"."
|
||||
]
|
||||
},
|
||||
"CodeReviewModification": {
|
||||
"assistant_role_name": "Programmer",
|
||||
"user_role_name": "Code Reviewer",
|
||||
"phase_prompt": [
|
||||
"According to the new user's task, our designed product modality, languages and ideas, our developed first-edition source codes are listed below: ",
|
||||
"Task: \"{task}\".",
|
||||
"Modality: \"{modality}\".",
|
||||
"Programming Language: \"{language}\"",
|
||||
"Ideas: \"{ideas}\"",
|
||||
"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. Then, output the full and complete codes with all bugs fixed based on the comments. Return all codes strictly following the required format."
|
||||
]
|
||||
},
|
||||
"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."
|
||||
]
|
||||
},
|
||||
"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\"."
|
||||
]
|
||||
},
|
||||
"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}\"",
|
||||
"Ideas: \"{ideas}\"",
|
||||
"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}\"",
|
||||
"Ideas: \"{ideas}\"",
|
||||
"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`",
|
||||
"## 🤔 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:",
|
||||
"**❓ Question Answering over specific documents**",
|
||||
"- Documentation",
|
||||
"- End-to-end Example: Question Answering over Notion Database",
|
||||
"**🤖 Agents**",
|
||||
"- Documentation",
|
||||
"- End-to-end Example: GPT+WolframAlpha",
|
||||
"## 📖 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)",
|
||||
"```"
|
||||
]
|
||||
}
|
||||
}
|
@ -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."
|
||||
]
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
import tkinter as tk
|
||||
class DemoGUI:
|
||||
def __init__(self, root):
|
||||
self.root = root
|
||||
self.root.title("Demo GUI")
|
||||
self.create_widgets()
|
||||
def create_widgets(self):
|
||||
self.label = tk.Label(self.root, text="Hello, World!")
|
||||
self.label.pack()
|
||||
self.button = tk.Button(self.root, text="Click Me", command=self.button_clicked)
|
||||
self.button.pack()
|
||||
def button_clicked(self):
|
||||
self.label.config(text="Button Clicked!")
|
@ -0,0 +1,11 @@
|
||||
'''
|
||||
This is the main file that runs the demo.
|
||||
'''
|
||||
import tkinter as tk
|
||||
from demo_gui import DemoGUI
|
||||
def main():
|
||||
root = tk.Tk()
|
||||
demo_gui = DemoGUI(root)
|
||||
root.mainloop()
|
||||
if __name__ == "__main__":
|
||||
main()
|
@ -0,0 +1,55 @@
|
||||
# ChatDev Demo
|
||||
|
||||
## Introduction
|
||||
|
||||
Welcome to ChatDev Demo! This software is a simple demo that showcases a basic graphical user interface (GUI) using Python and the tkinter library. In this manual, you will find instructions on how to install the necessary dependencies and how to use the software.
|
||||
|
||||
## Installation
|
||||
|
||||
To install the required dependencies, please follow these steps:
|
||||
|
||||
1. Ensure that you have Python installed on your system. If not, you can download and install Python from the official website: [Python Downloads](https://www.python.org/downloads/)
|
||||
|
||||
2. Open a terminal or command prompt.
|
||||
|
||||
3. Navigate to the directory where you have saved the demo files.
|
||||
|
||||
4. Run the following command to install the dependencies:
|
||||
|
||||
```shell
|
||||
pip install -r requirements.txt
|
||||
```
|
||||
|
||||
5. Wait for the installation to complete.
|
||||
|
||||
## Usage
|
||||
|
||||
To run the ChatDev Demo, please follow these steps:
|
||||
|
||||
1. Open a terminal or command prompt.
|
||||
|
||||
2. Navigate to the directory where you have saved the demo files.
|
||||
|
||||
3. Run the following command to start the demo:
|
||||
|
||||
```shell
|
||||
python main.py
|
||||
```
|
||||
|
||||
4. A GUI window will open with a label displaying "Hello, World!" and a button labeled "Click Me".
|
||||
|
||||
5. Click the "Click Me" button to see the label text change to "Button Clicked!".
|
||||
|
||||
6. You can close the GUI window by clicking the close button or by pressing the "X" button.
|
||||
|
||||
## Conclusion
|
||||
|
||||
Congratulations! You have successfully installed and used the ChatDev Demo. This simple demo showcases the basic functionality of a GUI using Python and the tkinter library. Feel free to explore and modify the code to create your own GUI applications.
|
||||
|
||||
If you have any questions or need further assistance, please don't hesitate to reach out to our support team. We are here to help you.
|
||||
|
||||
Happy coding!
|
||||
|
||||
---
|
||||
|
||||
Note: This manual is written in Markdown format. You can use any Markdown editor or viewer to read and format the content.
|
@ -0,0 +1,30 @@
|
||||
Task:
|
||||
show me a simple demo
|
||||
|
||||
Config:
|
||||
ChatEnvConfig.clear_structure: True
|
||||
ChatEnvConfig.git_management: False
|
||||
ChatEnvConfig.gui_design: True
|
||||
|
||||
|
||||
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:
|
||||
4.0
|
||||
|
||||
Proposed_images:
|
||||
0
|
||||
|
||||
Incorporated_images:
|
||||
0
|
||||
|
@ -0,0 +1 @@
|
||||
tkinter
|
@ -0,0 +1 @@
|
||||
show me a simple demo
|
File diff suppressed because it is too large
Load Diff
@ -39,7 +39,7 @@ class Phase(ABC):
|
||||
self.user_role_prompt = role_prompts[user_role_name]
|
||||
self.ceo_prompt = role_prompts["Chief Executive Officer"]
|
||||
self.counselor_prompt = role_prompts["Counselor"]
|
||||
self.timeout_seconds = 1.0
|
||||
self.timeout_seconds = 30.0
|
||||
self.max_retries = 3
|
||||
self.reflection_prompt = """Here is a conversation between two roles: {conversations} {question}"""
|
||||
self.model_type = model_type
|
||||
|
Loading…
Reference in New Issue
Block a user