mirror of
https://github.com/Nezumi-2711/9router.git
synced 2026-09-22 13:38:31 +00:00
Add Cloudflare AI provider support and enhance connection management
- Introduced Cloudflare AI as a new provider with specific configurations in providerModels.js and providers.js. - Updated DefaultExecutor to handle account ID resolution for Cloudflare AI connections. - Enhanced AddApiKeyModal and EditConnectionModal to include account ID input for Cloudflare AI. - Implemented validation for Cloudflare AI API key connections in testUtils.js and route.js. - Updated UI components to reflect changes in provider management and connection handling.
This commit is contained in:
@@ -32,9 +32,24 @@ export async function getProviderCredentials(provider, excludeConnectionIds = nu
|
||||
// Resolve alias to provider ID (e.g., "kc" -> "kilocode")
|
||||
const providerId = resolveProviderId(provider);
|
||||
|
||||
// Inject a virtual connection for no-auth free providers
|
||||
// Inject a virtual connection for no-auth free providers (with optional proxy pool from settings)
|
||||
if (FREE_PROVIDERS[providerId]?.noAuth) {
|
||||
return { id: "noauth", connectionName: "Public", isActive: true, accessToken: "public" };
|
||||
const settings = await getSettings();
|
||||
const override = (settings.providerStrategies || {})[providerId] || {};
|
||||
const resolvedProxy = await resolveConnectionProxyConfig({ proxyPoolId: override.proxyPoolId || "" });
|
||||
return {
|
||||
id: "noauth",
|
||||
connectionName: "Public",
|
||||
isActive: true,
|
||||
accessToken: "public",
|
||||
providerSpecificData: {
|
||||
connectionProxyEnabled: resolvedProxy.connectionProxyEnabled,
|
||||
connectionProxyUrl: resolvedProxy.connectionProxyUrl,
|
||||
connectionNoProxy: resolvedProxy.connectionNoProxy,
|
||||
connectionProxyPoolId: resolvedProxy.proxyPoolId || null,
|
||||
vercelRelayUrl: resolvedProxy.vercelRelayUrl || "",
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
const connections = await getProviderConnections({ provider: providerId, isActive: true });
|
||||
|
||||
Reference in New Issue
Block a user