mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-08-28 05:27:24 +00:00
Second Quick Fix for Azure Foundry (#11374)
This commit is contained in:
parent
b971fe1a63
commit
4438fdadc6
2 changed files with 6 additions and 6 deletions
|
|
@ -74,14 +74,14 @@ describe("AzureHandler", () => {
|
|||
expect(handlerWithoutModel.getModel().id).toBe("")
|
||||
})
|
||||
|
||||
it("should use default API version if not provided", () => {
|
||||
it("should omit API version if not provided", () => {
|
||||
const handlerWithoutVersion = new AzureHandler({
|
||||
...mockOptions,
|
||||
azureApiVersion: undefined,
|
||||
})
|
||||
expect(handlerWithoutVersion).toBeInstanceOf(AzureHandler)
|
||||
expect(mockCreateAzure).toHaveBeenLastCalledWith(
|
||||
expect.objectContaining({ apiVersion: "2025-04-01-preview" }),
|
||||
expect.not.objectContaining({ apiVersion: expect.anything() }),
|
||||
)
|
||||
})
|
||||
|
||||
|
|
@ -98,14 +98,14 @@ describe("AzureHandler", () => {
|
|||
)
|
||||
})
|
||||
|
||||
it("should use default API version when configured value is blank", () => {
|
||||
it("should omit API version when configured value is blank", () => {
|
||||
new AzureHandler({
|
||||
...mockOptions,
|
||||
azureApiVersion: " ",
|
||||
})
|
||||
|
||||
expect(mockCreateAzure).toHaveBeenLastCalledWith(
|
||||
expect.objectContaining({ apiVersion: "2025-04-01-preview" }),
|
||||
expect.not.objectContaining({ apiVersion: expect.anything() }),
|
||||
)
|
||||
})
|
||||
})
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import { Anthropic } from "@anthropic-ai/sdk"
|
|||
import { createAzure } from "@ai-sdk/azure"
|
||||
import { streamText, generateText, ToolSet } from "ai"
|
||||
|
||||
import { azureModels, azureDefaultModelInfo, azureOpenAiDefaultApiVersion, type ModelInfo } from "@roo-code/types"
|
||||
import { azureModels, azureDefaultModelInfo, type ModelInfo } from "@roo-code/types"
|
||||
|
||||
import type { ApiHandlerOptions } from "../../shared/api"
|
||||
|
||||
|
|
@ -46,7 +46,7 @@ export class AzureHandler extends BaseProvider implements SingleCompletionHandle
|
|||
this.provider = createAzure({
|
||||
resourceName: options.azureResourceName ?? "",
|
||||
apiKey: options.azureApiKey, // Optional — Azure supports managed identity / Entra ID auth
|
||||
...(apiVersion ? { apiVersion } : { apiVersion: azureOpenAiDefaultApiVersion }),
|
||||
...(apiVersion ? { apiVersion } : {}),
|
||||
headers: DEFAULT_HEADERS,
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue