+ {/* Custom Provider Name (for custom providers) */}
+ {config.provider_id === "custom" && (
+
+
+
+ handleConfigChange(
+ config.id,
+ "custom_provider_name",
+ e.target.value
+ )
+ }
+ placeholder="e.g., Azure AI Studio, My Custom API"
+ className="w-full p-3 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-facebook-blue"
+ />
+
+ )}
+
+ {/* API Base URL (for custom providers and vLLM) */}
+ {(config.provider_id === "custom" ||
+ config.provider_id === "vllm") && (
+
+
+
+ handleConfigChange(
+ config.id,
+ "api_base",
+ e.target.value
+ )
+ }
+ placeholder={
+ config.provider_id === "vllm"
+ ? "e.g., http://localhost:8000"
+ : "e.g., https://your-endpoint.eastus2.inference.ai.azure.com/"
+ }
+ className="w-full p-3 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-facebook-blue"
+ />
+
+ )}
+
+ {/* Model Prefix (for custom providers) */}
+ {config.provider_id === "custom" && (
+
+
+
+ handleConfigChange(
+ config.id,
+ "model_prefix",
+ e.target.value
+ )
+ }
+ placeholder="e.g., azure_ai/, custom/"
+ className="w-full p-3 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-facebook-blue"
+ />
+
+ Leave empty for direct model names
+
+
+ )}
+
+ {/* Authentication Method (for custom providers) */}
+ {config.provider_id === "custom" && (
+
+
+
+
+ )}
+
+ {/* Model Selection */}
+
+
+ {config.provider_id === "custom" ? (
+
+ handleConfigChange(
+ config.id,
+ "model_name",
+ e.target.value
+ )
+ }
+ placeholder="e.g., command-r-plus, mistral-large-latest"
+ className="w-full p-3 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-facebook-blue"
+ />
+ ) : (
+
+ )}
+ {config.provider_id === "custom" && (
+
+ Final model will be:{" "}
+ {config.model_prefix || ""}
+ {config.model_name}
+
+ )}
+
+
+ {/* Authentication */}
+ {(provider?.requires_signup ||
+ config.provider_id === "custom") && (
+
+
+ {config.provider_id === "custom" &&
+ config.auth_method === "custom_headers" ? (
+
+
+ Configure custom headers for
+ authentication
+
+
+ ) : (
+
+ {
+ handleConfigChange(
+ config.id,
+ "api_key",
+ e.target.value
+ );
+ }}
+ placeholder={
+ config.provider_id === "custom"
+ ? config.auth_method ===
+ "bearer_token"
+ ? "Enter your bearer token"
+ : "Enter your API key"
+ : "Enter your API key"
+ }
+ className="w-full p-3 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-facebook-blue pr-10"
+ />
+
+
+ )}
+
+ )}
+
+ {/* Advanced Options */}
+ {showAdvanced && (
+ <>
+
+
+
+ handleConfigChange(
+ config.id,
+ "temperature",
+ parseFloat(e.target.value)
+ )
+ }
+ className="w-full p-3 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-facebook-blue"
+ />
+
+
+
+
+
+ handleConfigChange(
+ config.id,
+ "max_tokens",
+ parseInt(e.target.value)
+ )
+ }
+ className="w-full p-3 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-facebook-blue"
+ />
+
+
+ {selectedProviders.length > 1 && (
+
+
+
+
+ )}
+
+
+
+
+ handleConfigChange(
+ config.id,
+ "api_base",
+ e.target.value
+ )
+ }
+ className="w-full p-3 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-facebook-blue"
+ />
+
+ >
+ )}
+
+
+ {/* Connection error message */}
+ {connectionStatus[configKey] === "error" && (
+