Skip to content

Commit

Permalink
Progress Through project
Browse files Browse the repository at this point in the history
  • Loading branch information
YashShah138 committed Jun 5, 2023
1 parent 356f2b8 commit 7fbcd19
Show file tree
Hide file tree
Showing 2 changed files with 140 additions and 9 deletions.
20 changes: 11 additions & 9 deletions .vscode/targets.log
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ make all --print-data-base --no-builtin-variables --no-builtin-rules --question

# This program built for i386-apple-darwin11.3.0

# Make data base, printed on Sun Jun 4 22:00:18 2023
# Make data base, printed on Mon Jun 5 07:55:31 2023

# Variables

Expand Down Expand Up @@ -46,13 +46,15 @@ GOLANG_EXECUTABLE = go
# environment
THREE_SCALE_USER_TOKEN = 207c527cfc2a6b8dcf4fa43ad7a976da
# environment
LaunchInstanceID = 7EF2B19D-912D-48A4-A155-FFB6F23F59B9
# environment
ELECTRON_RUN_AS_NODE = 1
# default
.FEATURES := target-specific order-only second-expansion else-if archives jobserver check-symlink
# environment
UUID = 9471d76a-d0fc-4e85-a823-24be57328531
# environment
SSH_AUTH_SOCK = /private/tmp/com.apple.launchd.pk0jfOAnwn/Listeners
SSH_AUTH_SOCK = /private/tmp/com.apple.launchd.LZAYrfHAgX/Listeners
# automatic
%F = $(notdir $%)
# environment
Expand Down Expand Up @@ -122,8 +124,6 @@ XPC_SERVICE_NAME = application.com.microsoft.VSCode.59695847.59695853
# automatic
+D = $(patsubst %/,%,$(dir $+))
# environment
VSCODE_L10N_BUNDLE_LOCATION =
# environment
RECOMMENDER_API_URL = https://gw.api.openshift.io//api/v2
# automatic
+F = $(notdir $+)
Expand All @@ -137,6 +137,8 @@ MAKEFILES :=
<F = $(notdir $<)
# environment
LC_ALL = C
# environment
SECURITYSESSIONID = 186c0
# automatic
^F = $(notdir $^)
# default
Expand All @@ -148,17 +150,17 @@ MAKELEVEL := 0
# environment
LANG = C
# environment
VSCODE_PID = 40178
VSCODE_PID = 1871
# variable set hash-table stats:
# Load=69/1024=7%, Rehash=0, Collisions=2/93=2%
# Load=70/1024=7%, Rehash=0, Collisions=2/94=2%

# Pattern-specific Variable Values

# No pattern-specific variable values.

# Directories

# . (device 16777223, inode 41567292): 40 files, no impossibilities.
# . (device 16777220, inode 41567292): 40 files, no impossibilities.

# 40 files, no impossibilities in 1 directories.

Expand Down Expand Up @@ -312,12 +314,12 @@ convert: .FORCE

# # of strings in strcache: 1
# # of strcache buffers: 1
# strcache size: total = 4096 / max = 4096 / min = 4096 / avg = 4096

make: *** No rule to make target `all'. Stop.

# strcache size: total = 4096 / max = 4096 / min = 4096 / avg = 4096
# strcache free: total = 4087 / max = 4087 / min = 4087 / avg = 4087

# Finished Make data base on Sun Jun 4 22:00:18 2023
# Finished Make data base on Mon Jun 5 07:55:32 2023


129 changes: 129 additions & 0 deletions _notebooks/2023-06-05-ProgressThroughFinalProject.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
{
"cells": [
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"# Learning Through The Final Project\n",
"> This notebook will document my progress, learning, and problems I ran into while completing my final project for Data Structures 2.\n",
"\n",
"- title: AI Teaching Progress\n",
"- toc: true\n",
"- comments: false\n",
"- categories: [Week-37]"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"## Week 1 (05/15)\n",
"\n",
"During this week, I was doing mainly research to help me find out how to attack the project. I was mainly using YouTube videos and documentation from OpenAI's API documentation page.\n",
"\n",
"Resources:\n",
"1. [Video 1 - How to deploy frontend project to Microsoft Azure](https://youtu.be/LX_DXLlaymg)\n",
"2. [Video 2 - ChatGPT Chatbot Creation Using Python ](https://youtu.be/pGOyw_M1mNE)\n",
"2. [Video 3 - How To Use OpenAI API](https://youtu.be/Vurdg6yrPL8)\n",
"2. [OpenAI Documentation](https://platform.openai.com/docs/api-reference)"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"## Week 2 (05/22)\n",
"\n",
"During this week, I have started building the project and experimenting with different types of files that I could add this program to. I ran into a few problems when trying to iterate through the _posts directory and adding the ChatGPT materials, because most of the files in the _posts directory were auto-generated .md files that were converted from Jupyter Notebooks for deployment."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"for root, dirs, files in os.walk(post_dir):\n",
" for file in files:\n",
" # For this to work, the auto-generated files have to be in a different folder than the \n",
" if file.endswith(\".md\"):\n",
" md_file_path = os.path.join(root, file)\n",
"\n",
" # Step 5: Parse Markdown or Jupyter Notebook content\n",
" with open(md_file_path, \"r\") as f:\n",
" content = f.read()\n",
" tags_start = content.find(\"tags:\")\n",
" tags_end = content.find(\"\\n\", tags_start)\n",
" tags = content[tags_start + 5:tags_end].strip() if tags_start != -1 else \"\"\n",
"\n",
" # Step 6: Invoke ChatGPT API\n",
" api_output = interact_with_api(tags)\n",
"\n",
" # Step 7: Update Markdown or Jupyter Notebook content\n",
" # Modify the content as per your requirements\n",
" # For example, append the output as a new section\n",
" updated_content = f\"{content}\\n\\n## ChatGPT API Output\\n\\n{api_output}\"\n",
"\n",
" # Step 8: Save modified file\n",
" with open(md_file_path, \"w\") as f:\n",
" f.write(updated_content)"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"## Week 3 (05/29)\n",
"\n",
"This week, I finished the notebook directory function and finished off the project and started on the fully deployed CodeGPT website. I have not finished the project, but will have it done in the next two weeks or so."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"def process_notebooks(notebook_dir):\n",
" for root, dirs, files in os.walk(notebook_dir):\n",
" for file in files:\n",
" if file.endswith(\".ipynb\"):\n",
" notebook_path = os.path.join(root, file)\n",
" notebook = nbformat.read(notebook_path, as_version=nbformat.NO_CONVERT)\n",
"\n",
" # Step 5: Parse Markdown or Jupyter Notebook content\n",
" tags = notebook[\"metadata\"].get(\"tags\", [])\n",
"\n",
" # Step 6: Invoke ChatGPT API\n",
" api_output = interact_with_api(tags)\n",
"\n",
" # Step 7: Update Markdown or Jupyter Notebook content\n",
" # Modify the notebook as per your requirements\n",
" # For example, append the output as a markdown cell at the end\n",
" new_cell = nbformat.v4.new_markdown_cell(source=api_output)\n",
" notebook[\"cells\"].append(new_cell)\n",
"\n",
" # Step 8: Save modified file\n",
" nbformat.write(notebook, notebook_path)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"name": "python",
"version": "3.9.7"
},
"orig_nbformat": 4
},
"nbformat": 4,
"nbformat_minor": 2
}

0 comments on commit 7fbcd19

Please sign in to comment.