Feature: Load balanced API keys and voice registration responses for Company 1
This commit is contained in:
@@ -169,7 +169,8 @@ EOT
|
||||
// Check if user requests postponement/delay (only if already started and not finished)
|
||||
if ($step !== 'start' && $step !== 'finished' && !empty($text)) {
|
||||
$rule = ChatbotRule::findActiveForRule($companyId);
|
||||
$apiKey = ($rule && !empty($rule['gemini_api_key'])) ? $rule['gemini_api_key'] : getenv('GEMINI_API_KEY');
|
||||
$configuredGeminiKey = ($rule && !empty($rule['gemini_api_key'])) ? $rule['gemini_api_key'] : null;
|
||||
$apiKey = GeminiService::getGeminiApiKey($configuredGeminiKey);
|
||||
if (!empty($apiKey)) {
|
||||
$postponeData = $this->detectPostponement($text, $apiKey);
|
||||
if ($postponeData !== null) {
|
||||
@@ -366,7 +367,8 @@ EOT
|
||||
|
||||
$companyId = $context['company_id'] ?? 1;
|
||||
$rule = ChatbotRule::findActiveForRule($companyId);
|
||||
$apiKey = ($rule && !empty($rule['gemini_api_key'])) ? $rule['gemini_api_key'] : getenv('GEMINI_API_KEY');
|
||||
$configuredGeminiKey = ($rule && !empty($rule['gemini_api_key'])) ? $rule['gemini_api_key'] : null;
|
||||
$apiKey = GeminiService::getGeminiApiKey($configuredGeminiKey);
|
||||
|
||||
if (empty($apiKey)) {
|
||||
error_log("[DriverRegistrationFlow] Gemini API key not configured.");
|
||||
|
||||
Reference in New Issue
Block a user