Skip to content

Commit

Permalink
fix config
Browse files Browse the repository at this point in the history
  • Loading branch information
QuentinGab committed Jun 18, 2024
1 parent 9e48d73 commit a79d12a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions config/translator.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// config for Elegantly/Translator

use Elegantly\Translator\Services\DeepLService;
use Elegantly\Translator\Services\OpenAiService;

return [

Expand All @@ -12,10 +11,10 @@
'service' => DeepLService::class,

'services' => [
DeepLService::class => [
'deepl' => [
'key' => env('DEEPL_KEY'),
],
OpenAiService::class => [
'openai' => [
'model' => 'gpt-4o',
'prompt' => 'Translate the following json to the locale {targetLocale} while preserving the keys.',
],
Expand Down
4 changes: 2 additions & 2 deletions src/TranslatorServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ public function getTranslatorService(): TranslatorServiceInterface
$service = config('translator.service');

return match ($service) {
DeepLService::class => new DeepLService(
DeepLService::class, 'deepl' => new DeepLService(
key: config('translator.services.deepl.key')
),
OpenAiService::class => new OpenAiService(
OpenAiService::class, 'openai' => new OpenAiService(
model: config('translator.services.openai.model'),
prompt: config('translator.services.openai.prompt'),
),
Expand Down

0 comments on commit a79d12a

Please sign in to comment.