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
88 private val values: ConcurrentHashMap <String , AzureOpenAIServiceVersion > =
99 ConcurrentHashMap ()
1010
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+
1123 @JvmStatic
1224 fun fromString (version : String ): AzureOpenAIServiceVersion =
1325 values.computeIfAbsent(version) { AzureOpenAIServiceVersion (version) }
Original file line number Diff line number Diff line change @@ -4,7 +4,6 @@ package com.openai.core
44
55import com.fasterxml.jackson.databind.json.JsonMapper
66import com.openai.azure.AzureOpenAIServiceVersion
7- import com.openai.azure.AzureOpenAIServiceVersion.Companion.V2024_10_21
87import com.openai.azure.credential.AzureApiKeyCredential
98import com.openai.core.http.Headers
109import com.openai.core.http.HttpClient
@@ -261,8 +260,10 @@ private constructor(
261260 if (isAzureEndpoint(baseUrl)) {
262261 // Default Azure OpenAI version is used if Azure user doesn't
263262 // 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+ )
266267 }
267268
268269 headers.replaceAll(this .headers.build())
You can’t perform that action at this time.
0 commit comments