INNER CODE UNIT · JavaScript

looksLikeOpenAICompatibleBaseUrl

kevinchin12/ImageLens · background.js:548

function looksLikeOpenAICompatibleBaseUrl(baseUrl) {
  const normalized = String(baseUrl || "").toLowerCase();
  return /api\.openai\.com/.test(normalized) || /openrouter\.ai/.test(normalized);
}

function pickProviderProfileFields(source) {
  return {
    apiMode: source?.apiMode,
    promptApiKey: source?.promptApiKey,
    promptModel: source?.promptModel,
    imageGenerationEnabled: source?.imageGenerationEnabled,
    imageApiKey: source?.imageApiKey,
    imageModel: source?.imageModel,
    geminiBaseUrl: source?.geminiBaseUrl,
    openaiBaseUrl: source?.openaiBaseUrl,
    customProxyUrl: source?.customProxyUrl,
    customProxyToken: source?.customProxyToken,
    autoAnalyze: source?.autoAnalyze

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…