Skip to content

Commit a7a6b3c

Browse files
🤖 fix: map baseUrl to baseURL for AI providers (#532)
Maps `baseUrl` from config to `baseURL` expected by AI SDK providers (Anthropic, OpenAI). Maintains backward compatibility - existing configs with `baseUrl` continue to work without changes. _Generated with `cmux`_ --------- Co-authored-by: Michael Suchacz <134246071+coderjoe-bot@users.noreply.github.com>
1 parent 70d85a5 commit a7a6b3c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/services/aiService.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,13 @@ export class AIService extends EventEmitter {
239239

240240
// Load providers configuration - the ONLY source of truth
241241
const providersConfig = this.config.loadProvidersConfig();
242-
const providerConfig = providersConfig?.[providerName] ?? {};
242+
let providerConfig = providersConfig?.[providerName] ?? {};
243+
244+
// Map baseUrl to baseURL if present (SDK expects baseURL)
245+
const { baseUrl, ...configWithoutBaseUrl } = providerConfig;
246+
providerConfig = baseUrl
247+
? { ...configWithoutBaseUrl, baseURL: baseUrl }
248+
: configWithoutBaseUrl;
243249

244250
// Handle Anthropic provider
245251
if (providerName === "anthropic") {

0 commit comments

Comments
 (0)