feat: make Gemini model configurable + auto-list available models on error
- gemini_model is now a saved config field (default: gemini-2.0-flash) - Config panel shows a text input to set the model name - probarGemini() reads the configured model and on error calls ListModels to show exactly which model names are available for the account's API key - GeminiIntentService and GeminiVisionService build the URL from config at runtime Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
deb4d040c3
commit
75eddd16a6
@@ -10,11 +10,13 @@ use Illuminate\Support\Facades\Log;
|
||||
class GeminiIntentService
|
||||
{
|
||||
private string $apiKey;
|
||||
private string $apiUrl = 'https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent';
|
||||
private string $apiUrl;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->apiKey = ChatConfig::get('gemini_api_key', '');
|
||||
$model = ChatConfig::get('gemini_model', 'gemini-2.0-flash');
|
||||
$this->apiUrl = "https://generativelanguage.googleapis.com/v1beta/models/{$model}:generateContent";
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user