Publishing the configuration file
The AI Translations package includes a configuration file that allows you to customize various aspects of the translation behavior. To publish the configuration file to your Laravel application, run:config/ai-translations.php file in your application where you can customize the package settings.
Configuration file structure
The configuration file is organized into the following sections:LLM provider
Configure which AI provider to use (OpenAI, Anthropic, or Gemini)
Languages
Define which languages your application supports
Default configuration
Here’s the complete default configuration file:config/ai-translations.php
Configuration options
An array of language codes your application supports. When set to
null, the package automatically detects languages from your lang directory.The LLM provider to use for translations. Available options:
openai, anthropic, or gemini.Configuration options for the OpenAI provider.
model(string): The primary model to use for translationsfast_model(string): A faster, less expensive model used with the--fastflagapi_key(string): Your OpenAI API key
Configuration options for the Anthropic provider.
model(string): The primary model to use for translationsfast_model(string): A faster model used with the--fastflagapi_key(string): Your Anthropic API key
Configuration options for the Gemini provider.
model(string): The primary model to use for translationsfast_model(string): A faster model used with the--fastflagapi_key(string): Your Gemini API key
Next steps
Configure LLM providers
Set up your AI provider credentials and models
Configure languages
Define which languages to translate