fix(provider): restore Azure Cognitive Services endpoints (#37340)

This commit is contained in:
Aiden Cline 2026-07-16 12:58:02 -05:00 committed by GitHub
parent d8a1b932eb
commit 95ebf50ace
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -277,7 +277,7 @@ function custom(dep: CustomDep): Record<string, CustomLoader> {
},
}
}),
"azure-cognitive-services": Effect.fnUntraced(function* () {
"azure-cognitive-services": Effect.fnUntraced(function* (provider: Info) {
const resourceName = yield* dep.get("AZURE_COGNITIVE_SERVICES_RESOURCE_NAME")
return {
autoload: false,
@ -285,7 +285,9 @@ function custom(dep: CustomDep): Record<string, CustomLoader> {
return selectAzureLanguageModel(sdk, modelID, Boolean(options?.["useCompletionUrls"]))
},
options: {
baseURL: resourceName ? `https://${resourceName}.cognitiveservices.azure.com/openai` : undefined,
baseURL: resourceName
? `https://${resourceName}.cognitiveservices.azure.com/openai${provider.options?.useDeploymentBasedUrls ? "" : "/v1"}`
: undefined,
},
}
}),