Skip to content

Commit db4059f

Browse files
committed
revert last commit with latest date changes
1 parent a44f235 commit db4059f

File tree

2 files changed

+1
-17
lines changed

2 files changed

+1
-17
lines changed

openai-java-core/src/main/kotlin/com/openai/azure/AzureOpenAIServiceVersion.kt

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,12 @@
11
package com.openai.azure
22

3-
import java.time.LocalDate
4-
import java.time.format.DateTimeFormatter
53
import java.util.concurrent.ConcurrentHashMap
64

75
class AzureOpenAIServiceVersion private constructor(@get:JvmName("value") val value: String) {
86

97
companion object {
108
private val values: ConcurrentHashMap<String, AzureOpenAIServiceVersion> =
119
ConcurrentHashMap()
12-
private val dateFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd")
13-
14-
private fun extractDate(version: String): LocalDate {
15-
return LocalDate.parse(version, dateFormatter)
16-
}
1710

1811
@JvmStatic
1912
fun latestStableVersion(): AzureOpenAIServiceVersion {
@@ -27,15 +20,6 @@ class AzureOpenAIServiceVersion private constructor(@get:JvmName("value") val va
2720
return V2025_01_01_PREVIEW
2821
}
2922

30-
@JvmStatic
31-
fun latestVersion(): AzureOpenAIServiceVersion {
32-
val stableVersion = latestStableVersion()
33-
val previewVersion = latestPreviewVersion()
34-
val stableDate = extractDate(stableVersion.value)
35-
val previewDate = extractDate(previewVersion.value.substring(0, 10))
36-
return if (stableDate.isAfter(previewDate)) stableVersion else previewVersion
37-
}
38-
3923
@JvmStatic
4024
fun fromString(version: String): AzureOpenAIServiceVersion =
4125
values.computeIfAbsent(version) { AzureOpenAIServiceVersion(version) }

openai-java-core/src/main/kotlin/com/openai/core/ClientOptions.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ private constructor(
262262
// specific a service API version in 'queryParams'.
263263
replaceQueryParams(
264264
"api-version",
265-
(azureServiceVersion ?: AzureOpenAIServiceVersion.latestVersion()).value,
265+
(azureServiceVersion ?: AzureOpenAIServiceVersion.latestStableVersion()).value
266266
)
267267
}
268268

0 commit comments

Comments
 (0)