Hi, is anyone familiar with examples / previous work where Custom ChatGPT code generation has been shaped by rules/specifications of some flavor? Note, I’m not trying to provide code that I want ChatGPT to use, but am trying to provide hints on how it should generate its code solutions.
I’m working through a code generation/ execution challenge for a Custom GPT. I am experimenting with a Custom GPT to analyze trail running data (GPX files). I’m at a stage where I’m trying to improve the reliability of its instructed “computation” steps. Computation in this case means when the Custom GPT takes its configured instructions and generates code and then executes it in the Code Interpreter. This can be a lengthy iterative process with ChatGPT and its Code Interpreter (when ChatGPT code errors force retries and sometimes failure).
I’m currently evaluating whether code rules and code samples can benefit this Custom GPT. I’m still evaluating the efficacy of these approaches - anecdotally some positive feedback, but still inconclusive. The code samples I provide to ChatGPT are code that ChatGPT successfully produced in previous sessions analyzing trail running data.
My goal is not to provide code to this Custom GPT but to provide high-level coding hints: pseudo-code, specification, etc, that ChatGPT can use to auto-complete and help it side-step many of the time-consuming pitfalls it encounters.
Thank you for any thoughts.
Example of trail route processing instructions that I’ve tested:
- Examine all the GPX points in the route. Filter out duplicate GPX points - A GPX point that has the same geolocation and timestamp as another point is a duplicate of it. Remove one of the duplicate points.
- Go through all the GPX points and place them into 100 geospatial trail segments. Each trail segment should be disjoint - does not geospatially overlap with another trail segment. You may think of each trail segment as a “bin” of continguous geolocated GPX points.
- Take all of the GPX points within each trail segment and calculate the standard deviation of the pace, the mean pace, and the standard deviation of the elevation for all points within each trail segment.
- Compute a technical rating for each segment by multiplying the standard deviation of both the pace and the elevation for its points and subtracting the mean pace.
Example of a Python code instruction set that I’ve tested:
When you process the GPX route data, do not use the gpxpy module, it is not available in your environment. Proceed with the analysis using alternative methods.
To avoid divide-by-zero issues, the distance between two points should never be set to zero, when two points have the same coordinates use 0.0001 meters.
Read the Python code in CODE_SAMPLES.txt in your knowledgebase. Use the examples there to help you guide your code choices.