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

add custom prompt to open AI translation #17

Merged
merged 3 commits into from
Nov 5, 2024

Conversation

WatheqAlshowaiter
Copy link
Contributor

some times an injected user prompt will enhance the translation, like this app is financial or medial app, and so on

@@ -114,4 +122,9 @@ public function isConfigured(): bool

return $openAiConfig['api_key'] && $openAiConfig['model'];
}

private function CustomPrompt(): string
Copy link
Contributor

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() 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed : ) @negoziator

* Example:
* 'custom_prompt' => 'This application translates medical terms consistently throughout.'
*/
'custom_prompt' => ''
Copy link
Owner

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.

Copy link
Contributor Author

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or maybe additional_prompt?

Copy link
Owner

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.

Copy link
Contributor Author

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

@Bottelet
Copy link
Owner

Bottelet commented Nov 4, 2024

Good idea overall

@WatheqAlshowaiter
Copy link
Contributor Author

I have fixed the naming

@Bottelet

@Bottelet
Copy link
Owner

Bottelet commented Nov 5, 2024

Thanks for the PR @WatheqAlshowaiter

@Bottelet Bottelet merged commit c75b9a9 into Bottelet:main Nov 5, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants