You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature related to a specific framework or general for this extension?
General. This feature request is aimed at making the keypathValidate function and prompt settings more configurable, and is not tied to a specific framework.
Is your feature request related to a problem? Please describe.
Currently, the keypathValidate function uses a hardcoded regex pattern for validation. This limits flexibility when different key path patterns are needed across various projects or environments. Additionally, having prompt settings that are also configurable would enhance the overall usability and adaptability of the extension.
Describe the solution you'd like
I would like to introduce configuration options for the keypathValidate function, allowing users to define their own regex patterns through settings. This would enable different projects to have custom key path validation rules without modifying the core code. Additionally, providing configurable prompt settings would allow for more personalized user interactions.
Additional context
This feature would significantly increase the versatility of the extension, making it more adaptable to various use cases and project requirements. It would also simplify maintenance by centralizing configuration options instead of relying on code changes.
// keypathValidate.tsimport{Config}from'~/core'exportfunctionkeypathValidate(keypath: string){return!!keypath.math(Config.keypathValidate ? newRegExp(Config.keypathValidate) : keypath.match(/^[\w\d\-_][\w\d\-_[\]. ]*$/))}// openapi.tssystemPrompt=Config.openaiApiSystemPrompt??'You are a professional translation engine. Please translate text without explanation.'...generateUserPrompts(options: TranslateOptions): string {constsourceLang=options.fromconsttargetLang=options.toconstmessage=options.textletgeneratedUserPrompt=`translate from ${sourceLang} to ${targetLang}:\n\n${message}`if(Config.openaiApiPrompt&&sourceLang&&targetLang&&message)generatedUserPrompt=Config.openaiApiPrompt.replaceAll('{sourceLang}',sourceLang).replaceAll('{targetLang}',targetLang).replaceAll('{message}',message)returngeneratedUserPrompt}
The text was updated successfully, but these errors were encountered:
Is your feature related to a specific framework or general for this extension?
General. This feature request is aimed at making the keypathValidate function and prompt settings more configurable, and is not tied to a specific framework.
Is your feature request related to a problem? Please describe.
Currently, the keypathValidate function uses a hardcoded regex pattern for validation. This limits flexibility when different key path patterns are needed across various projects or environments. Additionally, having prompt settings that are also configurable would enhance the overall usability and adaptability of the extension.
Describe the solution you'd like
I would like to introduce configuration options for the keypathValidate function, allowing users to define their own regex patterns through settings. This would enable different projects to have custom key path validation rules without modifying the core code. Additionally, providing configurable prompt settings would allow for more personalized user interactions.
Additional context
This feature would significantly increase the versatility of the extension, making it more adaptable to various use cases and project requirements. It would also simplify maintenance by centralizing configuration options instead of relying on code changes.
The text was updated successfully, but these errors were encountered: