+Once the starter code was prepared, we were ready to write all the queries. All files/scripts used to write the queries are stored in the create_queries_responses folder. We wrote a program called query_writer.py to create the queries using the LeetCode CSV file and the extracted starter code files. Each query was saved as query{question_number}.txt, with each file corresponding to its respective question number. A sample query, query2.txt, is provided in the queries folder. Note: To generate all queries, you must edit the script query_wrtier.py to specify the difficulty level (“easy,” “medium,” or “hard”). Finally, to generate responses using ChatGPT’s GPT-3.5-turbo, we wrote getCode.py, which uses an API key to access ChatGPT. To change the model of testing, you can specify which model you want in the script. We automated this step using automate_queries.py to run all queries simultaneously, storing the responses in code_query{question_number}.py, with each file corresponding to its respective question number. A sample output can be found in the folder ouput_code.
0 commit comments