@probelabs/probe 0.6.0-rc316 → 0.6.0-rc318
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/binaries/{probe-v0.6.0-rc316-x86_64-apple-darwin.tar.gz → probe-v0.6.0-rc318-aarch64-apple-darwin.tar.gz} +0 -0
- package/bin/binaries/{probe-v0.6.0-rc316-aarch64-unknown-linux-musl.tar.gz → probe-v0.6.0-rc318-aarch64-unknown-linux-musl.tar.gz} +0 -0
- package/bin/binaries/{probe-v0.6.0-rc316-x86_64-pc-windows-msvc.zip → probe-v0.6.0-rc318-x86_64-apple-darwin.tar.gz} +0 -0
- package/bin/binaries/probe-v0.6.0-rc318-x86_64-pc-windows-msvc.zip +0 -0
- package/bin/binaries/{probe-v0.6.0-rc316-x86_64-unknown-linux-musl.tar.gz → probe-v0.6.0-rc318-x86_64-unknown-linux-musl.tar.gz} +0 -0
- package/build/utils/provider.js +26 -2
- package/cjs/agent/ProbeAgent.cjs +4404 -598
- package/cjs/index.cjs +4398 -592
- package/package.json +1 -1
- package/src/utils/provider.js +26 -2
- package/bin/binaries/probe-v0.6.0-rc316-aarch64-apple-darwin.tar.gz +0 -0
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/build/utils/provider.js
CHANGED
|
@@ -84,9 +84,32 @@ export function resolveApiKey(providerName) {
|
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
+
/**
|
|
88
|
+
* Resolve base URL for a provider from environment variables.
|
|
89
|
+
* Mirrors the env-var resolution in ProbeAgent and FallbackManager so that
|
|
90
|
+
* lightweight LLM calls (dedup, etc.) route through the same API gateway.
|
|
91
|
+
* @param {string} providerName
|
|
92
|
+
* @returns {string|undefined}
|
|
93
|
+
*/
|
|
94
|
+
export function resolveBaseUrl(providerName) {
|
|
95
|
+
const llmBaseUrl = process.env.LLM_BASE_URL;
|
|
96
|
+
switch (providerName) {
|
|
97
|
+
case 'anthropic':
|
|
98
|
+
return process.env.ANTHROPIC_API_URL || process.env.ANTHROPIC_BASE_URL || llmBaseUrl;
|
|
99
|
+
case 'openai':
|
|
100
|
+
return process.env.OPENAI_API_URL || llmBaseUrl;
|
|
101
|
+
case 'google':
|
|
102
|
+
return process.env.GOOGLE_API_URL || llmBaseUrl;
|
|
103
|
+
case 'bedrock':
|
|
104
|
+
return process.env.AWS_BEDROCK_BASE_URL || llmBaseUrl;
|
|
105
|
+
default:
|
|
106
|
+
return llmBaseUrl;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
87
110
|
/**
|
|
88
111
|
* Create a language model instance from provider name + model name.
|
|
89
|
-
* Resolves API keys from environment automatically.
|
|
112
|
+
* Resolves API keys and base URLs from environment automatically.
|
|
90
113
|
* Returns null on failure (graceful degradation for optional features).
|
|
91
114
|
* @param {string} providerName - 'anthropic' | 'openai' | 'google' | 'bedrock'
|
|
92
115
|
* @param {string} modelName - Model identifier (e.g., 'gemini-2.0-flash')
|
|
@@ -98,7 +121,8 @@ export async function createLanguageModel(providerName, modelName) {
|
|
|
98
121
|
if (!resolvedModel) return null;
|
|
99
122
|
try {
|
|
100
123
|
const apiKey = resolveApiKey(providerName);
|
|
101
|
-
const
|
|
124
|
+
const baseURL = resolveBaseUrl(providerName);
|
|
125
|
+
const provider = createProviderInstance({ provider: providerName, ...(apiKey ? { apiKey } : {}), ...(baseURL ? { baseURL } : {}) });
|
|
102
126
|
return provider(resolvedModel);
|
|
103
127
|
} catch {
|
|
104
128
|
return null;
|