mirror of
https://github.com/andwati/dokploy.git
synced 2026-11-05 11:42:17 +00:00
Merge pull request #3920 from Dokploy/3286-azure-openai-endpoint-not-working
fix: prevent doubled /v1/ suffix in Azure OpenAI-compatible URLs
This commit is contained in:
@@ -30,6 +30,18 @@ export function selectAIProvider(config: { apiUrl: string; apiKey: string }) {
|
|||||||
baseURL: config.apiUrl,
|
baseURL: config.apiUrl,
|
||||||
});
|
});
|
||||||
case "azure":
|
case "azure":
|
||||||
|
// Azure OpenAI-compatible endpoints already include /v1 in the path.
|
||||||
|
// Using createAzure with such URLs causes a doubled /v1//v1/ suffix.
|
||||||
|
if (config.apiUrl.includes("/v1")) {
|
||||||
|
return createOpenAICompatible({
|
||||||
|
name: "azure",
|
||||||
|
baseURL: config.apiUrl,
|
||||||
|
headers: {
|
||||||
|
"api-key": config.apiKey,
|
||||||
|
Authorization: `Bearer ${config.apiKey}`,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
return createAzure({
|
return createAzure({
|
||||||
apiKey: config.apiKey,
|
apiKey: config.apiKey,
|
||||||
baseURL: config.apiUrl,
|
baseURL: config.apiUrl,
|
||||||
|
|||||||
Reference in New Issue
Block a user