-
Book Overview & Buying
-
Table Of Contents
Supercharged Coding with GenAI
By :
In this chapter, we explored how to apply the five S’s best practices for crafting precise prompts using both OpenAI API and GitHub Copilot. With OpenAI API, we learned how to extract valuable information from Python objects, including attributes such as source code, docstrings, filenames, object types, and more. When working with Copilot, we examined which aspects of the five S’s are already implemented and identified how we can use those more precisely to improve outputs from the GenAI application.
Through two interactive labs, we utilized the Singleton design pattern, commonly employed by Python developers to enforce a single class instance with a designated metaclass. Using OpenAI API, we generated documentation for the __call__ method of the Singleton. With GitHub Copilot, we constructed a unit test that failed due to an undesirable behavior caused by faulty implementation, analyzed the test failure, and assisted Copilot in fixing the implementation...