Closed ckak912 closed 1 year ago
the integration of this code with the front end involves several key components
a new endpoint exercise_hint_code was created in webserver.py that accepted ID's of the exercise, assignment, and course as parameters
exercise_hint_code
webserver.py
the server then queries the database to check if any hint code exists for the current exercise
if no hint code is found, the handler makes the API request to OpenAI's server
once the response from OpenAI is recieved, I perform some regex to extract the hint code from the response
the formatted hint code is then stored in the database as JSON
this entire process is invoked upon clicking the hint button in the front end
the integration of this code with the front end involves several key components
a new endpoint
exercise_hint_code
was created inwebserver.py
that accepted ID's of the exercise, assignment, and course as parametersthe server then queries the database to check if any hint code exists for the current exercise
if no hint code is found, the handler makes the API request to OpenAI's server
once the response from OpenAI is recieved, I perform some regex to extract the hint code from the response
the formatted hint code is then stored in the database as JSON
this entire process is invoked upon clicking the hint button in the front end