mirror of
https://github.com/OpenBMB/ChatDev.git
synced 2024-11-07 18:40:13 +03:00
add QRCodeGenerator
This commit is contained in:
parent
2759d4cb94
commit
7048947712
@ -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"
|
||||
}
|
277
WareHouse/QRCodeGenerator_THUNLP_20231015214731/PhaseConfig.json
Normal file
277
WareHouse/QRCodeGenerator_THUNLP_20231015214731/PhaseConfig.json
Normal file
@ -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 @@
|
||||
Write a Python program that generates QR codes. Your program should take user input for the data or text that needs to be encoded in the QR code. It should then use a suitable library or package to generate a QR code image from the input data. Finally, the program should save the QR code image to a file, allowing the user to specify the file name and format (e.g., PNG, JPG).Make sure to provide a user-friendly interface that guides the user through the process of inputting the data and specifying the file name and format for the QR code image. Test your program with various inputs to ensure it generates valid QR codes and handles different data types gracefully.
|
File diff suppressed because one or more lines are too long
Binary file not shown.
After Width: | Height: | Size: 436 B |
@ -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."
|
||||
]
|
||||
}
|
BIN
WareHouse/QRCodeGenerator_THUNLP_20231015214731/code.png
Normal file
BIN
WareHouse/QRCodeGenerator_THUNLP_20231015214731/code.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 635 B |
41
WareHouse/QRCodeGenerator_THUNLP_20231015214731/main.py
Normal file
41
WareHouse/QRCodeGenerator_THUNLP_20231015214731/main.py
Normal file
@ -0,0 +1,41 @@
|
||||
'''
|
||||
This is the main file that contains the user interface and orchestrates the generation of QR codes.
|
||||
'''
|
||||
import tkinter as tk
|
||||
from tkinter import filedialog, messagebox
|
||||
import qrcode
|
||||
class QRCodeGenerator:
|
||||
def __init__(self, root):
|
||||
self.root = root
|
||||
self.root.title("QR Code Generator")
|
||||
self.data_label = tk.Label(root, text="Enter data or text:")
|
||||
self.data_label.pack()
|
||||
self.data_entry = tk.Entry(root)
|
||||
self.data_entry.pack()
|
||||
self.file_label = tk.Label(root, text="Choose file name and format:")
|
||||
self.file_label.pack()
|
||||
self.file_entry = tk.Entry(root)
|
||||
self.file_entry.pack()
|
||||
self.file_button = tk.Button(root, text="Choose File", command=self.choose_file)
|
||||
self.file_button.pack()
|
||||
self.generate_button = tk.Button(root, text="Generate QR Code", command=self.generate_qr_code)
|
||||
self.generate_button.pack()
|
||||
def choose_file(self):
|
||||
file_path = filedialog.asksaveasfilename(defaultextension=".png")
|
||||
self.file_entry.delete(0, tk.END)
|
||||
self.file_entry.insert(0, file_path)
|
||||
def generate_qr_code(self):
|
||||
data = self.data_entry.get()
|
||||
file_path = self.file_entry.get()
|
||||
if data and file_path:
|
||||
qr = qrcode.QRCode(version=1, box_size=10, border=5)
|
||||
qr.add_data(data)
|
||||
qr.make(fit=True)
|
||||
qr_img = qr.make_image(fill="black", back_color="white")
|
||||
qr_img.save(file_path)
|
||||
messagebox.showinfo("Success", "QR Code generated and saved successfully!")
|
||||
else:
|
||||
messagebox.showerror("Error", "Please enter data and choose a file name.")
|
||||
root = tk.Tk()
|
||||
app = QRCodeGenerator(root)
|
||||
root.mainloop()
|
58
WareHouse/QRCodeGenerator_THUNLP_20231015214731/manual.md
Normal file
58
WareHouse/QRCodeGenerator_THUNLP_20231015214731/manual.md
Normal file
@ -0,0 +1,58 @@
|
||||
# QR Code Generator User Manual
|
||||
|
||||
## Introduction
|
||||
|
||||
The QR Code Generator is a Python program that allows users to generate QR codes from text or data input. The program provides a user-friendly interface that guides the user through the process of inputting the data and specifying the file name and format for the QR code image. The generated QR code image can be saved to a file in various formats such as PNG or JPG.
|
||||
|
||||
## Installation
|
||||
|
||||
To use the QR Code Generator, you need to have Python installed on your system. You can download Python from the official website: https://www.python.org/downloads/
|
||||
|
||||
Once Python is installed, you can install the required dependencies by running the following command in your terminal or command prompt:
|
||||
|
||||
```
|
||||
pip install -r requirements.txt
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
To use the QR Code Generator, follow these steps:
|
||||
|
||||
1. Open a terminal or command prompt.
|
||||
2. Navigate to the directory where the program files are located.
|
||||
3. Run the following command to start the program:
|
||||
|
||||
```
|
||||
python main.py
|
||||
```
|
||||
|
||||
4. The program will open a window with a user interface.
|
||||
5. Enter the text or data that you want to encode in the QR code in the "Enter data or text" field.
|
||||
6. Choose a file name and format for the QR code image by clicking the "Choose File" button. By default, the file format is set to PNG.
|
||||
7. Click the "Generate QR Code" button to generate the QR code image.
|
||||
8. The program will save the QR code image to the specified file.
|
||||
9. A message box will appear indicating whether the QR code was generated and saved successfully.
|
||||
|
||||
## Examples
|
||||
|
||||
Here are some examples of how to use the QR Code Generator:
|
||||
|
||||
### Example 1: Generating a QR code from text input
|
||||
|
||||
1. Open the QR Code Generator program.
|
||||
2. Enter the text "Hello, World!" in the "Enter data or text" field.
|
||||
3. Choose a file name and format for the QR code image.
|
||||
4. Click the "Generate QR Code" button.
|
||||
5. The program will save the QR code image to the specified file.
|
||||
|
||||
### Example 2: Generating a QR code from data input
|
||||
|
||||
1. Open the QR Code Generator program.
|
||||
2. Enter the data "1234567890" in the "Enter data or text" field.
|
||||
3. Choose a file name and format for the QR code image.
|
||||
4. Click the "Generate QR Code" button.
|
||||
5. The program will save the QR code image to the specified file.
|
||||
|
||||
## Conclusion
|
||||
|
||||
The QR Code Generator is a user-friendly Python program that allows users to generate QR codes from text or data input. It provides a simple and intuitive interface for generating QR codes and saving them to files. With the QR Code Generator, you can easily create QR codes for various purposes such as sharing information or promoting your business.
|
29
WareHouse/QRCodeGenerator_THUNLP_20231015214731/meta.txt
Normal file
29
WareHouse/QRCodeGenerator_THUNLP_20231015214731/meta.txt
Normal file
@ -0,0 +1,29 @@
|
||||
Task:
|
||||
Write a Python program that generates QR codes. Your program should take user input for the data or text that needs to be encoded in the QR code. It should then use a suitable library or package to generate a QR code image from the input data. Finally, the program should save the QR code image to a file, allowing the user to specify the file name and format (e.g., PNG, JPG).Make sure to provide a user-friendly interface that guides the user through the process of inputting the data and specifying the file name and format for the QR code image. Test your program with various inputs to ensure it generates valid QR codes and handles different data types gracefully.
|
||||
|
||||
Config:
|
||||
ChatEnvConfig.clear_structure: True
|
||||
ChatEnvConfig.brainstorming: False
|
||||
|
||||
|
||||
Roster:
|
||||
Chief Executive Officer, Counselor, Chief Human Resource Officer, Chief Product Officer, Chief Technology Officer, Programmer, Code Reviewer, Software Test Engineer, Chief Creative Officer
|
||||
|
||||
Modality:
|
||||
command line interface
|
||||
|
||||
Ideas:
|
||||
|
||||
|
||||
Language:
|
||||
Python
|
||||
|
||||
Code_Version:
|
||||
5.0
|
||||
|
||||
Proposed_images:
|
||||
0
|
||||
|
||||
Incorporated_images:
|
||||
0
|
||||
|
@ -0,0 +1,13 @@
|
||||
'''
|
||||
This file contains the QRCodeGenerator class responsible for generating QR codes.
|
||||
'''
|
||||
import qrcode
|
||||
class QRCodeGenerator:
|
||||
def __init__(self, data):
|
||||
self.data = data
|
||||
def generate_qr_code(self, file_path):
|
||||
qr = qrcode.QRCode(version=1, box_size=10, border=5)
|
||||
qr.add_data(self.data)
|
||||
qr.make(fit=True)
|
||||
qr_img = qr.make_image(fill="black", back_color="white")
|
||||
qr_img.save(file_path)
|
@ -0,0 +1 @@
|
||||
qrcode==7.3
|
Loading…
Reference in New Issue
Block a user