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
Update README to recommend Claude as default and add Claude 4.0 support
- Change default AI provider recommendation from OpenAI to Claude
- Add Claude 4.0 (claude-sonnet-4-20250514) support
- Update all model examples to use Claude 4.0
- Enhance installation instructions to prioritize Claude
- Update configuration examples with new model
- Bump version to 1.7.13
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
Copy file name to clipboardExpand all lines: README.md
+23-16Lines changed: 23 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -136,15 +136,15 @@ These custom styles offer creative ways to customize your translations, adding a
136
136
composer require kargnas/laravel-ai-translator
137
137
```
138
138
139
-
2. Add the OpenAI API key to your `.env` file:
139
+
2. Add the Claude API key to your `.env` file:
140
140
141
141
```
142
-
OPENAI_API_KEY=your-openai-api-key-here
142
+
ANTHROPIC_API_KEY=your-anthropic-api-key-here
143
143
```
144
144
145
-
You can obtain an API key from the [OpenAI website](https://platform.openai.com/account/api-keys).
145
+
You can obtain an API key from the [Anthropic Console](https://console.anthropic.com/settings/keys).
146
146
147
-
(If you want to use Anthropic's Claude or Google's Gemini instead, see step 4 below for configuration instructions.)
147
+
(If you want to use OpenAI's GPT or Google's Gemini instead, see step 4 below for configuration instructions.)
148
148
149
149
3. (Optional) Publish the configuration file:
150
150
@@ -154,13 +154,15 @@ These custom styles offer creative ways to customize your translations, adding a
154
154
155
155
This step is optional but recommended if you want to customize the package's behavior. It will create a `config/ai-translator.php` file where you can modify various settings.
156
156
157
-
4. (Optional) If you want to use Anthropic's Claude or Google's Gemini instead of OpenAI's GPT, update the `config/ai-translator.php` file:
157
+
4. (Optional) The package is configured to use Claude by default. If you want to use OpenAI's GPT or Google's Gemini instead, update the `config/ai-translator.php` file:
158
+
159
+
For OpenAI GPT:
158
160
159
161
```php
160
162
'ai' => [
161
-
'provider' => 'anthropic',
162
-
'model' => 'claude-3-7-sonnet-20250219',
163
-
'api_key' => env('ANTHROPIC_API_KEY'),
163
+
'provider' => 'openai',
164
+
'model' => 'gpt-4o',
165
+
'api_key' => env('OPENAI_API_KEY'),
164
166
],
165
167
```
166
168
@@ -174,15 +176,18 @@ These custom styles offer creative ways to customize your translations, adding a
174
176
],
175
177
```
176
178
177
-
Then, add the Anthropic or Gemini API key to your `.env` file:
179
+
Then, add the OpenAI or Gemini API key to your `.env` file:
178
180
179
181
```
180
-
ANTHROPIC_API_KEY=your-anthropic-api-key-here
182
+
OPENAI_API_KEY=your-openai-api-key-here
181
183
GEMINI_API_KEY=your-gemini-api-key-here
182
184
```
183
185
184
-
You can obtain an Anthropic API key from the [Anthropic website](https://www.anthropic.com).
185
-
For best results, we recommend using the Claude-3-7-sonnet model for your translations rather than OpenAI GPT. This model provides more accurate and natural translations.
@@ -369,12 +375,13 @@ This will create a `config/ai-translator.php` file where you can modify the foll
369
375
- Anthropic: See [Anthropic Models Documentation](https://docs.anthropic.com/en/docs/about-claude/models)
370
376
- OpenAI: See [OpenAI Models Documentation](https://platform.openai.com/docs/models)
371
377
372
-
> **⭐️ Strong Recommendation**: We highly recommend using Anthropic's Claude models, particularly `claude-3-7-sonnet-latest`. Here's why:
378
+
> **⭐️ Strong Recommendation**: We highly recommend using Anthropic's Claude models, particularly `claude-sonnet-4-20250514` or `claude-3-7-sonnet-latest`. Here's why:
373
379
>
374
380
> - More accurate and natural translations
375
381
> - Better understanding of context and nuances
376
382
> - More consistent output quality
377
383
> - More cost-effective for the quality provided
384
+
> - Claude 4.0 offers even better reasoning and translation quality
378
385
>
379
386
> While OpenAI integration is available, we strongly advise against using it for translations. Our extensive testing has shown that Claude models consistently produce superior results for localization tasks.
380
387
@@ -403,7 +410,7 @@ This will create a `config/ai-translator.php` file where you can modify the foll
403
410
```php
404
411
'ai' => [
405
412
'provider' => 'anthropic', // or 'openai' or 'gemini'
406
-
'model' => 'claude-3-7-sonnet-latest', // see model list above
413
+
'model' => 'claude-sonnet-4-20250514', // see model list above
407
414
'api_key' => env('ANTHROPIC_API_KEY'), // or env('OPENAI_API_KEY') or env('GEMINI_API_KEY')
0 commit comments