Locale-aware prompt templates for quick LLM translation actions.
Each action (regenerate, short_version, rephrase, synonyms) has a prompt written in the target language to help the LLM produce more natural output. Falls back to English for unsupported locales.
Summary
Functions
Returns a human-readable label for a quick action.
Returns the list of available quick actions.
Returns the prompt for a given action and language code.
Types
Functions
Returns a human-readable label for a quick action.
Examples
iex> PromptTemplates.action_label(:short_version)
"Short Version"
@spec actions() :: [action()]
Returns the list of available quick actions.
Examples
iex> PromptTemplates.actions()
[:regenerate, :short_version, :rephrase, :synonyms]
Returns the prompt for a given action and language code.
The language code is a POSIX locale (e.g., "uk", "es", "pt_BR"). Falls back to English if the locale is not supported.
Examples
iex> PromptTemplates.get_prompt(:rephrase, "uk")
"Перефразуй переклад іншими словами, збережи той самий зміст але використай інші конструкції"
iex> PromptTemplates.get_prompt(:regenerate, "pt_BR")
"Traduza este texto novamente, ofereça uma nova alternativa de tradução"
iex> PromptTemplates.get_prompt(:short_version, "ja")
"Make the translation as short as possible while keeping the core meaning"