Wow I am astonished! I created an empty repo in my personal github account just as a playground: (notice I could not spell generator correctly but !)
https://github.com/kevinhendricks/plugin_generatior
And used the initial following prompt:
Quote:
|
Create a python plugin for Sigil that uses the api and structure documented in the Sigil_Plugin_Framework_rev15.epub. This plugin should prompt the user using PySide6 to select any number of html files using a qfiledialog and then for each file selected, read in the file, use regular expressions to remove all script tags who do not have a src attribute and then add the edited file to the current epub using the proper api.
|
The agent took about 16 minutes to generate something I could review. It all looked correct accept for the structure of the plugin.xml file. It contained additional tags that are not allowed according to the spec.
https://github.com/kevinhendricks/pl...1-4e23cf279e7a
So after accepting their initial attempt, I added the Sigil_Plugin_Framework_rev15.epub file to the repo and then opened a second agent request:
Quote:
|
Fix plugin.xml to use only the allowed tags as described in the #Sigil_Plugin_Framework_rev15.epub document.
|
It came back also instantly with a fixed plugin.xml file. From looking at the agent thread it clearly unpacked the framework epub, read it in, identified the part about the plugin.xml tags in the api and identified the incorrect tags all itself. The ability to follow an api even one documented in an open structured epub simply amazes me.
https://github.com/kevinhendricks/pl...8-4019c89bea1b
I then built and tested the resulting plugin (zipping it by hand) and it actually worked correctly.
I never actually touched one line of code and instead just gave commands to fix errors in the plugin.xml file based on the api docs alone.
I am truly astonished.
Copilot does store your the exact text of your request but it was not easy to find (you have to look in a PR's edit history) so I quickly learned to copy each one of them to a separate text editor for safe keeping).
What is more fun is looking at the Agents tab in my repo and seeing the reasoning and logic for what it did in response to each of my two queries.
It is truly amazing.
I can easily see how continuously refining requests from an experienced programmer could easily speed up creation of coding project. I am still not sure that a non-programmer could actually succeed with this tool as it stands now.
My plan it to use the Agent to refine the existing plugin to use chardet to handle the cases where the base html encoding is not utf-8 but Windows-1252 or some other iso 8 bit encoding. Then have it run each page though our sigil_gumbo library to handle any other issues in its structure before adding it to the existing epub.
This technology is going to make experienced programmers much more effective as the Agent will listen to the programmer's preferred tools and approaches and can absorb and use api documentation.
Thank you to everyone for their guidance and especially Kovid in his examples and where exactly to go to get started and Doitsu for his specific examples.