mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-08-28 05:27:24 +00:00
fix: correct Azure Responses API URL construction
- Fix URL construction to properly append API version query parameter - Avoid concatenating baseUrl twice
This commit is contained in:
parent
49b42793da
commit
18fe5a450a
1 changed files with 11 additions and 4 deletions
|
|
@ -475,10 +475,17 @@ export class OpenAiNativeHandler extends BaseProvider implements SingleCompletio
|
|||
const apiKey = this.options.openAiNativeApiKey ?? "not-provided"
|
||||
const baseUrl = this.options.openAiNativeBaseUrl || "https://api.openai.com"
|
||||
|
||||
// For Azure Responses API, the URL is already complete
|
||||
const url = this.isAzureResponsesApi
|
||||
? `${baseUrl}${this.options.azureApiVersion ? `${baseUrl.includes("?") ? "&" : "?"}api-version=${this.options.azureApiVersion}` : ""}`
|
||||
: `${baseUrl}/v1/responses`
|
||||
// For Azure Responses API, the URL is already complete, just add API version if provided
|
||||
let url: string
|
||||
if (this.isAzureResponsesApi) {
|
||||
url = baseUrl
|
||||
if (this.options.azureApiVersion) {
|
||||
const separator = baseUrl.includes("?") ? "&" : "?"
|
||||
url = `${baseUrl}${separator}api-version=${this.options.azureApiVersion}`
|
||||
}
|
||||
} else {
|
||||
url = `${baseUrl}/v1/responses`
|
||||
}
|
||||
|
||||
try {
|
||||
const response = await fetch(url, {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue