@@ -124,3 +124,5 @@ /** | ||
| const map = ENV_MAP[provider]; | ||
| const apiKey = map.keyEnv.map(k => process.env[k]).find(Boolean); | ||
| if (!map) | ||
| return { apiKey: undefined, baseUrl: undefined }; | ||
| const apiKey = map.keyEnv.map((k) => process.env[k]).find(Boolean); | ||
| const baseUrl = map.urlEnv ? process.env[map.urlEnv] : undefined; | ||
@@ -149,3 +151,4 @@ return { apiKey, baseUrl }; | ||
| if (!apiKey && provider !== 'ollama') { | ||
| const envVars = ENV_MAP[provider].keyEnv; | ||
| const envEntry = ENV_MAP[provider]; | ||
| const envVars = envEntry?.keyEnv ?? []; | ||
| const envHint = envVars.length > 0 | ||
@@ -152,0 +155,0 @@ ? `Set ${envVars.join(' or ')} environment variable, or pass apiKey in config.` |
+1
-1
| { | ||
| "name": "agentkits", | ||
| "version": "1.10.0", | ||
| "version": "1.10.1", | ||
| "description": "Multi-provider AI toolkit for agents. One interface, any model.", | ||
@@ -5,0 +5,0 @@ "type": "module", |
@@ -186,5 +186,6 @@ /** | ||
| function resolveFromEnv(provider: EmbeddingProvider): { apiKey?: string; baseUrl?: string } { | ||
| const map = ENV_MAP[provider]; | ||
| const apiKey = map.keyEnv.map(k => process.env[k]).find(Boolean); | ||
| function resolveFromEnv(provider: string): { apiKey?: string; baseUrl?: string } { | ||
| const map = ENV_MAP[provider as keyof typeof ENV_MAP]; | ||
| if (!map) return { apiKey: undefined, baseUrl: undefined }; | ||
| const apiKey = map.keyEnv.map((k: string) => process.env[k]).find(Boolean); | ||
| const baseUrl = map.urlEnv ? process.env[map.urlEnv] : undefined; | ||
@@ -219,3 +220,4 @@ return { apiKey, baseUrl }; | ||
| if (!apiKey && provider !== 'ollama') { | ||
| const envVars = ENV_MAP[provider].keyEnv; | ||
| const envEntry = ENV_MAP[provider as keyof typeof ENV_MAP]; | ||
| const envVars = envEntry?.keyEnv ?? []; | ||
| const envHint = envVars.length > 0 | ||
@@ -222,0 +224,0 @@ ? `Set ${envVars.join(' or ')} environment variable, or pass apiKey in config.` |
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
2444744
0.01%18956
0.03%