Skip to content

Commit 6f457bc

Browse files
kargnasclaude
andcommitted
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]>
1 parent 74a14d4 commit 6f457bc

File tree

3 files changed

+28
-18
lines changed

3 files changed

+28
-18
lines changed

CLAUDE.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,4 +93,7 @@ Laravel package for AI-powered translations supporting multiple AI providers (Op
9393
- Validation to ensure translation accuracy
9494
- Support for variables, pluralization, and HTML
9595
- Custom language styles (e.g., regional dialects)
96-
- Token usage tracking and reporting
96+
- Token usage tracking and reporting
97+
98+
### Version Notes
99+
- When tagging versions, use `commit version 1.7.13` instead of `v1.7.13`

README.md

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -136,15 +136,15 @@ These custom styles offer creative ways to customize your translations, adding a
136136
composer require kargnas/laravel-ai-translator
137137
```
138138

139-
2. Add the OpenAI API key to your `.env` file:
139+
2. Add the Claude API key to your `.env` file:
140140

141141
```
142-
OPENAI_API_KEY=your-openai-api-key-here
142+
ANTHROPIC_API_KEY=your-anthropic-api-key-here
143143
```
144144

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).
146146

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.)
148148

149149
3. (Optional) Publish the configuration file:
150150

@@ -154,13 +154,15 @@ These custom styles offer creative ways to customize your translations, adding a
154154

155155
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.
156156

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:
158160

159161
```php
160162
'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'),
164166
],
165167
```
166168

@@ -174,15 +176,18 @@ These custom styles offer creative ways to customize your translations, adding a
174176
],
175177
```
176178

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:
178180

179181
```
180-
ANTHROPIC_API_KEY=your-anthropic-api-key-here
182+
OPENAI_API_KEY=your-openai-api-key-here
181183
GEMINI_API_KEY=your-gemini-api-key-here
182184
```
183185

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.
186+
You can obtain API keys from:
187+
- OpenAI: [OpenAI Platform](https://platform.openai.com/account/api-keys)
188+
- Gemini: [Google AI Studio](https://aistudio.google.com/app/apikey)
189+
190+
**We strongly recommend using Claude for the best translation quality and accuracy.**
186191

187192
5. You're now ready to use the Laravel AI Translator!
188193

@@ -345,7 +350,7 @@ This will create a `config/ai-translator.php` file where you can modify the foll
345350
```php
346351
'ai' => [
347352
'provider' => 'anthropic',
348-
'model' => 'claude-3-7-sonnet-latest',
353+
'model' => 'claude-sonnet-4-20250514',
349354
'api_key' => env('ANTHROPIC_API_KEY'),
350355
],
351356
```
@@ -354,6 +359,7 @@ This will create a `config/ai-translator.php` file where you can modify the foll
354359

355360
| Provider | Model | Extended Thinking | Context Window | Max Tokens |
356361
| ----------- | -------------------------------- | ----------------- | -------------- | ---------- |
362+
| `anthropic` | `claude-sonnet-4-20250514` || 200K | 8K/64K\* |
357363
| `anthropic` | `claude-3-7-sonnet-latest` || 200K | 8K/64K\* |
358364
| `anthropic` | `claude-3-7-sonnet-latest` || 200K | 8K |
359365
| `anthropic` | `claude-3-haiku-20240307` || 200K | 8K |
@@ -369,12 +375,13 @@ This will create a `config/ai-translator.php` file where you can modify the foll
369375
- Anthropic: See [Anthropic Models Documentation](https://docs.anthropic.com/en/docs/about-claude/models)
370376
- OpenAI: See [OpenAI Models Documentation](https://platform.openai.com/docs/models)
371377

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:
373379
>
374380
> - More accurate and natural translations
375381
> - Better understanding of context and nuances
376382
> - More consistent output quality
377383
> - More cost-effective for the quality provided
384+
> - Claude 4.0 offers even better reasoning and translation quality
378385
>
379386
> 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.
380387
@@ -403,7 +410,7 @@ This will create a `config/ai-translator.php` file where you can modify the foll
403410
```php
404411
'ai' => [
405412
'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
407414
'api_key' => env('ANTHROPIC_API_KEY'), // or env('OPENAI_API_KEY') or env('GEMINI_API_KEY')
408415
],
409416
```
@@ -424,7 +431,7 @@ return [
424431
425432
'ai' => [
426433
'provider' => 'anthropic',
427-
'model' => 'claude-3-7-sonnet-latest',
434+
'model' => 'claude-sonnet-4-20250514',
428435
'api_key' => env('ANTHROPIC_API_KEY'),
429436
],
430437

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "kargnas/laravel-ai-translator",
3-
"version": "1.7.12",
3+
"version": "1.7.13",
44
"description": "AI-powered translation tool for Laravel language files",
55
"keywords": [
66
"kargnas",

0 commit comments

Comments
 (0)