Skip to content

Commit e863daf

Browse files
committed
fix: add 'google' as alias for 'gemini' provider + add BYOK debug logging
1 parent 8cc619d commit e863daf

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

backend/simpatico-ats.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,6 +537,8 @@ async function getCompanyAIConfig(env, tenantId) {
537537
const rows = await res.json();
538538
const row = rows?.[0];
539539

540+
console.log(`[BYOK] Config lookup for tenant=${tenantId}: found=${!!row}, provider=${row?.ai_provider || 'none'}, hasKey=${!!row?.ai_api_key}, model=${row?.ai_model || 'none'}`);
541+
540542
let config = null;
541543
if (row && row.ai_provider && row.ai_provider !== "cloudflare" && row.ai_api_key) {
542544
config = {
@@ -565,7 +567,10 @@ async function getCompanyAIConfig(env, tenantId) {
565567
* Resolves the correct base URL and model for a given provider config.
566568
*/
567569
function resolveProviderDefaults(cfg) {
568-
const p = cfg.provider;
570+
// Normalize provider names (handle aliases)
571+
let p = cfg.provider;
572+
if (p === "google") p = "gemini"; // Dashboard may save as "google"
573+
569574
let baseUrl = cfg.baseUrl;
570575
let model = cfg.model;
571576

0 commit comments

Comments
 (0)