Skip to content

Commit bc7d6f0

Browse files
authored
fix: improve Azure API detection to support custom endpoints (RooCodeInc#2332)
* fix: improve Azure API detection to support custom endpoints * chore: add changeset for Azure API version detection fix
1 parent c8b446a commit bc7d6f0

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

.changeset/nine-feet-attack.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"claude-dev": patch
3+
---
4+
5+
fixes an issue with Azure API version detection in the OpenAI provider

src/api/providers/openai.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ export class OpenAiHandler implements ApiHandler {
1515
constructor(options: ApiHandlerOptions) {
1616
this.options = options
1717
// Azure API shape slightly differs from the core API shape: https://github.com/openai/openai-node?tab=readme-ov-file#microsoft-azure-openai
18-
if (this.options.openAiBaseUrl?.toLowerCase().includes("azure.com")) {
18+
// Use azureApiVersion to determine if this is an Azure endpoint, since the URL may not always contain 'azure.com'
19+
if (this.options.azureApiVersion || this.options.openAiBaseUrl?.toLowerCase().includes("azure.com")) {
1920
this.client = new AzureOpenAI({
2021
baseURL: this.options.openAiBaseUrl,
2122
apiKey: this.options.openAiApiKey,

0 commit comments

Comments
 (0)