Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable setting of template placeholder for text format based on file extension #3

Open
castedo opened this issue Jan 11, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@castedo
Copy link
Owner

castedo commented Jan 11, 2024

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.

@castedo castedo added the enhancement New feature or request label Jan 11, 2024
@castedo
Copy link
Owner Author

castedo commented Jan 14, 2024

Idea for new settings of user config file (`copyaid.toml')

[copybreak]
ids = ["copybreak", "cbr"]

[formats]
default = "markdown"

[formats.markdown]
mime_type = "text/markdown"
extensions = ["md"]
copybreak.delim = ["<!--", "-->"]

[formats.tex]
mime_type = "application/x-latex"
extensions = ["tex"]
copybreak.delim = "%%"

@castedo
Copy link
Owner Author

castedo commented Jan 18, 2024

Rather than placing mime_type directly under the format, consider enable generic setting of instruction parameters per format via something like:

[formats.markdown]
instruction.parameters = { mime_type = "text/markdown" }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant