-
Book Overview & Buying
-
Table Of Contents
Supercharged Coding with GenAI
By :
In this chapter, we explored how going-live tasks, such as adding logs, monitoring usage, and handling bad input, can introduce unnecessary complexity to functions. GenAI does not inherently suggest using decorators to separate these objectives from the core functionality of the program, which can lead to lower-quality code.
The most effective way to leverage GenAI for these tasks is through CoT prompting with GitHub Copilot. This approach involves first implementing the core function and then specifying additional requirements for decorators to handle logging, metric recording, or argument validation.
To ensure that the decorator implementation follows our desired style, we can use few-shot learning with Copilot and ChatGPT or fine-tune a model for OpenAI API. This allows us to achieve more desirable results, minimizing the requirements for chained edits to the code.
In the final chapter of the book, we will summarize the key takeaways from the 15 chapters and...