Skip to content

Commit

Permalink
chore: update default API version for Azure
Browse files Browse the repository at this point in the history
service provider
  • Loading branch information
liby committed Nov 21, 2023
1 parent a1ea2a3 commit a7dcc7e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/info.json
Expand Up @@ -34,10 +34,11 @@
"identifier": "apiVersion",
"type": "text",
"title": "API Version",
"defaultValue": "2023-03-15-preview",
"desc": "可选项。此值为在使用 Azure 模型时采用的 Chat completions API 版本,不支持 2023-03-15-preview 之前的版本",
"textConfig": {
"type": "visible",
"placeholderText": "2023-08-01-preview"
"placeholderText": "2023-03-15-preview"
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion src/main.js
Expand Up @@ -293,7 +293,7 @@ function translate(query) {

const baseUrl = ensureHttpsAndNoTrailingSlash(apiUrl || "https://api.openai.com");
let apiUrlPath = baseUrl.includes("gateway.ai.cloudflare.com") ? "/chat/completions" : "/v1/chat/completions";
const apiVersionQuery = apiVersion ? `?api-version=${apiVersion}` : "?api-version=2023-08-01-preview";
const apiVersionQuery = apiVersion ? `?api-version=${apiVersion}` : "?api-version=2023-03-15-preview";

const isAzureServiceProvider = baseUrl.includes("openai.azure.com");
if (isAzureServiceProvider) {
Expand Down

0 comments on commit a7dcc7e

Please sign in to comment.