[
  {
    "path": ".github/FUNDING.yml",
    "content": "# These are supported funding model platforms\ncustom: ['https://www.buymeacoffee.com/bhattbhavesh91']\n"
  },
  {
    "path": ".gitignore",
    "content": "MANIFEST\nbuild\ndist\n_build\ndocs/man/*.gz\ndocs/source/api/generated\ndocs/source/config.rst\ndocs/gh-pages\nnotebook/i18n/*/LC_MESSAGES/*.mo\nnotebook/i18n/*/LC_MESSAGES/nbjs.json\nnotebook/static/components\nnotebook/static/style/*.min.css*\nnotebook/static/*/js/built/\nnotebook/static/*/built/\nnotebook/static/built/\nnotebook/static/*/js/main.min.js*\nnotebook/static/lab/*bundle.js\nnode_modules\n*.py[co]\n__pycache__\n*.egg-info\n*~\n*.bak\n.ipynb_checkpoints\n.tox\n.DS_Store\n\\#*#\n.#*\n.coverage\n.pytest_cache\nsrc\n\n*.swp\n*.map\n.idea/\nRead the Docs\nconfig.rst\n\n/.project\n/.pydevproject\n\npackage-lock.json\ngeckodriver.log\n"
  },
  {
    "path": "LICENSE",
    "content": "                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"[]\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright [yyyy] [name of copyright owner]\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n"
  },
  {
    "path": "README.md",
    "content": "# OpenAI's GPT-3 to generate SQL from Natural Language!\n\n**If you like my work, you can support me by buying me a coffee by clicking the link below**\n\n<a href=\"https://www.buymeacoffee.com/bhattbhavesh91\" target=\"_blank\"><img src=\"https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png\" alt=\"Buy Me A Coffee\" style=\"height: 41px !important;width: 174px !important;box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;-webkit-box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;\" ></a>\n\n## To view the video\n\n<table>\n   <tr>\n      <td><a href=\"http://www.youtube.com/watch?v=9g66yO0Jues\" target=\"_blank\"><img height=\"50\" src = \"https://img.shields.io/youtube/views/9g66yO0Jues?color=blue&label=Watch%20on%20YouTube&logo=youtube&logoColor=red&style=for-the-badge\"></a></td>\n   </tr>\n</table>\n\nor click on the image below\n\n[![OpenAI's GPT-3 to generate SQL from Natural Language!](http://img.youtube.com/vi/9g66yO0Jues/0.jpg)](http://www.youtube.com/watch?v=9g66yO0Jues)\n\n## Follow Me\n<a href=\"https://twitter.com/_bhaveshbhatt\" target=\"_blank\"><img class=\"ai-subscribed-social-icon\" src=\"https://bhattbhavesh91.github.io/assets/images/tw.png\" width=\"30\"></a>\n<a href=\"https://www.youtube.com/bhaveshbhatt8791/\" target=\"_blank\"><img class=\"ai-subscribed-social-icon\" src=\"https://bhattbhavesh91.github.io/assets/images/ytb.png\" width=\"30\"></a>\n<a href=\"https://www.youtube.com/PythonTricks/\" target=\"_blank\"><img class=\"ai-subscribed-social-icon\" src=\"https://bhattbhavesh91.github.io/assets/images/python_logo.png\" width=\"30\"></a>\n<a href=\"https://github.com/bhattbhavesh91\" target=\"_blank\"><img class=\"ai-subscribed-social-icon\" src=\"https://bhattbhavesh91.github.io/assets/images/gthb.png\" width=\"30\"></a>\n<a href=\"https://www.linkedin.com/in/bhattbhavesh91/\" target=\"_blank\"><img class=\"ai-subscribed-social-icon\" src=\"https://bhattbhavesh91.github.io/assets/images/lnkdn.png\" width=\"30\"></a>\n\n<h3 align=\"center\">Show your support by starring the repository 🙂</h3>\n"
  },
  {
    "path": "gpt-3-notebook.ipynb",
    "content": "{\"nbformat\":4,\"nbformat_minor\":0,\"metadata\":{\"colab\":{\"name\":\"GPT-3-Demo.ipynb\",\"provenance\":[],\"collapsed_sections\":[],\"authorship_tag\":\"ABX9TyNfqR7vWsi34k6mv0Yi02Yy\"},\"kernelspec\":{\"name\":\"python3\",\"display_name\":\"Python 3\"}},\"cells\":[{\"cell_type\":\"code\",\"metadata\":{\"id\":\"heIf5_ducY8T\",\"colab_type\":\"code\",\"colab\":{\"base_uri\":\"https://localhost:8080/\",\"height\":297},\"executionInfo\":{\"status\":\"ok\",\"timestamp\":1595471247881,\"user_tz\":-330,\"elapsed\":8803,\"user\":{\"displayName\":\"Bhavesh Bhatt\",\"photoUrl\":\"https://lh3.googleusercontent.com/a-/AOh14Ggn1iyaPhugkkpQYFRw42nt9ToNB-Rit7YeWtI4Zw=s64\",\"userId\":\"01561702845917398436\"}},\"outputId\":\"c668882d-1977-4c74-bdd5-584d27bd82f3\"},\"source\":[\"!pip install openai\"],\"execution_count\":1,\"outputs\":[{\"output_type\":\"stream\",\"text\":[\"Collecting openai\\n\",\"\\u001b[?25l  Downloading https://files.pythonhosted.org/packages/a8/65/c7461f4c87984534683f480ea5742777bc39bbf5721123194c2d0347dc1f/openai-0.2.4.tar.gz (157kB)\\n\",\"\\r\\u001b[K     |██                              | 10kB 13.1MB/s eta 0:00:01\\r\\u001b[K     |████▏                           | 20kB 1.6MB/s eta 0:00:01\\r\\u001b[K     |██████▎                         | 30kB 1.8MB/s eta 0:00:01\\r\\u001b[K     |████████▍                       | 40kB 2.1MB/s eta 0:00:01\\r\\u001b[K     |██████████▍                     | 51kB 2.0MB/s eta 0:00:01\\r\\u001b[K     |████████████▌                   | 61kB 2.1MB/s eta 0:00:01\\r\\u001b[K     |██████████████▋                 | 71kB 2.3MB/s eta 0:00:01\\r\\u001b[K     |████████████████▊               | 81kB 2.4MB/s eta 0:00:01\\r\\u001b[K     |██████████████████▊             | 92kB 2.6MB/s eta 0:00:01\\r\\u001b[K     |████████████████████▉           | 102kB 2.8MB/s eta 0:00:01\\r\\u001b[K     |███████████████████████         | 112kB 2.8MB/s eta 0:00:01\\r\\u001b[K     |█████████████████████████       | 122kB 2.8MB/s eta 0:00:01\\r\\u001b[K     |███████████████████████████     | 133kB 2.8MB/s eta 0:00:01\\r\\u001b[K     |█████████████████████████████▏  | 143kB 2.8MB/s eta 0:00:01\\r\\u001b[K     |███████████████████████████████▎| 153kB 2.8MB/s eta 0:00:01\\r\\u001b[K     |████████████████████████████████| 163kB 2.8MB/s \\n\",\"\\u001b[?25hRequirement already satisfied: requests>=2.20 in /usr/local/lib/python3.6/dist-packages (from openai) (2.23.0)\\n\",\"Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.6/dist-packages (from requests>=2.20->openai) (2020.6.20)\\n\",\"Requirement already satisfied: chardet<4,>=3.0.2 in /usr/local/lib/python3.6/dist-packages (from requests>=2.20->openai) (3.0.4)\\n\",\"Requirement already satisfied: idna<3,>=2.5 in /usr/local/lib/python3.6/dist-packages (from requests>=2.20->openai) (2.10)\\n\",\"Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /usr/local/lib/python3.6/dist-packages (from requests>=2.20->openai) (1.24.3)\\n\",\"Building wheels for collected packages: openai\\n\",\"  Building wheel for openai (setup.py) ... \\u001b[?25l\\u001b[?25hdone\\n\",\"  Created wheel for openai: filename=openai-0.2.4-cp36-none-any.whl size=170709 sha256=7ae56fa654e2071a250acdeed89d5fb874faa15c8755bb252607201d0e434798\\n\",\"  Stored in directory: /root/.cache/pip/wheels/74/96/c8/c6e170929c276b836613e1b9985343b501fe455e53d85e7d48\\n\",\"Successfully built openai\\n\",\"Installing collected packages: openai\\n\",\"Successfully installed openai-0.2.4\\n\"],\"name\":\"stdout\"}]},{\"cell_type\":\"code\",\"metadata\":{\"id\":\"JIObOT-ybumY\",\"colab_type\":\"code\",\"colab\":{},\"executionInfo\":{\"status\":\"ok\",\"timestamp\":1595471299970,\"user_tz\":-330,\"elapsed\":951,\"user\":{\"displayName\":\"Bhavesh Bhatt\",\"photoUrl\":\"https://lh3.googleusercontent.com/a-/AOh14Ggn1iyaPhugkkpQYFRw42nt9ToNB-Rit7YeWtI4Zw=s64\",\"userId\":\"01561702845917398436\"}}},\"source\":[\"import json\\n\",\"import openai\"],\"execution_count\":2,\"outputs\":[]},{\"cell_type\":\"code\",\"metadata\":{\"id\":\"m42z9jQxqA2b\",\"colab_type\":\"code\",\"colab\":{},\"executionInfo\":{\"status\":\"ok\",\"timestamp\":1595471313449,\"user_tz\":-330,\"elapsed\":1104,\"user\":{\"displayName\":\"Bhavesh Bhatt\",\"photoUrl\":\"https://lh3.googleusercontent.com/a-/AOh14Ggn1iyaPhugkkpQYFRw42nt9ToNB-Rit7YeWtI4Zw=s64\",\"userId\":\"01561702845917398436\"}}},\"source\":[\"with open('GPT_SECRET_KEY.json') as f:\\n\",\"    data = json.load(f)\"],\"execution_count\":3,\"outputs\":[]},{\"cell_type\":\"code\",\"metadata\":{\"id\":\"75Yg2gB7p3Q0\",\"colab_type\":\"code\",\"colab\":{},\"executionInfo\":{\"status\":\"ok\",\"timestamp\":1595471324175,\"user_tz\":-330,\"elapsed\":703,\"user\":{\"displayName\":\"Bhavesh Bhatt\",\"photoUrl\":\"https://lh3.googleusercontent.com/a-/AOh14Ggn1iyaPhugkkpQYFRw42nt9ToNB-Rit7YeWtI4Zw=s64\",\"userId\":\"01561702845917398436\"}}},\"source\":[\"openai.api_key = data[\\\"API_KEY\\\"]\"],\"execution_count\":4,\"outputs\":[]},{\"cell_type\":\"code\",\"metadata\":{\"id\":\"N3sAHxJrhBzK\",\"colab_type\":\"code\",\"colab\":{},\"executionInfo\":{\"status\":\"ok\",\"timestamp\":1595471367430,\"user_tz\":-330,\"elapsed\":1044,\"user\":{\"displayName\":\"Bhavesh Bhatt\",\"photoUrl\":\"https://lh3.googleusercontent.com/a-/AOh14Ggn1iyaPhugkkpQYFRw42nt9ToNB-Rit7YeWtI4Zw=s64\",\"userId\":\"01561702845917398436\"}}},\"source\":[\"from gpt import GPT\\n\",\"from gpt import Example\"],\"execution_count\":5,\"outputs\":[]},{\"cell_type\":\"code\",\"metadata\":{\"id\":\"XiV0D9PihB2N\",\"colab_type\":\"code\",\"colab\":{},\"executionInfo\":{\"status\":\"ok\",\"timestamp\":1595471538287,\"user_tz\":-330,\"elapsed\":1248,\"user\":{\"displayName\":\"Bhavesh Bhatt\",\"photoUrl\":\"https://lh3.googleusercontent.com/a-/AOh14Ggn1iyaPhugkkpQYFRw42nt9ToNB-Rit7YeWtI4Zw=s64\",\"userId\":\"01561702845917398436\"}}},\"source\":[\"gpt = GPT(engine=\\\"davinci\\\",\\n\",\"          temperature=0.5,\\n\",\"          max_tokens=100)\"],\"execution_count\":6,\"outputs\":[]},{\"cell_type\":\"markdown\",\"metadata\":{\"id\":\"WwVcHYMOvGiU\",\"colab_type\":\"text\"},\"source\":[\"# Adding Examples for GPT Model\"]},{\"cell_type\":\"code\",\"metadata\":{\"id\":\"0iLR1Y6YqTh7\",\"colab_type\":\"code\",\"colab\":{},\"executionInfo\":{\"status\":\"ok\",\"timestamp\":1595471715638,\"user_tz\":-330,\"elapsed\":1343,\"user\":{\"displayName\":\"Bhavesh Bhatt\",\"photoUrl\":\"https://lh3.googleusercontent.com/a-/AOh14Ggn1iyaPhugkkpQYFRw42nt9ToNB-Rit7YeWtI4Zw=s64\",\"userId\":\"01561702845917398436\"}}},\"source\":[\"gpt.add_example(Example('Fetch unique values of DEPARTMENT from Worker table.', \\n\",\"                        'Select distinct DEPARTMENT from Worker;'))\"],\"execution_count\":7,\"outputs\":[]},{\"cell_type\":\"code\",\"metadata\":{\"id\":\"x28YlU1-qrCW\",\"colab_type\":\"code\",\"colab\":{},\"executionInfo\":{\"status\":\"ok\",\"timestamp\":1595471721203,\"user_tz\":-330,\"elapsed\":1433,\"user\":{\"displayName\":\"Bhavesh Bhatt\",\"photoUrl\":\"https://lh3.googleusercontent.com/a-/AOh14Ggn1iyaPhugkkpQYFRw42nt9ToNB-Rit7YeWtI4Zw=s64\",\"userId\":\"01561702845917398436\"}}},\"source\":[\"gpt.add_example(Example('Print the first three characters of FIRST_NAME from Worker table.', \\n\",\"                        'Select substring(FIRST_NAME,1,3) from Worker;'))\"],\"execution_count\":8,\"outputs\":[]},{\"cell_type\":\"code\",\"metadata\":{\"id\":\"1C10LyYPqrFX\",\"colab_type\":\"code\",\"colab\":{},\"executionInfo\":{\"status\":\"ok\",\"timestamp\":1595471721205,\"user_tz\":-330,\"elapsed\":883,\"user\":{\"displayName\":\"Bhavesh Bhatt\",\"photoUrl\":\"https://lh3.googleusercontent.com/a-/AOh14Ggn1iyaPhugkkpQYFRw42nt9ToNB-Rit7YeWtI4Zw=s64\",\"userId\":\"01561702845917398436\"}}},\"source\":[\"gpt.add_example(Example(\\\"Find the position of the alphabet ('a') in the first name column 'Amitabh' from Worker table.\\\", \\n\",\"                        \\\"Select INSTR(FIRST_NAME, BINARY'a') from Worker where FIRST_NAME = 'Amitabh';\\\"))\"],\"execution_count\":9,\"outputs\":[]},{\"cell_type\":\"code\",\"metadata\":{\"id\":\"0JvjODWbsBWP\",\"colab_type\":\"code\",\"colab\":{},\"executionInfo\":{\"status\":\"ok\",\"timestamp\":1595471723625,\"user_tz\":-330,\"elapsed\":964,\"user\":{\"displayName\":\"Bhavesh Bhatt\",\"photoUrl\":\"https://lh3.googleusercontent.com/a-/AOh14Ggn1iyaPhugkkpQYFRw42nt9ToNB-Rit7YeWtI4Zw=s64\",\"userId\":\"01561702845917398436\"}}},\"source\":[\"gpt.add_example(Example(\\\"Print the FIRST_NAME from Worker table after replacing 'a' with 'A'.\\\", \\n\",\"                        \\\"Select CONCAT(FIRST_NAME, ' ', LAST_NAME) AS 'COMPLETE_NAME' from Worker;\\\"))\"],\"execution_count\":10,\"outputs\":[]},{\"cell_type\":\"code\",\"metadata\":{\"id\":\"uNsH4OeqsKjM\",\"colab_type\":\"code\",\"colab\":{},\"executionInfo\":{\"status\":\"ok\",\"timestamp\":1595471760833,\"user_tz\":-330,\"elapsed\":958,\"user\":{\"displayName\":\"Bhavesh Bhatt\",\"photoUrl\":\"https://lh3.googleusercontent.com/a-/AOh14Ggn1iyaPhugkkpQYFRw42nt9ToNB-Rit7YeWtI4Zw=s64\",\"userId\":\"01561702845917398436\"}}},\"source\":[\"gpt.add_example(Example(\\\"Display the second highest salary from the Worker table.\\\", \\n\",\"                        \\\"Select max(Salary) from Worker where Salary not in (Select max(Salary) from Worker);\\\"))\"],\"execution_count\":11,\"outputs\":[]},{\"cell_type\":\"code\",\"metadata\":{\"id\":\"zhXh5g-jsKnl\",\"colab_type\":\"code\",\"colab\":{},\"executionInfo\":{\"status\":\"ok\",\"timestamp\":1595471795232,\"user_tz\":-330,\"elapsed\":1075,\"user\":{\"displayName\":\"Bhavesh Bhatt\",\"photoUrl\":\"https://lh3.googleusercontent.com/a-/AOh14Ggn1iyaPhugkkpQYFRw42nt9ToNB-Rit7YeWtI4Zw=s64\",\"userId\":\"01561702845917398436\"}}},\"source\":[\"gpt.add_example(Example(\\\"Display the highest salary from the Worker table.\\\", \\n\",\"                        \\\"Select max(Salary) from Worker;\\\"))\"],\"execution_count\":12,\"outputs\":[]},{\"cell_type\":\"code\",\"metadata\":{\"id\":\"wWjmZe-Ntexm\",\"colab_type\":\"code\",\"colab\":{},\"executionInfo\":{\"status\":\"ok\",\"timestamp\":1595471796602,\"user_tz\":-330,\"elapsed\":882,\"user\":{\"displayName\":\"Bhavesh Bhatt\",\"photoUrl\":\"https://lh3.googleusercontent.com/a-/AOh14Ggn1iyaPhugkkpQYFRw42nt9ToNB-Rit7YeWtI4Zw=s64\",\"userId\":\"01561702845917398436\"}}},\"source\":[\"gpt.add_example(Example(\\\"Fetch the count of employees working in the department Admin.\\\", \\n\",\"                        \\\"SELECT COUNT(*) FROM worker WHERE DEPARTMENT = 'Admin';\\\"))\"],\"execution_count\":13,\"outputs\":[]},{\"cell_type\":\"code\",\"metadata\":{\"id\":\"Q9xuF--Kt_xh\",\"colab_type\":\"code\",\"colab\":{},\"executionInfo\":{\"status\":\"ok\",\"timestamp\":1595471799951,\"user_tz\":-330,\"elapsed\":1149,\"user\":{\"displayName\":\"Bhavesh Bhatt\",\"photoUrl\":\"https://lh3.googleusercontent.com/a-/AOh14Ggn1iyaPhugkkpQYFRw42nt9ToNB-Rit7YeWtI4Zw=s64\",\"userId\":\"01561702845917398436\"}}},\"source\":[\"gpt.add_example(Example(\\\"Get all details of the Workers whose SALARY lies between 100000 and 500000.\\\", \\n\",\"                        \\\"Select * from Worker where SALARY between 100000 and 500000;\\\"))\"],\"execution_count\":14,\"outputs\":[]},{\"cell_type\":\"code\",\"metadata\":{\"id\":\"z5jRwDCcuauE\",\"colab_type\":\"code\",\"colab\":{},\"executionInfo\":{\"status\":\"ok\",\"timestamp\":1595471800475,\"user_tz\":-330,\"elapsed\":786,\"user\":{\"displayName\":\"Bhavesh Bhatt\",\"photoUrl\":\"https://lh3.googleusercontent.com/a-/AOh14Ggn1iyaPhugkkpQYFRw42nt9ToNB-Rit7YeWtI4Zw=s64\",\"userId\":\"01561702845917398436\"}}},\"source\":[\"gpt.add_example(Example(\\\"Get Salary details of the Workers\\\", \\n\",\"                        \\\"Select Salary from Worker\\\"))\"],\"execution_count\":15,\"outputs\":[]},{\"cell_type\":\"markdown\",\"metadata\":{\"id\":\"3mI7FmwSu9AA\",\"colab_type\":\"text\"},\"source\":[\"# Example 1\"]},{\"cell_type\":\"code\",\"metadata\":{\"id\":\"sWSmXABfrdTm\",\"colab_type\":\"code\",\"colab\":{},\"executionInfo\":{\"status\":\"ok\",\"timestamp\":1595471857682,\"user_tz\":-330,\"elapsed\":1211,\"user\":{\"displayName\":\"Bhavesh Bhatt\",\"photoUrl\":\"https://lh3.googleusercontent.com/a-/AOh14Ggn1iyaPhugkkpQYFRw42nt9ToNB-Rit7YeWtI4Zw=s64\",\"userId\":\"01561702845917398436\"}}},\"source\":[\"prompt = \\\"Display the lowest salary from the Worker table.\\\"\"],\"execution_count\":16,\"outputs\":[]},{\"cell_type\":\"code\",\"metadata\":{\"id\":\"pVzvJtmRqTku\",\"colab_type\":\"code\",\"colab\":{},\"executionInfo\":{\"status\":\"ok\",\"timestamp\":1595471890838,\"user_tz\":-330,\"elapsed\":2494,\"user\":{\"displayName\":\"Bhavesh Bhatt\",\"photoUrl\":\"https://lh3.googleusercontent.com/a-/AOh14Ggn1iyaPhugkkpQYFRw42nt9ToNB-Rit7YeWtI4Zw=s64\",\"userId\":\"01561702845917398436\"}}},\"source\":[\"output = gpt.submit_request(prompt)\"],\"execution_count\":17,\"outputs\":[]},{\"cell_type\":\"code\",\"metadata\":{\"id\":\"niqyIPAyoLQb\",\"colab_type\":\"code\",\"colab\":{\"base_uri\":\"https://localhost:8080/\",\"height\":35},\"executionInfo\":{\"status\":\"ok\",\"timestamp\":1595471926542,\"user_tz\":-330,\"elapsed\":1366,\"user\":{\"displayName\":\"Bhavesh Bhatt\",\"photoUrl\":\"https://lh3.googleusercontent.com/a-/AOh14Ggn1iyaPhugkkpQYFRw42nt9ToNB-Rit7YeWtI4Zw=s64\",\"userId\":\"01561702845917398436\"}},\"outputId\":\"853cd2a0-ec4e-4454-90b8-cb8be70b0d4f\"},\"source\":[\"output.choices[0].text\"],\"execution_count\":19,\"outputs\":[{\"output_type\":\"execute_result\",\"data\":{\"application/vnd.google.colaboratory.intrinsic+json\":{\"type\":\"string\"},\"text/plain\":[\"'output: Select min(Salary) from Worker;\\\\n'\"]},\"metadata\":{\"tags\":[]},\"execution_count\":19}]},{\"cell_type\":\"markdown\",\"metadata\":{\"id\":\"LA3DyhGJu_8o\",\"colab_type\":\"text\"},\"source\":[\"# Example 2\"]},{\"cell_type\":\"code\",\"metadata\":{\"id\":\"_OdI6bFLtpel\",\"colab_type\":\"code\",\"colab\":{},\"executionInfo\":{\"status\":\"ok\",\"timestamp\":1595471994566,\"user_tz\":-330,\"elapsed\":1325,\"user\":{\"displayName\":\"Bhavesh Bhatt\",\"photoUrl\":\"https://lh3.googleusercontent.com/a-/AOh14Ggn1iyaPhugkkpQYFRw42nt9ToNB-Rit7YeWtI4Zw=s64\",\"userId\":\"01561702845917398436\"}}},\"source\":[\"prompt = \\\"Tell me the count of employees working in the department HR.\\\"\"],\"execution_count\":20,\"outputs\":[]},{\"cell_type\":\"code\",\"metadata\":{\"id\":\"XnjQ0kfbtpkE\",\"colab_type\":\"code\",\"colab\":{},\"executionInfo\":{\"status\":\"ok\",\"timestamp\":1595472001159,\"user_tz\":-330,\"elapsed\":2828,\"user\":{\"displayName\":\"Bhavesh Bhatt\",\"photoUrl\":\"https://lh3.googleusercontent.com/a-/AOh14Ggn1iyaPhugkkpQYFRw42nt9ToNB-Rit7YeWtI4Zw=s64\",\"userId\":\"01561702845917398436\"}}},\"source\":[\"output = gpt.submit_request(prompt)\"],\"execution_count\":21,\"outputs\":[]},{\"cell_type\":\"code\",\"metadata\":{\"id\":\"Z9Yo-bZotph4\",\"colab_type\":\"code\",\"colab\":{\"base_uri\":\"https://localhost:8080/\",\"height\":35},\"executionInfo\":{\"status\":\"ok\",\"timestamp\":1595472005315,\"user_tz\":-330,\"elapsed\":1008,\"user\":{\"displayName\":\"Bhavesh Bhatt\",\"photoUrl\":\"https://lh3.googleusercontent.com/a-/AOh14Ggn1iyaPhugkkpQYFRw42nt9ToNB-Rit7YeWtI4Zw=s64\",\"userId\":\"01561702845917398436\"}},\"outputId\":\"0e1572e6-bceb-42c8-d67f-4f29a156745c\"},\"source\":[\"output.choices[0].text\"],\"execution_count\":22,\"outputs\":[{\"output_type\":\"execute_result\",\"data\":{\"application/vnd.google.colaboratory.intrinsic+json\":{\"type\":\"string\"},\"text/plain\":[\"\\\"output: SELECT COUNT(*) FROM worker WHERE DEPARTMENT = 'HR';\\\\n\\\"\"]},\"metadata\":{\"tags\":[]},\"execution_count\":22}]},{\"cell_type\":\"markdown\",\"metadata\":{\"id\":\"dnB7TCA_vCkF\",\"colab_type\":\"text\"},\"source\":[\"# Example 3\"]},{\"cell_type\":\"code\",\"metadata\":{\"id\":\"GkaHZLIzt3pQ\",\"colab_type\":\"code\",\"colab\":{},\"executionInfo\":{\"status\":\"ok\",\"timestamp\":1595472072925,\"user_tz\":-330,\"elapsed\":946,\"user\":{\"displayName\":\"Bhavesh Bhatt\",\"photoUrl\":\"https://lh3.googleusercontent.com/a-/AOh14Ggn1iyaPhugkkpQYFRw42nt9ToNB-Rit7YeWtI4Zw=s64\",\"userId\":\"01561702845917398436\"}}},\"source\":[\"prompt = \\\"Get salary details of the Workers whose AGE lies between 25 and 35\\\"\"],\"execution_count\":23,\"outputs\":[]},{\"cell_type\":\"code\",\"metadata\":{\"id\":\"G6GmvbukmLCK\",\"colab_type\":\"code\",\"colab\":{\"base_uri\":\"https://localhost:8080/\",\"height\":51},\"executionInfo\":{\"status\":\"ok\",\"timestamp\":1595472104996,\"user_tz\":-330,\"elapsed\":3152,\"user\":{\"displayName\":\"Bhavesh Bhatt\",\"photoUrl\":\"https://lh3.googleusercontent.com/a-/AOh14Ggn1iyaPhugkkpQYFRw42nt9ToNB-Rit7YeWtI4Zw=s64\",\"userId\":\"01561702845917398436\"}},\"outputId\":\"21c8f471-b272-47ed-dd18-36c94fbf6936\"},\"source\":[\"print(gpt.get_top_reply(prompt))\"],\"execution_count\":24,\"outputs\":[{\"output_type\":\"stream\",\"text\":[\"output: Select Salary from Worker where AGE between 25 and 35;\\n\",\"\\n\"],\"name\":\"stdout\"}]},{\"cell_type\":\"code\",\"metadata\":{\"id\":\"0ZaLCw6zgqxh\",\"colab_type\":\"code\",\"colab\":{}},\"source\":[\"\"],\"execution_count\":null,\"outputs\":[]}]}"
  },
  {
    "path": "gpt-pandas-code-generation.ipynb",
    "content": "{\n  \"nbformat\": 4,\n  \"nbformat_minor\": 0,\n  \"metadata\": {\n    \"colab\": {\n      \"name\": \"GPT-3-Pandas-Code.ipynb\",\n      \"provenance\": [],\n      \"collapsed_sections\": []\n    },\n    \"kernelspec\": {\n      \"name\": \"python3\",\n      \"display_name\": \"Python 3\"\n    }\n  },\n  \"cells\": [\n    {\n      \"cell_type\": \"code\",\n      \"metadata\": {\n        \"id\": \"heIf5_ducY8T\",\n        \"colab_type\": \"code\",\n        \"colab\": {\n          \"base_uri\": \"https://localhost:8080/\",\n          \"height\": 297\n        },\n        \"outputId\": \"fe2165bc-0b43-4a1b-a9b2-a755ae1d2cd8\"\n      },\n      \"source\": [\n        \"!pip install openai\"\n      ],\n      \"execution_count\": 1,\n      \"outputs\": [\n        {\n          \"output_type\": \"stream\",\n          \"text\": [\n            \"Collecting openai\\n\",\n            \"\\u001b[?25l  Downloading https://files.pythonhosted.org/packages/a8/65/c7461f4c87984534683f480ea5742777bc39bbf5721123194c2d0347dc1f/openai-0.2.4.tar.gz (157kB)\\n\",\n            \"\\u001b[K     |████████████████████████████████| 163kB 2.7MB/s \\n\",\n            \"\\u001b[?25hRequirement already satisfied: requests>=2.20 in /usr/local/lib/python3.6/dist-packages (from openai) (2.23.0)\\n\",\n            \"Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.6/dist-packages (from requests>=2.20->openai) (2020.6.20)\\n\",\n            \"Requirement already satisfied: chardet<4,>=3.0.2 in /usr/local/lib/python3.6/dist-packages (from requests>=2.20->openai) (3.0.4)\\n\",\n            \"Requirement already satisfied: idna<3,>=2.5 in /usr/local/lib/python3.6/dist-packages (from requests>=2.20->openai) (2.10)\\n\",\n            \"Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /usr/local/lib/python3.6/dist-packages (from requests>=2.20->openai) (1.24.3)\\n\",\n            \"Building wheels for collected packages: openai\\n\",\n            \"  Building wheel for openai (setup.py) ... \\u001b[?25l\\u001b[?25hdone\\n\",\n            \"  Created wheel for openai: filename=openai-0.2.4-cp36-none-any.whl size=170709 sha256=3821b7d0954e25e78fcdb4a7718777dcdfa08c7ed830290c2c299c0dae9d8ee6\\n\",\n            \"  Stored in directory: /root/.cache/pip/wheels/74/96/c8/c6e170929c276b836613e1b9985343b501fe455e53d85e7d48\\n\",\n            \"Successfully built openai\\n\",\n            \"Installing collected packages: openai\\n\",\n            \"Successfully installed openai-0.2.4\\n\"\n          ],\n          \"name\": \"stdout\"\n        }\n      ]\n    },\n    {\n      \"cell_type\": \"code\",\n      \"metadata\": {\n        \"id\": \"JIObOT-ybumY\",\n        \"colab_type\": \"code\",\n        \"colab\": {}\n      },\n      \"source\": [\n        \"import json\\n\",\n        \"import openai\\n\",\n        \"import numpy as np\\n\",\n        \"import pandas as pd\"\n      ],\n      \"execution_count\": 2,\n      \"outputs\": []\n    },\n    {\n      \"cell_type\": \"code\",\n      \"metadata\": {\n        \"id\": \"m42z9jQxqA2b\",\n        \"colab_type\": \"code\",\n        \"colab\": {}\n      },\n      \"source\": [\n        \"with open('GPT_SECRET_KEY.json') as f:\\n\",\n        \"    data = json.load(f)\"\n      ],\n      \"execution_count\": 3,\n      \"outputs\": []\n    },\n    {\n      \"cell_type\": \"code\",\n      \"metadata\": {\n        \"id\": \"75Yg2gB7p3Q0\",\n        \"colab_type\": \"code\",\n        \"colab\": {}\n      },\n      \"source\": [\n        \"openai.api_key = data[\\\"API_KEY\\\"]\"\n      ],\n      \"execution_count\": 4,\n      \"outputs\": []\n    },\n    {\n      \"cell_type\": \"code\",\n      \"metadata\": {\n        \"id\": \"N3sAHxJrhBzK\",\n        \"colab_type\": \"code\",\n        \"colab\": {}\n      },\n      \"source\": [\n        \"from gpt import GPT\\n\",\n        \"from gpt import Example\"\n      ],\n      \"execution_count\": 5,\n      \"outputs\": []\n    },\n    {\n      \"cell_type\": \"code\",\n      \"metadata\": {\n        \"id\": \"XiV0D9PihB2N\",\n        \"colab_type\": \"code\",\n        \"colab\": {}\n      },\n      \"source\": [\n        \"gpt = GPT(engine=\\\"davinci\\\",\\n\",\n        \"          temperature=0.5,\\n\",\n        \"          max_tokens=100)\"\n      ],\n      \"execution_count\": 6,\n      \"outputs\": []\n    },\n    {\n      \"cell_type\": \"code\",\n      \"metadata\": {\n        \"id\": \"6qLap8Xgvwjt\",\n        \"colab_type\": \"code\",\n        \"colab\": {}\n      },\n      \"source\": [\n        \"df = pd.DataFrame({\\\"Gender\\\": [\\\"boy\\\", \\\"boy\\\", \\\"boy\\\", \\\"boy\\\", \\\"boy\\\",\\n\",\n        \"                         \\\"girl\\\", \\\"girl\\\", \\\"girl\\\", \\\"girl\\\"],\\n\",\n        \"                   \\\"Division\\\": [\\\"one\\\", \\\"one\\\", \\\"one\\\", \\\"two\\\", \\\"two\\\",\\n\",\n        \"                         \\\"one\\\", \\\"one\\\", \\\"two\\\", \\\"two\\\"],\\n\",\n        \"                   \\\"Marks\\\": [50, 55, 67, 85, 44, 84, 65, 56, 87]})\"\n      ],\n      \"execution_count\": 7,\n      \"outputs\": []\n    },\n    {\n      \"cell_type\": \"code\",\n      \"metadata\": {\n        \"id\": \"JGQIWZO-AazG\",\n        \"colab_type\": \"code\",\n        \"colab\": {\n          \"base_uri\": \"https://localhost:8080/\",\n          \"height\": 324\n        },\n        \"outputId\": \"744be30f-e298-44b9-edf2-02379817d368\"\n      },\n      \"source\": [\n        \"df\"\n      ],\n      \"execution_count\": 8,\n      \"outputs\": [\n        {\n          \"output_type\": \"execute_result\",\n          \"data\": {\n            \"text/html\": [\n              \"<div>\\n\",\n              \"<style scoped>\\n\",\n              \"    .dataframe tbody tr th:only-of-type {\\n\",\n              \"        vertical-align: middle;\\n\",\n              \"    }\\n\",\n              \"\\n\",\n              \"    .dataframe tbody tr th {\\n\",\n              \"        vertical-align: top;\\n\",\n              \"    }\\n\",\n              \"\\n\",\n              \"    .dataframe thead th {\\n\",\n              \"        text-align: right;\\n\",\n              \"    }\\n\",\n              \"</style>\\n\",\n              \"<table border=\\\"1\\\" class=\\\"dataframe\\\">\\n\",\n              \"  <thead>\\n\",\n              \"    <tr style=\\\"text-align: right;\\\">\\n\",\n              \"      <th></th>\\n\",\n              \"      <th>Gender</th>\\n\",\n              \"      <th>Division</th>\\n\",\n              \"      <th>Marks</th>\\n\",\n              \"    </tr>\\n\",\n              \"  </thead>\\n\",\n              \"  <tbody>\\n\",\n              \"    <tr>\\n\",\n              \"      <th>0</th>\\n\",\n              \"      <td>boy</td>\\n\",\n              \"      <td>one</td>\\n\",\n              \"      <td>50</td>\\n\",\n              \"    </tr>\\n\",\n              \"    <tr>\\n\",\n              \"      <th>1</th>\\n\",\n              \"      <td>boy</td>\\n\",\n              \"      <td>one</td>\\n\",\n              \"      <td>55</td>\\n\",\n              \"    </tr>\\n\",\n              \"    <tr>\\n\",\n              \"      <th>2</th>\\n\",\n              \"      <td>boy</td>\\n\",\n              \"      <td>one</td>\\n\",\n              \"      <td>67</td>\\n\",\n              \"    </tr>\\n\",\n              \"    <tr>\\n\",\n              \"      <th>3</th>\\n\",\n              \"      <td>boy</td>\\n\",\n              \"      <td>two</td>\\n\",\n              \"      <td>85</td>\\n\",\n              \"    </tr>\\n\",\n              \"    <tr>\\n\",\n              \"      <th>4</th>\\n\",\n              \"      <td>boy</td>\\n\",\n              \"      <td>two</td>\\n\",\n              \"      <td>44</td>\\n\",\n              \"    </tr>\\n\",\n              \"    <tr>\\n\",\n              \"      <th>5</th>\\n\",\n              \"      <td>girl</td>\\n\",\n              \"      <td>one</td>\\n\",\n              \"      <td>84</td>\\n\",\n              \"    </tr>\\n\",\n              \"    <tr>\\n\",\n              \"      <th>6</th>\\n\",\n              \"      <td>girl</td>\\n\",\n              \"      <td>one</td>\\n\",\n              \"      <td>65</td>\\n\",\n              \"    </tr>\\n\",\n              \"    <tr>\\n\",\n              \"      <th>7</th>\\n\",\n              \"      <td>girl</td>\\n\",\n              \"      <td>two</td>\\n\",\n              \"      <td>56</td>\\n\",\n              \"    </tr>\\n\",\n              \"    <tr>\\n\",\n              \"      <th>8</th>\\n\",\n              \"      <td>girl</td>\\n\",\n              \"      <td>two</td>\\n\",\n              \"      <td>87</td>\\n\",\n              \"    </tr>\\n\",\n              \"  </tbody>\\n\",\n              \"</table>\\n\",\n              \"</div>\"\n            ],\n            \"text/plain\": [\n              \"  Gender Division  Marks\\n\",\n              \"0    boy      one     50\\n\",\n              \"1    boy      one     55\\n\",\n              \"2    boy      one     67\\n\",\n              \"3    boy      two     85\\n\",\n              \"4    boy      two     44\\n\",\n              \"5   girl      one     84\\n\",\n              \"6   girl      one     65\\n\",\n              \"7   girl      two     56\\n\",\n              \"8   girl      two     87\"\n            ]\n          },\n          \"metadata\": {\n            \"tags\": []\n          },\n          \"execution_count\": 8\n        }\n      ]\n    },\n    {\n      \"cell_type\": \"markdown\",\n      \"metadata\": {\n        \"id\": \"WwVcHYMOvGiU\",\n        \"colab_type\": \"text\"\n      },\n      \"source\": [\n        \"# Adding Examples for GPT Model\"\n      ]\n    },\n    {\n      \"cell_type\": \"code\",\n      \"metadata\": {\n        \"id\": \"0iLR1Y6YqTh7\",\n        \"colab_type\": \"code\",\n        \"colab\": {}\n      },\n      \"source\": [\n        \"gpt.add_example(Example('How many unique values in Division Column?', \\n\",\n        \"                        'df[\\\"Division\\\"].nunique()'))\"\n      ],\n      \"execution_count\": 9,\n      \"outputs\": []\n    },\n    {\n      \"cell_type\": \"code\",\n      \"metadata\": {\n        \"id\": \"x28YlU1-qrCW\",\n        \"colab_type\": \"code\",\n        \"colab\": {}\n      },\n      \"source\": [\n        \"gpt.add_example(Example('Find the Division of boy who scored 55 marks', \\n\",\n        \"                        'df.loc[(df.loc[:, \\\"Gender\\\"] == \\\"boy\\\") & (df.loc[:, \\\"Marks\\\"] == 55), \\\"Division\\\"]'))\"\n      ],\n      \"execution_count\": 10,\n      \"outputs\": []\n    },\n    {\n      \"cell_type\": \"code\",\n      \"metadata\": {\n        \"id\": \"yBQMrnIQx3Uv\",\n        \"colab_type\": \"code\",\n        \"colab\": {}\n      },\n      \"source\": [\n        \"gpt.add_example(Example('Find the average Marks scored by Girls', \\n\",\n        \"                        'np.mean(df.loc[(df.loc[:, \\\"Gender\\\"] == \\\"girl\\\"), \\\"Marks\\\"])'))\"\n      ],\n      \"execution_count\": 11,\n      \"outputs\": []\n    },\n    {\n      \"cell_type\": \"code\",\n      \"metadata\": {\n        \"id\": \"sua6IdZgw4tR\",\n        \"colab_type\": \"code\",\n        \"colab\": {}\n      },\n      \"source\": [\n        \"\"\n      ],\n      \"execution_count\": null,\n      \"outputs\": []\n    },\n    {\n      \"cell_type\": \"markdown\",\n      \"metadata\": {\n        \"id\": \"3mI7FmwSu9AA\",\n        \"colab_type\": \"text\"\n      },\n      \"source\": [\n        \"# Example 1\"\n      ]\n    },\n    {\n      \"cell_type\": \"code\",\n      \"metadata\": {\n        \"id\": \"sWSmXABfrdTm\",\n        \"colab_type\": \"code\",\n        \"colab\": {}\n      },\n      \"source\": [\n        \"prompt = \\\"Display Division of girl who scored maximum marks\\\"\"\n      ],\n      \"execution_count\": 12,\n      \"outputs\": []\n    },\n    {\n      \"cell_type\": \"code\",\n      \"metadata\": {\n        \"id\": \"pVzvJtmRqTku\",\n        \"colab_type\": \"code\",\n        \"colab\": {\n          \"base_uri\": \"https://localhost:8080/\",\n          \"height\": 71\n        },\n        \"outputId\": \"f1ee2728-2b22-4835-e437-aa7221cf1201\"\n      },\n      \"source\": [\n        \"print(gpt.get_top_reply(prompt))\"\n      ],\n      \"execution_count\": 13,\n      \"outputs\": [\n        {\n          \"output_type\": \"stream\",\n          \"text\": [\n            \"output: df.loc[(df.loc[:, \\\"Gender\\\"] == \\\"girl\\\") & (df.loc[:, \\\"Marks\\\"] == max(df.loc[:, \\\"Marks\\\"])), \\\"Division\\\"]\\n\",\n            \"\\n\"\n          ],\n          \"name\": \"stdout\"\n        }\n      ]\n    },\n    {\n      \"cell_type\": \"code\",\n      \"metadata\": {\n        \"id\": \"BA_Kzqnjdwwg\",\n        \"colab_type\": \"code\",\n        \"colab\": {\n          \"base_uri\": \"https://localhost:8080/\",\n          \"height\": 51\n        },\n        \"outputId\": \"c0bc77c0-e964-45c3-dbe6-7e6b353c8254\"\n      },\n      \"source\": [\n        \"df.loc[(df.loc[:, \\\"Gender\\\"] == \\\"girl\\\") & \\n\",\n        \"       (df.loc[:, \\\"Marks\\\"] == max(df.loc[:, \\\"Marks\\\"])), \\n\",\n        \"       \\\"Division\\\"]\"\n      ],\n      \"execution_count\": 14,\n      \"outputs\": [\n        {\n          \"output_type\": \"execute_result\",\n          \"data\": {\n            \"text/plain\": [\n              \"8    two\\n\",\n              \"Name: Division, dtype: object\"\n            ]\n          },\n          \"metadata\": {\n            \"tags\": []\n          },\n          \"execution_count\": 14\n        }\n      ]\n    },\n    {\n      \"cell_type\": \"markdown\",\n      \"metadata\": {\n        \"id\": \"NopaHtl1_9rH\",\n        \"colab_type\": \"text\"\n      },\n      \"source\": [\n        \"# Example 2\"\n      ]\n    },\n    {\n      \"cell_type\": \"code\",\n      \"metadata\": {\n        \"id\": \"eO4IW_H_y_5F\",\n        \"colab_type\": \"code\",\n        \"colab\": {}\n      },\n      \"source\": [\n        \"prompt = \\\"Find the median Marks scored by Boys\\\"\"\n      ],\n      \"execution_count\": 15,\n      \"outputs\": []\n    },\n    {\n      \"cell_type\": \"code\",\n      \"metadata\": {\n        \"id\": \"Q8ldVXxhyGVD\",\n        \"colab_type\": \"code\",\n        \"colab\": {\n          \"base_uri\": \"https://localhost:8080/\",\n          \"height\": 51\n        },\n        \"outputId\": \"611ff255-3feb-4f98-d1ff-197a8c0466eb\"\n      },\n      \"source\": [\n        \"print(gpt.get_top_reply(prompt))\"\n      ],\n      \"execution_count\": 16,\n      \"outputs\": [\n        {\n          \"output_type\": \"stream\",\n          \"text\": [\n            \"output: np.median(df.loc[(df.loc[:, \\\"Gender\\\"] == \\\"boy\\\"), \\\"Marks\\\"])\\n\",\n            \"\\n\"\n          ],\n          \"name\": \"stdout\"\n        }\n      ]\n    },\n    {\n      \"cell_type\": \"code\",\n      \"metadata\": {\n        \"id\": \"wUi-UN62zJe_\",\n        \"colab_type\": \"code\",\n        \"colab\": {\n          \"base_uri\": \"https://localhost:8080/\",\n          \"height\": 34\n        },\n        \"outputId\": \"4f5a164e-03ac-40ed-a135-f5aee4f45c59\"\n      },\n      \"source\": [\n        \"np.median(df.loc[(df.loc[:, \\\"Gender\\\"] == \\\"boy\\\"), \\\"Marks\\\"])\"\n      ],\n      \"execution_count\": 17,\n      \"outputs\": [\n        {\n          \"output_type\": \"execute_result\",\n          \"data\": {\n            \"text/plain\": [\n              \"55.0\"\n            ]\n          },\n          \"metadata\": {\n            \"tags\": []\n          },\n          \"execution_count\": 17\n        }\n      ]\n    },\n    {\n      \"cell_type\": \"code\",\n      \"metadata\": {\n        \"id\": \"Cf6vxbTADRpf\",\n        \"colab_type\": \"code\",\n        \"colab\": {}\n      },\n      \"source\": [\n        \"\"\n      ],\n      \"execution_count\": null,\n      \"outputs\": []\n    }\n  ]\n}"
  },
  {
    "path": "gpt-pandas-matplotlib.ipynb",
    "content": "{\n  \"nbformat\": 4,\n  \"nbformat_minor\": 0,\n  \"metadata\": {\n    \"colab\": {\n      \"name\": \"gpt-pandas-code-generation.ipynb\",\n      \"provenance\": [],\n      \"collapsed_sections\": []\n    },\n    \"kernelspec\": {\n      \"name\": \"python3\",\n      \"display_name\": \"Python 3\"\n    }\n  },\n  \"cells\": [\n    {\n      \"cell_type\": \"code\",\n      \"metadata\": {\n        \"id\": \"heIf5_ducY8T\",\n        \"colab_type\": \"code\",\n        \"colab\": {\n          \"base_uri\": \"https://localhost:8080/\",\n          \"height\": 297\n        },\n        \"outputId\": \"74217a60-6e07-425c-a94a-51387939b7ee\"\n      },\n      \"source\": [\n        \"!pip install openai\"\n      ],\n      \"execution_count\": 1,\n      \"outputs\": [\n        {\n          \"output_type\": \"stream\",\n          \"text\": [\n            \"Collecting openai\\n\",\n            \"\\u001b[?25l  Downloading https://files.pythonhosted.org/packages/a8/65/c7461f4c87984534683f480ea5742777bc39bbf5721123194c2d0347dc1f/openai-0.2.4.tar.gz (157kB)\\n\",\n            \"\\r\\u001b[K     |██                              | 10kB 15.3MB/s eta 0:00:01\\r\\u001b[K     |████▏                           | 20kB 6.1MB/s eta 0:00:01\\r\\u001b[K     |██████▎                         | 30kB 7.7MB/s eta 0:00:01\\r\\u001b[K     |████████▍                       | 40kB 7.4MB/s eta 0:00:01\\r\\u001b[K     |██████████▍                     | 51kB 6.5MB/s eta 0:00:01\\r\\u001b[K     |████████████▌                   | 61kB 6.9MB/s eta 0:00:01\\r\\u001b[K     |██████████████▋                 | 71kB 7.8MB/s eta 0:00:01\\r\\u001b[K     |████████████████▊               | 81kB 7.9MB/s eta 0:00:01\\r\\u001b[K     |██████████████████▊             | 92kB 8.5MB/s eta 0:00:01\\r\\u001b[K     |████████████████████▉           | 102kB 8.4MB/s eta 0:00:01\\r\\u001b[K     |███████████████████████         | 112kB 8.4MB/s eta 0:00:01\\r\\u001b[K     |█████████████████████████       | 122kB 8.4MB/s eta 0:00:01\\r\\u001b[K     |███████████████████████████     | 133kB 8.4MB/s eta 0:00:01\\r\\u001b[K     |█████████████████████████████▏  | 143kB 8.4MB/s eta 0:00:01\\r\\u001b[K     |███████████████████████████████▎| 153kB 8.4MB/s eta 0:00:01\\r\\u001b[K     |████████████████████████████████| 163kB 8.4MB/s \\n\",\n            \"\\u001b[?25hRequirement already satisfied: requests>=2.20 in /usr/local/lib/python3.6/dist-packages (from openai) (2.23.0)\\n\",\n            \"Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /usr/local/lib/python3.6/dist-packages (from requests>=2.20->openai) (1.24.3)\\n\",\n            \"Requirement already satisfied: chardet<4,>=3.0.2 in /usr/local/lib/python3.6/dist-packages (from requests>=2.20->openai) (3.0.4)\\n\",\n            \"Requirement already satisfied: idna<3,>=2.5 in /usr/local/lib/python3.6/dist-packages (from requests>=2.20->openai) (2.10)\\n\",\n            \"Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.6/dist-packages (from requests>=2.20->openai) (2020.6.20)\\n\",\n            \"Building wheels for collected packages: openai\\n\",\n            \"  Building wheel for openai (setup.py) ... \\u001b[?25l\\u001b[?25hdone\\n\",\n            \"  Created wheel for openai: filename=openai-0.2.4-cp36-none-any.whl size=170709 sha256=7d8dd1fd8f27ae398961666519a46af67ea9c925b960cd786d619c7f6da3bc54\\n\",\n            \"  Stored in directory: /root/.cache/pip/wheels/74/96/c8/c6e170929c276b836613e1b9985343b501fe455e53d85e7d48\\n\",\n            \"Successfully built openai\\n\",\n            \"Installing collected packages: openai\\n\",\n            \"Successfully installed openai-0.2.4\\n\"\n          ],\n          \"name\": \"stdout\"\n        }\n      ]\n    },\n    {\n      \"cell_type\": \"code\",\n      \"metadata\": {\n        \"id\": \"JIObOT-ybumY\",\n        \"colab_type\": \"code\",\n        \"colab\": {\n          \"base_uri\": \"https://localhost:8080/\",\n          \"height\": 71\n        },\n        \"outputId\": \"d44d7576-460f-4af2-b668-9f29cec15b74\"\n      },\n      \"source\": [\n        \"import json\\n\",\n        \"import openai\\n\",\n        \"import numpy as np\\n\",\n        \"import pandas as pd\\n\",\n        \"import matplotlib.pyplot as plt \\n\",\n        \"import seaborn as sns\"\n      ],\n      \"execution_count\": 2,\n      \"outputs\": [\n        {\n          \"output_type\": \"stream\",\n          \"text\": [\n            \"/usr/local/lib/python3.6/dist-packages/statsmodels/tools/_testing.py:19: FutureWarning: pandas.util.testing is deprecated. Use the functions in the public API at pandas.testing instead.\\n\",\n            \"  import pandas.util.testing as tm\\n\"\n          ],\n          \"name\": \"stderr\"\n        }\n      ]\n    },\n    {\n      \"cell_type\": \"code\",\n      \"metadata\": {\n        \"id\": \"m42z9jQxqA2b\",\n        \"colab_type\": \"code\",\n        \"colab\": {}\n      },\n      \"source\": [\n        \"with open('GPT_SECRET_KEY.json') as f:\\n\",\n        \"    data = json.load(f)\"\n      ],\n      \"execution_count\": 3,\n      \"outputs\": []\n    },\n    {\n      \"cell_type\": \"code\",\n      \"metadata\": {\n        \"id\": \"75Yg2gB7p3Q0\",\n        \"colab_type\": \"code\",\n        \"colab\": {}\n      },\n      \"source\": [\n        \"openai.api_key = data[\\\"API_KEY\\\"]\"\n      ],\n      \"execution_count\": 4,\n      \"outputs\": []\n    },\n    {\n      \"cell_type\": \"code\",\n      \"metadata\": {\n        \"id\": \"N3sAHxJrhBzK\",\n        \"colab_type\": \"code\",\n        \"colab\": {}\n      },\n      \"source\": [\n        \"from gpt import GPT\\n\",\n        \"from gpt import Example\"\n      ],\n      \"execution_count\": 5,\n      \"outputs\": []\n    },\n    {\n      \"cell_type\": \"code\",\n      \"metadata\": {\n        \"id\": \"XiV0D9PihB2N\",\n        \"colab_type\": \"code\",\n        \"colab\": {}\n      },\n      \"source\": [\n        \"gpt = GPT(engine=\\\"davinci\\\",\\n\",\n        \"          temperature=0.5,\\n\",\n        \"          max_tokens=100)\"\n      ],\n      \"execution_count\": 6,\n      \"outputs\": []\n    },\n    {\n      \"cell_type\": \"code\",\n      \"metadata\": {\n        \"id\": \"6qLap8Xgvwjt\",\n        \"colab_type\": \"code\",\n        \"colab\": {}\n      },\n      \"source\": [\n        \"df = pd.DataFrame({\\\"Gender\\\": [\\\"boy\\\", \\\"boy\\\", \\\"boy\\\", \\\"boy\\\", \\\"boy\\\",\\n\",\n        \"                         \\\"girl\\\", \\\"girl\\\", \\\"girl\\\", \\\"girl\\\"],\\n\",\n        \"                   \\\"Division\\\": [\\\"one\\\", \\\"one\\\", \\\"one\\\", \\\"two\\\", \\\"two\\\",\\n\",\n        \"                         \\\"one\\\", \\\"one\\\", \\\"two\\\", \\\"two\\\"],\\n\",\n        \"                   \\\"Marks\\\": [50, 55, 67, 85, 44, 84, 65, 56, 87]})\"\n      ],\n      \"execution_count\": 7,\n      \"outputs\": []\n    },\n    {\n      \"cell_type\": \"code\",\n      \"metadata\": {\n        \"id\": \"JGQIWZO-AazG\",\n        \"colab_type\": \"code\",\n        \"colab\": {\n          \"base_uri\": \"https://localhost:8080/\",\n          \"height\": 324\n        },\n        \"outputId\": \"bdd987fc-929e-450e-d687-6c3b12fa52cf\"\n      },\n      \"source\": [\n        \"df\"\n      ],\n      \"execution_count\": 8,\n      \"outputs\": [\n        {\n          \"output_type\": \"execute_result\",\n          \"data\": {\n            \"text/html\": [\n              \"<div>\\n\",\n              \"<style scoped>\\n\",\n              \"    .dataframe tbody tr th:only-of-type {\\n\",\n              \"        vertical-align: middle;\\n\",\n              \"    }\\n\",\n              \"\\n\",\n              \"    .dataframe tbody tr th {\\n\",\n              \"        vertical-align: top;\\n\",\n              \"    }\\n\",\n              \"\\n\",\n              \"    .dataframe thead th {\\n\",\n              \"        text-align: right;\\n\",\n              \"    }\\n\",\n              \"</style>\\n\",\n              \"<table border=\\\"1\\\" class=\\\"dataframe\\\">\\n\",\n              \"  <thead>\\n\",\n              \"    <tr style=\\\"text-align: right;\\\">\\n\",\n              \"      <th></th>\\n\",\n              \"      <th>Gender</th>\\n\",\n              \"      <th>Division</th>\\n\",\n              \"      <th>Marks</th>\\n\",\n              \"    </tr>\\n\",\n              \"  </thead>\\n\",\n              \"  <tbody>\\n\",\n              \"    <tr>\\n\",\n              \"      <th>0</th>\\n\",\n              \"      <td>boy</td>\\n\",\n              \"      <td>one</td>\\n\",\n              \"      <td>50</td>\\n\",\n              \"    </tr>\\n\",\n              \"    <tr>\\n\",\n              \"      <th>1</th>\\n\",\n              \"      <td>boy</td>\\n\",\n              \"      <td>one</td>\\n\",\n              \"      <td>55</td>\\n\",\n              \"    </tr>\\n\",\n              \"    <tr>\\n\",\n              \"      <th>2</th>\\n\",\n              \"      <td>boy</td>\\n\",\n              \"      <td>one</td>\\n\",\n              \"      <td>67</td>\\n\",\n              \"    </tr>\\n\",\n              \"    <tr>\\n\",\n              \"      <th>3</th>\\n\",\n              \"      <td>boy</td>\\n\",\n              \"      <td>two</td>\\n\",\n              \"      <td>85</td>\\n\",\n              \"    </tr>\\n\",\n              \"    <tr>\\n\",\n              \"      <th>4</th>\\n\",\n              \"      <td>boy</td>\\n\",\n              \"      <td>two</td>\\n\",\n              \"      <td>44</td>\\n\",\n              \"    </tr>\\n\",\n              \"    <tr>\\n\",\n              \"      <th>5</th>\\n\",\n              \"      <td>girl</td>\\n\",\n              \"      <td>one</td>\\n\",\n              \"      <td>84</td>\\n\",\n              \"    </tr>\\n\",\n              \"    <tr>\\n\",\n              \"      <th>6</th>\\n\",\n              \"      <td>girl</td>\\n\",\n              \"      <td>one</td>\\n\",\n              \"      <td>65</td>\\n\",\n              \"    </tr>\\n\",\n              \"    <tr>\\n\",\n              \"      <th>7</th>\\n\",\n              \"      <td>girl</td>\\n\",\n              \"      <td>two</td>\\n\",\n              \"      <td>56</td>\\n\",\n              \"    </tr>\\n\",\n              \"    <tr>\\n\",\n              \"      <th>8</th>\\n\",\n              \"      <td>girl</td>\\n\",\n              \"      <td>two</td>\\n\",\n              \"      <td>87</td>\\n\",\n              \"    </tr>\\n\",\n              \"  </tbody>\\n\",\n              \"</table>\\n\",\n              \"</div>\"\n            ],\n            \"text/plain\": [\n              \"  Gender Division  Marks\\n\",\n              \"0    boy      one     50\\n\",\n              \"1    boy      one     55\\n\",\n              \"2    boy      one     67\\n\",\n              \"3    boy      two     85\\n\",\n              \"4    boy      two     44\\n\",\n              \"5   girl      one     84\\n\",\n              \"6   girl      one     65\\n\",\n              \"7   girl      two     56\\n\",\n              \"8   girl      two     87\"\n            ]\n          },\n          \"metadata\": {\n            \"tags\": []\n          },\n          \"execution_count\": 8\n        }\n      ]\n    },\n    {\n      \"cell_type\": \"markdown\",\n      \"metadata\": {\n        \"id\": \"WwVcHYMOvGiU\",\n        \"colab_type\": \"text\"\n      },\n      \"source\": [\n        \"# Adding Examples for GPT Model\"\n      ]\n    },\n    {\n      \"cell_type\": \"code\",\n      \"metadata\": {\n        \"id\": \"0iLR1Y6YqTh7\",\n        \"colab_type\": \"code\",\n        \"colab\": {}\n      },\n      \"source\": [\n        \"gpt.add_example(Example('How many unique values in Division Column?', \\n\",\n        \"                        'df[\\\"Division\\\"].nunique()'))\"\n      ],\n      \"execution_count\": 9,\n      \"outputs\": []\n    },\n    {\n      \"cell_type\": \"code\",\n      \"metadata\": {\n        \"id\": \"x28YlU1-qrCW\",\n        \"colab_type\": \"code\",\n        \"colab\": {}\n      },\n      \"source\": [\n        \"gpt.add_example(Example('Find the Division of boy who scored 55 marks', \\n\",\n        \"                        'df.loc[(df.loc[:, \\\"Gender\\\"] == \\\"boy\\\") & (df.loc[:, \\\"Marks\\\"] == 55), \\\"Division\\\"]'))\"\n      ],\n      \"execution_count\": 10,\n      \"outputs\": []\n    },\n    {\n      \"cell_type\": \"code\",\n      \"metadata\": {\n        \"id\": \"yBQMrnIQx3Uv\",\n        \"colab_type\": \"code\",\n        \"colab\": {}\n      },\n      \"source\": [\n        \"gpt.add_example(Example('Find the average Marks scored by Girls', \\n\",\n        \"                        'np.mean(df.loc[(df.loc[:, \\\"Gender\\\"] == \\\"girl\\\"), \\\"Marks\\\"])'))\"\n      ],\n      \"execution_count\": 11,\n      \"outputs\": []\n    },\n    {\n      \"cell_type\": \"code\",\n      \"metadata\": {\n        \"id\": \"sua6IdZgw4tR\",\n        \"colab_type\": \"code\",\n        \"colab\": {}\n      },\n      \"source\": [\n        \"\"\n      ],\n      \"execution_count\": null,\n      \"outputs\": []\n    },\n    {\n      \"cell_type\": \"markdown\",\n      \"metadata\": {\n        \"id\": \"3mI7FmwSu9AA\",\n        \"colab_type\": \"text\"\n      },\n      \"source\": [\n        \"# Example 1\"\n      ]\n    },\n    {\n      \"cell_type\": \"code\",\n      \"metadata\": {\n        \"id\": \"sWSmXABfrdTm\",\n        \"colab_type\": \"code\",\n        \"colab\": {}\n      },\n      \"source\": [\n        \"prompt = \\\"Display Division of girl who scored maximum marks\\\"\"\n      ],\n      \"execution_count\": 12,\n      \"outputs\": []\n    },\n    {\n      \"cell_type\": \"code\",\n      \"metadata\": {\n        \"id\": \"7RE6DxAyEEy5\",\n        \"colab_type\": \"code\",\n        \"colab\": {\n          \"base_uri\": \"https://localhost:8080/\",\n          \"height\": 52\n        },\n        \"outputId\": \"8258aafd-bfd6-49fd-a4e0-cd80695bf637\"\n      },\n      \"source\": [\n        \"gpt.get_top_reply(prompt)\"\n      ],\n      \"execution_count\": 13,\n      \"outputs\": [\n        {\n          \"output_type\": \"execute_result\",\n          \"data\": {\n            \"application/vnd.google.colaboratory.intrinsic+json\": {\n              \"type\": \"string\"\n            },\n            \"text/plain\": [\n              \"'output: df.loc[(df.loc[:, \\\"Gender\\\"] == \\\"girl\\\") & (df.loc[:, \\\"Marks\\\"] == max(df.loc[:, \\\"Marks\\\"])), \\\"Division\\\"]\\\\n'\"\n            ]\n          },\n          \"metadata\": {\n            \"tags\": []\n          },\n          \"execution_count\": 13\n        }\n      ]\n    },\n    {\n      \"cell_type\": \"code\",\n      \"metadata\": {\n        \"id\": \"FkyPKIYCEin4\",\n        \"colab_type\": \"code\",\n        \"colab\": {\n          \"base_uri\": \"https://localhost:8080/\",\n          \"height\": 106\n        },\n        \"outputId\": \"90dcea4c-2f66-451e-baab-fee2b2ba317a\"\n      },\n      \"source\": [\n        \"response = gpt.get_top_reply(prompt)\\n\",\n        \"print(response)\\n\",\n        \"modified_response = response.split(\\\"output: \\\")[-1].strip('\\\\n')\\n\",\n        \"eval(modified_response)\"\n      ],\n      \"execution_count\": 14,\n      \"outputs\": [\n        {\n          \"output_type\": \"stream\",\n          \"text\": [\n            \"output: df.loc[(df.loc[:, \\\"Gender\\\"] == \\\"girl\\\") & (df.loc[:, \\\"Marks\\\"] == max(df.loc[:, \\\"Marks\\\"])), \\\"Division\\\"]\\n\",\n            \"\\n\"\n          ],\n          \"name\": \"stdout\"\n        },\n        {\n          \"output_type\": \"execute_result\",\n          \"data\": {\n            \"text/plain\": [\n              \"8    two\\n\",\n              \"Name: Division, dtype: object\"\n            ]\n          },\n          \"metadata\": {\n            \"tags\": []\n          },\n          \"execution_count\": 14\n        }\n      ]\n    },\n    {\n      \"cell_type\": \"markdown\",\n      \"metadata\": {\n        \"id\": \"NopaHtl1_9rH\",\n        \"colab_type\": \"text\"\n      },\n      \"source\": [\n        \"# Example 2\"\n      ]\n    },\n    {\n      \"cell_type\": \"code\",\n      \"metadata\": {\n        \"id\": \"eO4IW_H_y_5F\",\n        \"colab_type\": \"code\",\n        \"colab\": {}\n      },\n      \"source\": [\n        \"prompt = \\\"Find the median Marks scored by Boys\\\"\"\n      ],\n      \"execution_count\": 15,\n      \"outputs\": []\n    },\n    {\n      \"cell_type\": \"code\",\n      \"metadata\": {\n        \"id\": \"Q8ldVXxhyGVD\",\n        \"colab_type\": \"code\",\n        \"colab\": {\n          \"base_uri\": \"https://localhost:8080/\",\n          \"height\": 69\n        },\n        \"outputId\": \"d9d5cebf-1a3c-4d3d-e721-04386882d4e2\"\n      },\n      \"source\": [\n        \"response = gpt.get_top_reply(prompt)\\n\",\n        \"print(response)\\n\",\n        \"modified_response = response.split(\\\"output: \\\")[-1].strip('\\\\n')\\n\",\n        \"eval(modified_response)\"\n      ],\n      \"execution_count\": 16,\n      \"outputs\": [\n        {\n          \"output_type\": \"stream\",\n          \"text\": [\n            \"output: np.median(df.loc[(df.loc[:, \\\"Gender\\\"] == \\\"boy\\\"), \\\"Marks\\\"])\\n\",\n            \"\\n\"\n          ],\n          \"name\": \"stdout\"\n        },\n        {\n          \"output_type\": \"execute_result\",\n          \"data\": {\n            \"text/plain\": [\n              \"55.0\"\n            ]\n          },\n          \"metadata\": {\n            \"tags\": []\n          },\n          \"execution_count\": 16\n        }\n      ]\n    },\n    {\n      \"cell_type\": \"markdown\",\n      \"metadata\": {\n        \"id\": \"OIftyCylGZOm\",\n        \"colab_type\": \"text\"\n      },\n      \"source\": [\n        \"# Matplotlib\"\n      ]\n    },\n    {\n      \"cell_type\": \"code\",\n      \"metadata\": {\n        \"id\": \"wUi-UN62zJe_\",\n        \"colab_type\": \"code\",\n        \"colab\": {}\n      },\n      \"source\": [\n        \"\"\n      ],\n      \"execution_count\": null,\n      \"outputs\": []\n    },\n    {\n      \"cell_type\": \"code\",\n      \"metadata\": {\n        \"id\": \"N_LN5yFvGu9h\",\n        \"colab_type\": \"code\",\n        \"colab\": {}\n      },\n      \"source\": [\n        \"df = pd.read_csv(\\\"iris.csv\\\")\"\n      ],\n      \"execution_count\": 17,\n      \"outputs\": []\n    },\n    {\n      \"cell_type\": \"code\",\n      \"metadata\": {\n        \"id\": \"JaPeGE21G0OW\",\n        \"colab_type\": \"code\",\n        \"colab\": {\n          \"base_uri\": \"https://localhost:8080/\",\n          \"height\": 202\n        },\n        \"outputId\": \"214ede56-9479-429e-da13-2275797187ed\"\n      },\n      \"source\": [\n        \"df.head()\"\n      ],\n      \"execution_count\": 18,\n      \"outputs\": [\n        {\n          \"output_type\": \"execute_result\",\n          \"data\": {\n            \"text/html\": [\n              \"<div>\\n\",\n              \"<style scoped>\\n\",\n              \"    .dataframe tbody tr th:only-of-type {\\n\",\n              \"        vertical-align: middle;\\n\",\n              \"    }\\n\",\n              \"\\n\",\n              \"    .dataframe tbody tr th {\\n\",\n              \"        vertical-align: top;\\n\",\n              \"    }\\n\",\n              \"\\n\",\n              \"    .dataframe thead th {\\n\",\n              \"        text-align: right;\\n\",\n              \"    }\\n\",\n              \"</style>\\n\",\n              \"<table border=\\\"1\\\" class=\\\"dataframe\\\">\\n\",\n              \"  <thead>\\n\",\n              \"    <tr style=\\\"text-align: right;\\\">\\n\",\n              \"      <th></th>\\n\",\n              \"      <th>sepal_length</th>\\n\",\n              \"      <th>sepal_width</th>\\n\",\n              \"      <th>petal_length</th>\\n\",\n              \"      <th>petal_width</th>\\n\",\n              \"      <th>species</th>\\n\",\n              \"    </tr>\\n\",\n              \"  </thead>\\n\",\n              \"  <tbody>\\n\",\n              \"    <tr>\\n\",\n              \"      <th>0</th>\\n\",\n              \"      <td>5.1</td>\\n\",\n              \"      <td>3.5</td>\\n\",\n              \"      <td>1.4</td>\\n\",\n              \"      <td>0.2</td>\\n\",\n              \"      <td>setosa</td>\\n\",\n              \"    </tr>\\n\",\n              \"    <tr>\\n\",\n              \"      <th>1</th>\\n\",\n              \"      <td>4.9</td>\\n\",\n              \"      <td>3.0</td>\\n\",\n              \"      <td>1.4</td>\\n\",\n              \"      <td>0.2</td>\\n\",\n              \"      <td>setosa</td>\\n\",\n              \"    </tr>\\n\",\n              \"    <tr>\\n\",\n              \"      <th>2</th>\\n\",\n              \"      <td>4.7</td>\\n\",\n              \"      <td>3.2</td>\\n\",\n              \"      <td>1.3</td>\\n\",\n              \"      <td>0.2</td>\\n\",\n              \"      <td>setosa</td>\\n\",\n              \"    </tr>\\n\",\n              \"    <tr>\\n\",\n              \"      <th>3</th>\\n\",\n              \"      <td>4.6</td>\\n\",\n              \"      <td>3.1</td>\\n\",\n              \"      <td>1.5</td>\\n\",\n              \"      <td>0.2</td>\\n\",\n              \"      <td>setosa</td>\\n\",\n              \"    </tr>\\n\",\n              \"    <tr>\\n\",\n              \"      <th>4</th>\\n\",\n              \"      <td>5.0</td>\\n\",\n              \"      <td>3.6</td>\\n\",\n              \"      <td>1.4</td>\\n\",\n              \"      <td>0.2</td>\\n\",\n              \"      <td>setosa</td>\\n\",\n              \"    </tr>\\n\",\n              \"  </tbody>\\n\",\n              \"</table>\\n\",\n              \"</div>\"\n            ],\n            \"text/plain\": [\n              \"   sepal_length  sepal_width  petal_length  petal_width species\\n\",\n              \"0           5.1          3.5           1.4          0.2  setosa\\n\",\n              \"1           4.9          3.0           1.4          0.2  setosa\\n\",\n              \"2           4.7          3.2           1.3          0.2  setosa\\n\",\n              \"3           4.6          3.1           1.5          0.2  setosa\\n\",\n              \"4           5.0          3.6           1.4          0.2  setosa\"\n            ]\n          },\n          \"metadata\": {\n            \"tags\": []\n          },\n          \"execution_count\": 18\n        }\n      ]\n    },\n    {\n      \"cell_type\": \"code\",\n      \"metadata\": {\n        \"id\": \"Cf6vxbTADRpf\",\n        \"colab_type\": \"code\",\n        \"colab\": {}\n      },\n      \"source\": [\n        \"gpt.add_example(Example('Plot Scatter Plot between Sepal Length & Sepal Width', \\n\",\n        \"                        \\\"plt.scatter(df['sepal_length'], df['sepal_width'])\\\"))\"\n      ],\n      \"execution_count\": 19,\n      \"outputs\": []\n    },\n    {\n      \"cell_type\": \"code\",\n      \"metadata\": {\n        \"id\": \"kw6K2MGOIqQ0\",\n        \"colab_type\": \"code\",\n        \"colab\": {}\n      },\n      \"source\": [\n        \"gpt.add_example(Example('Plot Bar Plot of Species', \\n\",\n        \"                        \\\"sns.countplot('species',data=df)\\\"))\"\n      ],\n      \"execution_count\": 20,\n      \"outputs\": []\n    },\n    {\n      \"cell_type\": \"code\",\n      \"metadata\": {\n        \"id\": \"BdMy31wCI7IT\",\n        \"colab_type\": \"code\",\n        \"colab\": {}\n      },\n      \"source\": [\n        \"gpt.add_example(Example('Plot a Joint Plot between Sepal Length & Petal Length', \\n\",\n        \"                        \\\"sns.jointplot(x='sepal_length',y='petal_length',data=df)\\\"))\"\n      ],\n      \"execution_count\": 21,\n      \"outputs\": []\n    },\n    {\n      \"cell_type\": \"code\",\n      \"metadata\": {\n        \"id\": \"SvQN_tTgKuHO\",\n        \"colab_type\": \"code\",\n        \"colab\": {}\n      },\n      \"source\": [\n        \"gpt.add_example(Example('Show me the histogram of Petal Length', \\n\",\n        \"                        \\\"plt.hist(df['petal_length'])\\\"))\"\n      ],\n      \"execution_count\": 22,\n      \"outputs\": []\n    },\n    {\n      \"cell_type\": \"code\",\n      \"metadata\": {\n        \"id\": \"aAVofRjMId_b\",\n        \"colab_type\": \"code\",\n        \"colab\": {}\n      },\n      \"source\": [\n        \"\"\n      ],\n      \"execution_count\": null,\n      \"outputs\": []\n    },\n    {\n      \"cell_type\": \"markdown\",\n      \"metadata\": {\n        \"id\": \"4ljE2bDJJoY6\",\n        \"colab_type\": \"text\"\n      },\n      \"source\": [\n        \"# Example 3\"\n      ]\n    },\n    {\n      \"cell_type\": \"code\",\n      \"metadata\": {\n        \"id\": \"FDd-Cf22Jm2G\",\n        \"colab_type\": \"code\",\n        \"colab\": {}\n      },\n      \"source\": [\n        \"prompt = \\\"Show me the scatter plot between petal length and sepal width\\\"\"\n      ],\n      \"execution_count\": 23,\n      \"outputs\": []\n    },\n    {\n      \"cell_type\": \"code\",\n      \"metadata\": {\n        \"id\": \"_3eVyHEEJ1eH\",\n        \"colab_type\": \"code\",\n        \"colab\": {\n          \"base_uri\": \"https://localhost:8080/\",\n          \"height\": 320\n        },\n        \"outputId\": \"de64cded-7157-428f-f8bc-897a1fafa044\"\n      },\n      \"source\": [\n        \"response = gpt.get_top_reply(prompt)\\n\",\n        \"print(response)\\n\",\n        \"modified_response = response.split(\\\"output: \\\")[-1].strip('\\\\n')\\n\",\n        \"eval(modified_response)\"\n      ],\n      \"execution_count\": 24,\n      \"outputs\": [\n        {\n          \"output_type\": \"stream\",\n          \"text\": [\n            \"output: plt.scatter(df['petal_length'], df['sepal_width'])\\n\",\n            \"\\n\"\n          ],\n          \"name\": \"stdout\"\n        },\n        {\n          \"output_type\": \"execute_result\",\n          \"data\": {\n            \"text/plain\": [\n              \"<matplotlib.collections.PathCollection at 0x7f4efbe0e128>\"\n            ]\n          },\n          \"metadata\": {\n            \"tags\": []\n          },\n          \"execution_count\": 24\n        },\n        {\n          \"output_type\": \"display_data\",\n          \"data\": {\n            \"image/png\": \"iVBORw0KGgoAAAANSUhEUgAAAXQAAAD7CAYAAAB68m/qAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+W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cz+5d6m+TszwFs71ym+C8EPjF95x/aKwH8mdPrhBRbFBGRbLrkIiISCRV0EZFIqKCLiERCBV1EJBIq6CIikVBBFxGJhAq6iEgkVNBFRCLx/6/h4Vqk6z5/AAAAAElFTkSuQmCC\\n\",\n            \"text/plain\": [\n              \"<Figure size 432x288 with 1 Axes>\"\n            ]\n          },\n          \"metadata\": {\n            \"tags\": [],\n            \"needs_background\": \"light\"\n          }\n        }\n      ]\n    },\n    {\n      \"cell_type\": \"markdown\",\n      \"metadata\": {\n        \"id\": \"6Fx9MuHOKZrn\",\n        \"colab_type\": \"text\"\n      },\n      \"source\": [\n        \"# Example 4\"\n      ]\n    },\n    {\n      \"cell_type\": \"code\",\n      \"metadata\": {\n        \"id\": \"1JQQEa_8J3j_\",\n        \"colab_type\": \"code\",\n        \"colab\": {}\n      },\n      \"source\": [\n        \"prompt = \\\"Show me the Joint Plot between Petal Length & Petal Length\\\"\"\n      ],\n      \"execution_count\": 25,\n      \"outputs\": []\n    },\n    {\n      \"cell_type\": \"code\",\n      \"metadata\": {\n        \"id\": \"GNHuzfNsKhzj\",\n        \"colab_type\": \"code\",\n        \"colab\": {\n          \"base_uri\": \"https://localhost:8080/\",\n          \"height\": 493\n        },\n        \"outputId\": \"c6d67a08-91a8-4b5f-e916-17514ca70a3b\"\n      },\n      \"source\": [\n        \"response = gpt.get_top_reply(prompt)\\n\",\n        \"print(response)\\n\",\n        \"modified_response = response.split(\\\"output: \\\")[-1].strip('\\\\n')\\n\",\n        \"eval(modified_response)\"\n      ],\n      \"execution_count\": 26,\n      \"outputs\": [\n        {\n          \"output_type\": \"stream\",\n          \"text\": [\n            \"output: sns.jointplot(x='petal_length',y='petal_length',data=df)\\n\",\n            \"\\n\"\n          ],\n          \"name\": \"stdout\"\n        },\n        {\n          \"output_type\": \"execute_result\",\n          \"data\": {\n            \"text/plain\": [\n              \"<seaborn.axisgrid.JointGrid at 0x7f4efbe583c8>\"\n            ]\n          },\n          \"metadata\": {\n            \"tags\": []\n          },\n          \"execution_count\": 26\n        },\n        {\n          \"output_type\": \"display_data\",\n          \"data\": {\n            \"image/png\": \"iVBORw0KGgoAAAANSUhEUgAAAZ8AAAGoCAYAAACZneiBAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+WH4yJAAAf0UlEQVR4nO3df5DcdZ3n8deLToAhBsfIiCRkFolsPDWu0TknGstSPAiiZ+VY90eQrdPbkq3TsqQ4o0RTy3mFF73sUnu1W+oh/lwgWwph6sSVmLoDPXNk3BBYB4GsxkPCgCQRhwQYkzC+74/uCZPO/OjvTH8/3/52Px9VU9P96e75vosq+pXP5/v+fr6OCAEAkNIpRRcAAOg8hA8AIDnCBwCQHOEDAEiO8AEAJDev6ALq0HoHoJ246AJaFTMfAEByhA8AILlWW3abtVsGHy26hFxd3t9bdAkA0DTMfAAAyRE+AIDk2mbZDWhlLAsDJ2LmAwBIjvABACRH+AAAkiN8AADJET4AgOQIHwBAcoQPACA5wgcAkBzhAwBIjvABACRH+AAAkiN8AADJsbEoWkK7b7wJ4ETMfAAAyRE+AIDkCB8AQHKEDwAgOcIHAJAc4QMASI7wAQAkR/gAAJIjfAAAyRE+AIDkCB8AQHKEDwAgOcIHAJAc4QMASI7wAQAkR/gAAJIjfAAAyRE+AIDkuI02gDlr99ugX97fW3QJbYeZDwAgOcIHAJAc4QMASI7wAQAkR/gAAJIjfAAAyRE+AIDkCB8AQHKEDwAgOcIHAJAc4QMASI7wAQAkx8aiJdHuGzcC6CzMfAAAyRE+AIDkHBFF13Cc7TslnTXLj58l6WATy0mpzLVL5a6/zLVL5a6/zLVLjdV/MCIuSVFM2bRU+MyF7V0R0Vd0HbNR5tqlctdf5tqlctdf5tql8tdfNJbdAADJET4AgOTaKXxuKLqAOShz7VK56y9z7VK56y9z7VL56y9U25zzAQCURzvN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8aA5WDtPM2V32zR2Slpt+5W1Yy2w/fszfGaHpD+uvf9iSS+ZpDYA0yB80Ar2qHo3zodU/SL/W1WD5PO2/1nS/ZLeUnvv1yV9qbaEdUTSl1W9l802Sf+U9cARcUDVDrottn+i6pLbq2b42GckXWz7AUl/JOlXkg5HxK9VXb57YELDAYBJcEsFFMr2eZLuqDUMlILt0ySNRcTztdnZF2u3EwfQINafgex6JX3L9imSjkr6UMH1AKXDzAdtzfbtkl5RN/zJiNhWRD0AqggfAEByNBwAAJIjfAAAyRE+AIDkCB8AQHL/H4gZeTz2HCrOAAAAAElFTkSuQmCC\\n\",\n            \"text/plain\": [\n              \"<Figure size 432x432 with 3 Axes>\"\n            ]\n          },\n          \"metadata\": {\n            \"tags\": [],\n            \"needs_background\": \"light\"\n          }\n        }\n      ]\n    },\n    {\n      \"cell_type\": \"markdown\",\n      \"metadata\": {\n        \"id\": \"au8eO5gwLOPg\",\n        \"colab_type\": \"text\"\n      },\n      \"source\": [\n        \"# Example 5\"\n      ]\n    },\n    {\n      \"cell_type\": \"code\",\n      \"metadata\": {\n        \"id\": \"eHEQ7C9iKjtD\",\n        \"colab_type\": \"code\",\n        \"colab\": {}\n      },\n      \"source\": [\n        \"prompt = \\\"Show me the Distribution of Sepal Length\\\"\"\n      ],\n      \"execution_count\": 27,\n      \"outputs\": []\n    },\n    {\n      \"cell_type\": \"code\",\n      \"metadata\": {\n        \"id\": \"U93zERQDLYDA\",\n        \"colab_type\": \"code\",\n        \"colab\": {\n          \"base_uri\": \"https://localhost:8080/\",\n          \"height\": 491\n        },\n        \"outputId\": \"ee9e923a-369c-4487-97cc-c7e289f3bac3\"\n      },\n      \"source\": [\n        \"response = gpt.get_top_reply(prompt)\\n\",\n        \"print(response)\\n\",\n        \"modified_response = response.split(\\\"output: \\\")[-1].strip('\\\\n')\\n\",\n        \"eval(modified_response)\"\n      ],\n      \"execution_count\": 28,\n      \"outputs\": [\n        {\n          \"output_type\": \"stream\",\n          \"text\": [\n            \"output: plt.hist(df['sepal_length'],bins=50)\\n\",\n            \"\\n\"\n          ],\n          \"name\": \"stdout\"\n        },\n        {\n          \"output_type\": \"execute_result\",\n          \"data\": {\n            \"text/plain\": [\n              \"(array([ 1.,  3.,  1.,  0.,  4.,  2.,  5.,  0.,  6., 10.,  0.,  9.,  4.,\\n\",\n              \"         1.,  0.,  6.,  7.,  0.,  6.,  8.,  7.,  0.,  3.,  6.,  0.,  6.,\\n\",\n              \"         4.,  9.,  0.,  7.,  5.,  2.,  0.,  8.,  3.,  0.,  4.,  1.,  1.,\\n\",\n              \"         0.,  3.,  1.,  0.,  1.,  0.,  1.,  0.,  4.,  0.,  1.]),\\n\",\n              \" array([4.3  , 4.372, 4.444, 4.516, 4.588, 4.66 , 4.732, 4.804, 4.876,\\n\",\n              \"        4.948, 5.02 , 5.092, 5.164, 5.236, 5.308, 5.38 , 5.452, 5.524,\\n\",\n              \"        5.596, 5.668, 5.74 , 5.812, 5.884, 5.956, 6.028, 6.1  , 6.172,\\n\",\n              \"        6.244, 6.316, 6.388, 6.46 , 6.532, 6.604, 6.676, 6.748, 6.82 ,\\n\",\n              \"        6.892, 6.964, 7.036, 7.108, 7.18 , 7.252, 7.324, 7.396, 7.468,\\n\",\n              \"        7.54 , 7.612, 7.684, 7.756, 7.828, 7.9  ]),\\n\",\n              \" <a list of 50 Patch objects>)\"\n            ]\n          },\n          \"metadata\": {\n            \"tags\": []\n          },\n          \"execution_count\": 28\n        },\n        {\n          \"output_type\": \"display_data\",\n          \"data\": {\n            \"image/png\": \"iVBORw0KGgoAAAANSUhEUgAAAXEAAAD4CAYAAAAaT9YAAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+WH4yJAAANJklEQVR4nO3db4xl9V3H8ffH3WIBCaA7wRYYlwcNSTWa4qRCMaRhqcHS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MXDeHYzpOzrkY09Ev7rcAv7Ji2dyN5xg552I8q+pgkgMsn945CtwL7F/VUTcDf5bkIZY7au+xHtPL7iWpsW11OkWSXmkscUlqzBKXpMYscUlqzBKXpMYscUlqzBKXpMb+HzJPay5uLPd3AAAAAElFTkSuQmCC\\n\",\n            \"text/plain\": [\n              \"<Figure size 432x288 with 1 Axes>\"\n            ]\n          },\n          \"metadata\": {\n            \"tags\": [],\n            \"needs_background\": \"light\"\n          }\n        }\n      ]\n    },\n    {\n      \"cell_type\": \"code\",\n      \"metadata\": {\n        \"id\": \"onnSCklcLcJT\",\n        \"colab_type\": \"code\",\n        \"colab\": {}\n      },\n      \"source\": [\n        \"\"\n      ],\n      \"execution_count\": null,\n      \"outputs\": []\n    }\n  ]\n}"
  },
  {
    "path": "gpt.py",
    "content": "\"\"\"Creates the Example and GPT classes for a user to interface with the OpenAI API.\"\"\"\n\nimport openai\n\n\ndef set_openai_key(key):\n    \"\"\"Sets OpenAI key.\"\"\"\n    openai.api_key = key\n\nclass Example():\n    \"\"\"Stores an input, output pair and formats it to prime the model.\"\"\"\n\n    def __init__(self, inp, out):\n        self.input = inp\n        self.output = out\n\n    def get_input(self):\n        \"\"\"Returns the input of the example.\"\"\"\n        return self.input\n\n    def get_output(self):\n        \"\"\"Returns the intended output of the example.\"\"\"\n        return self.output\n\n    def format(self):\n        \"\"\"Formats the input, output pair.\"\"\"\n        return f\"input: {self.input}\\noutput: {self.output}\\n\"\n\n\nclass GPT:\n    \"\"\"The main class for a user to interface with the OpenAI API.\n    A user can add examples and set parameters of the API request.\"\"\"\n\n    def __init__(self, engine='davinci',\n                 temperature=0.5,\n                 max_tokens=100):\n        self.examples = []\n        self.engine = engine\n        self.temperature = temperature\n        self.max_tokens = max_tokens\n\n    def add_example(self, ex):\n        \"\"\"Adds an example to the object. Example must be an instance\n        of the Example class.\"\"\"\n        assert isinstance(ex, Example), \"Please create an Example object.\"\n        self.examples.append(ex.format())\n\n    def get_prime_text(self):\n        \"\"\"Formats all examples to prime the model.\"\"\"\n        return '\\n'.join(self.examples) + '\\n'\n\n    def get_engine(self):\n        \"\"\"Returns the engine specified for the API.\"\"\"\n        return self.engine\n\n    def get_temperature(self):\n        \"\"\"Returns the temperature specified for the API.\"\"\"\n        return self.temperature\n\n    def get_max_tokens(self):\n        \"\"\"Returns the max tokens specified for the API.\"\"\"\n        return self.max_tokens\n\n    def craft_query(self, prompt):\n        \"\"\"Creates the query for the API request.\"\"\"\n        return self.get_prime_text() + \"input: \" + prompt + \"\\n\"\n\n    def submit_request(self, prompt):\n        \"\"\"Calls the OpenAI API with the specified parameters.\"\"\"\n        response = openai.Completion.create(engine=self.get_engine(),\n                                            prompt=self.craft_query(prompt),\n                                            max_tokens=self.get_max_tokens(),\n                                            temperature=self.get_temperature(),\n                                            top_p=1,\n                                            n=1,\n                                            stream=False,\n                                            stop=\"\\ninput:\")\n        return response\n\n    def get_top_reply(self, prompt):\n        \"\"\"Obtains the best result as returned by the API.\"\"\"\n        response = self.submit_request(prompt)\n        return response['choices'][0]['text']\n"
  },
  {
    "path": "iris.csv",
    "content": "sepal_length,sepal_width,petal_length,petal_width,species\n5.1,3.5,1.4,0.2,setosa\n4.9,3.0,1.4,0.2,setosa\n4.7,3.2,1.3,0.2,setosa\n4.6,3.1,1.5,0.2,setosa\n5.0,3.6,1.4,0.2,setosa\n5.4,3.9,1.7,0.4,setosa\n4.6,3.4,1.4,0.3,setosa\n5.0,3.4,1.5,0.2,setosa\n4.4,2.9,1.4,0.2,setosa\n4.9,3.1,1.5,0.1,setosa\n5.4,3.7,1.5,0.2,setosa\n4.8,3.4,1.6,0.2,setosa\n4.8,3.0,1.4,0.1,setosa\n4.3,3.0,1.1,0.1,setosa\n5.8,4.0,1.2,0.2,setosa\n5.7,4.4,1.5,0.4,setosa\n5.4,3.9,1.3,0.4,setosa\n5.1,3.5,1.4,0.3,setosa\n5.7,3.8,1.7,0.3,setosa\n5.1,3.8,1.5,0.3,setosa\n5.4,3.4,1.7,0.2,setosa\n5.1,3.7,1.5,0.4,setosa\n4.6,3.6,1.0,0.2,setosa\n5.1,3.3,1.7,0.5,setosa\n4.8,3.4,1.9,0.2,setosa\n5.0,3.0,1.6,0.2,setosa\n5.0,3.4,1.6,0.4,setosa\n5.2,3.5,1.5,0.2,setosa\n5.2,3.4,1.4,0.2,setosa\n4.7,3.2,1.6,0.2,setosa\n4.8,3.1,1.6,0.2,setosa\n5.4,3.4,1.5,0.4,setosa\n5.2,4.1,1.5,0.1,setosa\n5.5,4.2,1.4,0.2,setosa\n4.9,3.1,1.5,0.1,setosa\n5.0,3.2,1.2,0.2,setosa\n5.5,3.5,1.3,0.2,setosa\n4.9,3.1,1.5,0.1,setosa\n4.4,3.0,1.3,0.2,setosa\n5.1,3.4,1.5,0.2,setosa\n5.0,3.5,1.3,0.3,setosa\n4.5,2.3,1.3,0.3,setosa\n4.4,3.2,1.3,0.2,setosa\n5.0,3.5,1.6,0.6,setosa\n5.1,3.8,1.9,0.4,setosa\n4.8,3.0,1.4,0.3,setosa\n5.1,3.8,1.6,0.2,setosa\n4.6,3.2,1.4,0.2,setosa\n5.3,3.7,1.5,0.2,setosa\n5.0,3.3,1.4,0.2,setosa\n7.0,3.2,4.7,1.4,versicolor\n6.4,3.2,4.5,1.5,versicolor\n6.9,3.1,4.9,1.5,versicolor\n5.5,2.3,4.0,1.3,versicolor\n6.5,2.8,4.6,1.5,versicolor\n5.7,2.8,4.5,1.3,versicolor\n6.3,3.3,4.7,1.6,versicolor\n4.9,2.4,3.3,1.0,versicolor\n6.6,2.9,4.6,1.3,versicolor\n5.2,2.7,3.9,1.4,versicolor\n5.0,2.0,3.5,1.0,versicolor\n5.9,3.0,4.2,1.5,versicolor\n6.0,2.2,4.0,1.0,versicolor\n6.1,2.9,4.7,1.4,versicolor\n5.6,2.9,3.6,1.3,versicolor\n6.7,3.1,4.4,1.4,versicolor\n5.6,3.0,4.5,1.5,versicolor\n5.8,2.7,4.1,1.0,versicolor\n6.2,2.2,4.5,1.5,versicolor\n5.6,2.5,3.9,1.1,versicolor\n5.9,3.2,4.8,1.8,versicolor\n6.1,2.8,4.0,1.3,versicolor\n6.3,2.5,4.9,1.5,versicolor\n6.1,2.8,4.7,1.2,versicolor\n6.4,2.9,4.3,1.3,versicolor\n6.6,3.0,4.4,1.4,versicolor\n6.8,2.8,4.8,1.4,versicolor\n6.7,3.0,5.0,1.7,versicolor\n6.0,2.9,4.5,1.5,versicolor\n5.7,2.6,3.5,1.0,versicolor\n5.5,2.4,3.8,1.1,versicolor\n5.5,2.4,3.7,1.0,versicolor\n5.8,2.7,3.9,1.2,versicolor\n6.0,2.7,5.1,1.6,versicolor\n5.4,3.0,4.5,1.5,versicolor\n6.0,3.4,4.5,1.6,versicolor\n6.7,3.1,4.7,1.5,versicolor\n6.3,2.3,4.4,1.3,versicolor\n5.6,3.0,4.1,1.3,versicolor\n5.5,2.5,4.0,1.3,versicolor\n5.5,2.6,4.4,1.2,versicolor\n6.1,3.0,4.6,1.4,versicolor\n5.8,2.6,4.0,1.2,versicolor\n5.0,2.3,3.3,1.0,versicolor\n5.6,2.7,4.2,1.3,versicolor\n5.7,3.0,4.2,1.2,versicolor\n5.7,2.9,4.2,1.3,versicolor\n6.2,2.9,4.3,1.3,versicolor\n5.1,2.5,3.0,1.1,versicolor\n5.7,2.8,4.1,1.3,versicolor\n6.3,3.3,6.0,2.5,virginica\n5.8,2.7,5.1,1.9,virginica\n7.1,3.0,5.9,2.1,virginica\n6.3,2.9,5.6,1.8,virginica\n6.5,3.0,5.8,2.2,virginica\n7.6,3.0,6.6,2.1,virginica\n4.9,2.5,4.5,1.7,virginica\n7.3,2.9,6.3,1.8,virginica\n6.7,2.5,5.8,1.8,virginica\n7.2,3.6,6.1,2.5,virginica\n6.5,3.2,5.1,2.0,virginica\n6.4,2.7,5.3,1.9,virginica\n6.8,3.0,5.5,2.1,virginica\n5.7,2.5,5.0,2.0,virginica\n5.8,2.8,5.1,2.4,virginica\n6.4,3.2,5.3,2.3,virginica\n6.5,3.0,5.5,1.8,virginica\n7.7,3.8,6.7,2.2,virginica\n7.7,2.6,6.9,2.3,virginica\n6.0,2.2,5.0,1.5,virginica\n6.9,3.2,5.7,2.3,virginica\n5.6,2.8,4.9,2.0,virginica\n7.7,2.8,6.7,2.0,virginica\n6.3,2.7,4.9,1.8,virginica\n6.7,3.3,5.7,2.1,virginica\n7.2,3.2,6.0,1.8,virginica\n6.2,2.8,4.8,1.8,virginica\n6.1,3.0,4.9,1.8,virginica\n6.4,2.8,5.6,2.1,virginica\n7.2,3.0,5.8,1.6,virginica\n7.4,2.8,6.1,1.9,virginica\n7.9,3.8,6.4,2.0,virginica\n6.4,2.8,5.6,2.2,virginica\n6.3,2.8,5.1,1.5,virginica\n6.1,2.6,5.6,1.4,virginica\n7.7,3.0,6.1,2.3,virginica\n6.3,3.4,5.6,2.4,virginica\n6.4,3.1,5.5,1.8,virginica\n6.0,3.0,4.8,1.8,virginica\n6.9,3.1,5.4,2.1,virginica\n6.7,3.1,5.6,2.4,virginica\n6.9,3.1,5.1,2.3,virginica\n5.8,2.7,5.1,1.9,virginica\n6.8,3.2,5.9,2.3,virginica\n6.7,3.3,5.7,2.5,virginica\n6.7,3.0,5.2,2.3,virginica\n6.3,2.5,5.0,1.9,virginica\n6.5,3.0,5.2,2.0,virginica\n6.2,3.4,5.4,2.3,virginica\n5.9,3.0,5.1,1.8,virginica\n"
  }
]