Why? Because GitHub as a forge is not open-source. In contrast, the community edition of GitLab is open-source.
castedo / copyaid Goto Github PK
View Code? Open in Web Editor NEWMirror of https://gitlab.com/castedo/copyaid
License: MIT License
Mirror of https://gitlab.com/castedo/copyaid
License: MIT License
Why? Because GitHub as a forge is not open-source. In contrast, the community edition of GitLab is open-source.
Make a Dockerfile and container images, similar to
https://gitlab.com/perm.pub/baseprinter/-/tree/main/oci_images
and
https://hub.docker.com/r/castedo/baseprinter
but instead fo baseprinter it is for copyaid.
This is primarily for better isolation and reproduction of what a GitHub Action for copyaid uses.
Let lang_tag
act as a standard parameter to be automatically passed to prompt (request) settings. This is for values per https://datatracker.ietf.org/doc/html/rfc5646
https://www.rfc-editor.org/info/bcp47
https://en.wikipedia.org/wiki/IETF_language_tag
and the HTML lang tag.
Check a top-level key in the user config file (copyaid.toml
) for lang_tag
if a user wants to set it.
Extra nice addition feature is to
import locale
'-'.join(locale.getlocale()[0].split('_'))
to automatically populate this parameter if it is not specified in the config file.
This is additional functionality beyond #2. Based on the file extension of the source file passed to copyaid, enable the setting of a template placeholder for the chat_system
message setting.
Maybe the mapping between filename extension and text to be inserted should be direct like:
".md" -> "Markdown and HTML"
".tex" -> "LaTeX"
Note how "Markdown and HTML" could perform better in the prompt for GPT even though to a human, conceptually, "Markdown" should suffice, in theory.
Or maybe there should be a MIME type indirection in between:
".md" -> "text/markdown" -> "Markdown and HTML"
".tex" -> "application/x-latex" -> "LaTeX"
These mapping could be exclusively in the user copyaid.toml
config file or the prompt query settings file. My inclination is that the mapping
".md" -> "text/markdown"
".tex" -> "application/x-latex"
should be in the user config copyaid.toml
and the mapping
"text/markdown" -> "Markdown and HTML"
"application/x-latex" -> "LaTeX"
should be in the settings file, along with the OpenAI API settings like the prompt template and the GPT model setting.
Make a GitHub template repository like:
https://github.com/castedo/baseprint-starter
but instead of for Baseprinter it is for CopyAId.
This is very similar to, totally inspired by, and roughly speaking a knock-off of https://github.com/manubot/manubot-ai-editor/.
However, compared to Manubot AI Editor, there are five benefits to this enhancement which I think are superior to Manubot AI Editor:
As a user, benefit 2 is important to me. I want to see and merge in copyedited text from OpenAI locally with local files BEFORE committing. And also kick off and get back AI copyedits quickly too, and not have to wait for GitHub actions to complete.
Make a GitHub Action like
https://github.com/castedo/baseprinter-action
but instead of Baseprinter it is for CopyAId. Use the Docker image from #4.
Some parts of prompts change slightly depending on scenario. In particular, making corrections based on American vs British English. Another example is editing Markdown vs LaTeX formatted source text.
This feature is to enable the chat_system
settings inside a prompt request settings file to contain a template with a placeholder for English dialect and a way to select between American and British in the copyaid.toml
user configuration file.
Placing
<!-- copybreak off -->
at the top of a file is currently the only way to skip processing the start of a file.
But in some contexts this is very inconvenient. For example:
mkdocs
one wants to have the title at the top of the file so the title is automatically placed in the navigation barThe following is copied from https://gitlab.com/castedo/copyaid/-/issues/6
Mass testing with prompts indicates that quality of GPT output quality degrades as the inputs get longer and longer. It is also more expensive to send all text in a file. It is a bit of pain to have to break up documents into smaller files merely for the reason to have less text sent to OpenAI. It is also quite annoying to have OpenAI suggesting lots of changes to sections of text that have already been worked on when only other sections are in need of copyediting/proofreading. This feature is relatively simple to implement and provides users lots of flexibility to control behavior and mitigate these problems.
Allow specially marked lines to act as "copybreaks" within source text. These line are not included in OpenAI request text and instead force a break up of the source file into separate chunks that become part of separate prompt texts for the OpenAI API.
For markdown (.md) an example copybreak line is:
<!-- copybreak -->
and for LaTex (.tex) an example copybreak line is:
%% copybreak
The config file for Copyaid allows control of the exact line prefix per file type (based on file extension) and the keyword. For the above example, the config in TOML would be something like:
copybreak = {
'md' = ['<!--', 'copybreak'],
'tex' = ['%%', 'copybreak'],
}
Optionally a subtask name can follow the marking prefix, after 'copybreak' and whitespace. What prompts and requests are triggered, if any, given the subtask name is controlled from the config file. Some subtask names can be configured to skip being sent to OpenAPI and so that the chunk of text is left as is. For example:
<!-- copybreak skip -->
and
%% copybreak skip
will cause all further text to be skipped from being sent to OpenAI until a difference subtask name is encountered.
When no subtask name is specified, whatever was the last subtask name specified is used again. The configuration for a copyaid task can specify the initial subtask name to take effect. Some users might want it to be "on" and the skip subtask name to be "off".
During an initial experimental stage I plan to use "light" and "heavy" as subtask names corresponding to light/heavy copy-editing and will probably configure "skip" as the initial subtask.
https://github.com/manubot/manubot-ai-editor/ automatically splits up files into "paragraphs" and sends them as separate chunks to OpenAI. I find the logic for parsing apart "paragraphs" too fragile, hard-coded, and error prone to be acceptable as a default for entire files. As a future feature, I imagine some CopyAId subtask names can enable similar automatic break up, but not by default. The automatic additional breaking would only happen because a particular subtask of a copybreak has as enabled it.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.