Skip to content

Commit

Permalink
Improve question to ChatGPT
Browse files Browse the repository at this point in the history
  • Loading branch information
drejmanMacopedia committed May 9, 2023
1 parent 2c015bb commit 766c72e
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

class OpenAiTranslator implements TranslatorInterface
{
private const MESSAGE = 'Translate the text after a semicolon to %s;';
private const MESSAGE = 'Translate text betweeen <START> and <STOP> to %s. Keep HTMl unchanged. <START>%s<STOP>';

public function __construct(
private OpenAiClient $openAiClient
Expand All @@ -19,6 +19,6 @@ public function translate(string $text, Language $targetLanguageCode): ?string
{
return $this
->openAiClient
->ask('user', sprintf(self::MESSAGE, $targetLanguageCode->asText()) . $text);
->ask('user', sprintf(self::MESSAGE, $targetLanguageCode->asText(), $text));
}
}

0 comments on commit 766c72e

Please sign in to comment.