Skip to content

Commit

Permalink
update python blueprint (#459)
Browse files Browse the repository at this point in the history
  • Loading branch information
dhruvnathawani authored Nov 13, 2024
1 parent 0d75883 commit 8a10e5a
Showing 1 changed file with 29 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"metadata": {
"id": "mNoaC7dX28y0"
},
Expand All @@ -33,7 +33,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": null,
"metadata": {
"id": "1k5NjjtzPQJi"
},
Expand Down Expand Up @@ -81,7 +81,7 @@
"\n",
"special_system_instructions: >-\n",
" You are an expert at writing, analyzing, and editing Python code. You know what\n",
" a high-quality, clean, efficient, and maintainable Python code looks like. You\n",
" high-quality, clean, efficient, and maintainable Python code looks like. You\n",
" excel at transforming natural language into Python, as well as Python back into\n",
" natural language. Your job is to assist the user with their Python-related tasks.\n",
"\n",
Expand All @@ -105,47 +105,41 @@
" - DevOps and Continuous Integration/Continuous Deployment (CI/CD) Tools\n",
"\n",
" - name: code_complexity\n",
" values: [Intermediate, Advanced, Expert]\n",
" values: [Beginner, Intermediate, Advanced]\n",
" subcategories:\n",
" - name: code_concept\n",
" values:\n",
" Intermediate: [Functions, List Comprehensions, Classes]\n",
" Advanced: [Object-oriented programming, Error Handling, Lambda Functions]\n",
" Expert: [Decorators, Multithreading, Context Managers]\n",
"\n",
" - name: prompt_type\n",
" values: [instruction, question]\n",
" subcategories:\n",
" - name: prompt_creation_instruction\n",
" values:\n",
" instruction:\n",
" - Write an instruction for a user to write Python code for a specific task.\n",
" - Generate a clear and concise instruction for a Python programming challenge.\n",
" question:\n",
" - Ask a specific question about how to solve a problem using Python code.\n",
" - Generate a question about how to perform a general task in Python.\n",
" Beginner: [Variables, Data Types, Functions, Loops, Classes]\n",
" Intermediate: [List Comprehensions, Object-oriented programming, Lambda Functions, Web frameworks, Pandas]\n",
" Advanced: [Multithreading, Context Managers, Generators]\n",
" \n",
" - name: instruction_phrase\n",
" values: [\"Write a function that\", \"Create a class that\", \"Implement a script\", \"Can you create a function\", \"Develop a module that\"]\n",
"\n",
"generated_data_columns:\n",
" - name: text\n",
" - name: instruction\n",
" generation_prompt: >-\n",
" {prompt_creation_instruction} \\n\n",
"\n",
" ### Important Guidelines ###\n",
" * Make sure the {prompt_type} is related to {topic} in the {industry_sector} sector.\n",
" * Do not write any code as part of the {prompt_type}.\n",
" Generate an instruction to create Python code that solves a specific problem. Each instruction should begin with one of the following phrases: {instruction_phrase}.\n",
" \n",
" Important Guidelines:\n",
" * Industry Relevance: Ensure the instruction pertains to the {industry_sector} sector and {topic} topic.\n",
" * Code Complexity: Tailor the instruction to the {code_complexity} level. Utilize relevant {code_concept} where appropriate to match the complexity level.\n",
" * Clarity and Specificity: Make the problem statement clear and unambiguous. Provide sufficient context to understand the requirements without being overly verbose.\n",
" * Response Formatting: Do not include any markers such as ### Response ### in the instruction.\n",
" columns_to_list_in_prompt: all_categorical_seed_columns\n",
"\n",
" - name: code\n",
" generation_prompt: >-\n",
" Write Python code that will be paired with the following prompt:\n",
" {text} \\n\n",
" Write Python code for the following instruction:\n",
" Instruction: {instruction}\\n\n",
"\n",
" ### Important Guidelines ###\n",
" * Your code should be self-contained and executable.\n",
" * Remember to import any necessary libraries.\n",
" * The code should be written at a {code_complexity} level and make use of {code_concept}.\n",
" Important Guidelines:\n",
" * Code Quality: Your code should be clean, complete, self-contained and accurate.\n",
" * Code Validity: Please ensure that your python code is executable and does not contain any errors.\n",
" * Packages: Remember to import any necessary libraries, and to use all libraries you import.\n",
" * Complexity & Concepts: The code should be written at a {code_complexity} level, making use use of concepts such as {code_concept}.\n",
" llm_type: code\n",
" columns_to_list_in_prompt: [industry_sector, topic]\n",
" columns_to_list_in_prompt: [topic]\n",
"\n",
"post_processors:\n",
" - validator: code\n",
Expand All @@ -155,7 +149,7 @@
"\n",
" - evaluator: text_to_python\n",
" settings:\n",
" text_column: text\n",
" text_column: instruction\n",
" code_column: code\n",
"\"\"\"\n",
"\n",
Expand Down Expand Up @@ -288,6 +282,7 @@
},
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
Expand All @@ -300,7 +295,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.4"
"version": "3.10.12"
}
},
"nbformat": 4,
Expand Down

0 comments on commit 8a10e5a

Please sign in to comment.