Changesets · Branches · Tags · Compare
| Changeset | f6d482c84614189f6e49e038f1f0be48c4992f274d16ff874fd3143cc04d745f |
|---|---|
| Author | Nate Sesti <33237525+sestinj@users.noreply.github.com> · 2025-06-10 19:44 -07:00 |
| Committer | GitHub <noreply@github.com> · 2025-06-10 19:44 -07:00 |
| Parents | 48a36c7cc06f, 55346f1d1574 |
3 files changed
modified core/llm/llms/stubs/ContinueProxy.ts +4 −0
| @@ -34,6 +34,10 @@ | ||
| 34 | 34 | constructor(options: LLMOptions) { |
| 35 | 35 | super(options); |
| 36 | 36 | this.configEnv = options.env; |
| 37 | + // This it set to `undefined` to handle the case where we are proxying requests to Azure. We pass the correct env vars | |
| 38 | + // needed to do this in `extraBodyProperties` below, but if we don't set `apiType` to `undefined`, we end up proxying to | |
| 39 | + // `/openai/deployments/` which is invalid since that URL construction happens on the proxy. | |
| 40 | + this.apiType = undefined; | |
| 37 | 41 | this.actualApiBase = options.apiBase; |
| 38 | 42 | this.apiKeyLocation = options.apiKeyLocation; |
| 39 | 43 | this.orgScopeId = options.orgScopeId; |
modified packages/openai-adapters/package.json +1 −1
| @@ -1,6 +1,6 @@ | ||
| 1 | 1 | { |
| 2 | 2 | "name": "@continuedev/openai-adapters", |
| 3 | - "version": "1.0.36", | |
| 3 | + "version": "1.0.38", | |
| 4 | 4 | "description": "", |
| 5 | 5 | "main": "dist/index.js", |
| 6 | 6 | "types": "dist/index.d.ts", |
modified packages/openai-adapters/src/apis/Azure.ts +8 −5
| @@ -19,9 +19,6 @@ | ||
| 19 | 19 | this.openai = new OpenAI({ |
| 20 | 20 | apiKey: azureConfig.apiKey, |
| 21 | 21 | baseURL: this._getAzureBaseURL(azureConfig), |
| 22 | - defaultQuery: azureConfig.env?.apiVersion | |
| 23 | - ? { "api-version": azureConfig.env.apiVersion } | |
| 24 | - : {}, | |
| 25 | 22 | fetch: customFetch(azureConfig.requestOptions), |
| 26 | 23 | }); |
| 27 | 24 | } |
| @@ -42,11 +39,17 @@ | ||
| 42 | 39 | if (this._isAzureOpenAI(config.env?.apiType)) { |
| 43 | 40 | if (!config.env?.deployment) { |
| 44 | 41 | throw new Error( |
| 45 | - "Azure deployment is required if `apiType` is `azure-openai` or `azure`", | |
| 42 | + "`env.deployment` is a required configuration property for Azure OpenAI", | |
| 46 | 43 | ); |
| 47 | 44 | } |
| 48 | 45 | |
| 49 | - return `${baseURL}/openai/deployments/${config.env.deployment}`; | |
| 46 | + if (!config.env?.apiVersion) { | |
| 47 | + throw new Error( | |
| 48 | + "`env.apiVersion` is a required configuration property for Azure OpenAI", | |
| 49 | + ); | |
| 50 | + } | |
| 51 | + | |
| 52 | + return `${baseURL}/openai/deployments/${config.env.deployment}?api-version=${config.env.apiVersion}`; | |
| 50 | 53 | } |
| 51 | 54 | |
| 52 | 55 | return baseURL; |