File tree Expand file tree Collapse file tree 2 files changed +16
-3
lines changed
openai-java-core/src/main/kotlin/com/openai Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,18 @@ class AzureOpenAIServiceVersion private constructor(@get:JvmName("value") val va
8
8
private val values: ConcurrentHashMap <String , AzureOpenAIServiceVersion > =
9
9
ConcurrentHashMap ()
10
10
11
+ @JvmStatic
12
+ fun latestStableVersion (): AzureOpenAIServiceVersion {
13
+ // We can update the value every general available(GA)/stable announcement.
14
+ return V2024_10_21
15
+ }
16
+
17
+ @JvmStatic
18
+ fun latestPreviewVersion (): AzureOpenAIServiceVersion {
19
+ // We can update the value every preview announcement.
20
+ return V2025_01_01_PREVIEW
21
+ }
22
+
11
23
@JvmStatic
12
24
fun fromString (version : String ): AzureOpenAIServiceVersion =
13
25
values.computeIfAbsent(version) { AzureOpenAIServiceVersion (version) }
Original file line number Diff line number Diff line change @@ -4,7 +4,6 @@ package com.openai.core
4
4
5
5
import com.fasterxml.jackson.databind.json.JsonMapper
6
6
import com.openai.azure.AzureOpenAIServiceVersion
7
- import com.openai.azure.AzureOpenAIServiceVersion.Companion.V2024_10_21
8
7
import com.openai.azure.credential.AzureApiKeyCredential
9
8
import com.openai.core.http.Headers
10
9
import com.openai.core.http.HttpClient
@@ -261,8 +260,10 @@ private constructor(
261
260
if (isAzureEndpoint(baseUrl)) {
262
261
// Default Azure OpenAI version is used if Azure user doesn't
263
262
// specific a service API version in 'queryParams'.
264
- // We can update the default value every major announcement if needed.
265
- replaceQueryParams(" api-version" , (azureServiceVersion ? : V2024_10_21 ).value)
263
+ replaceQueryParams(
264
+ " api-version" ,
265
+ (azureServiceVersion ? : AzureOpenAIServiceVersion .latestStableVersion()).value,
266
+ )
266
267
}
267
268
268
269
headers.replaceAll(this .headers.build())
You can’t perform that action at this time.
0 commit comments