I would like to add that the rewrite feature was initially written using the Rewrite API but failed to generate results of sufficient quality. I later changed it to make use of the summary API and the prompt API with some roundabout prompt engineering. This led to a bit better results. Refer to the source code for further clarification.
Log in or sign up for Devpost to join the conversation.