-
Notifications
You must be signed in to change notification settings - Fork 6
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
add custom prompt to open AI translation #17
Conversation
src/Translator/OpenAiTranslator.php
Outdated
@@ -114,4 +122,9 @@ public function isConfigured(): bool | |||
|
|||
return $openAiConfig['api_key'] && $openAiConfig['model']; | |||
} | |||
|
|||
private function CustomPrompt(): string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Method should be in camelcase customPrompt()
😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed : ) @negoziator
config/translator.php
Outdated
* Example: | ||
* 'custom_prompt' => 'This application translates medical terms consistently throughout.' | ||
*/ | ||
'custom_prompt' => '' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prompt_extension
perhaps? custom_prompt I would assume it replaced the entire prompt.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, I think this is better
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or maybe additional_prompt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Definitely better could also consider prompt_context
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have added now, you can think about better name for this
Good idea overall |
I have fixed the naming |
Thanks for the PR @WatheqAlshowaiter |
some times an injected user prompt will enhance the translation, like this app is financial or medial app, and so on