Skip to content

feat(api): Add more new Azure service versions #208

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class AzureOpenAIServiceVersion private constructor(@get:JvmName("value") val va
@JvmStatic val V2023_05_15 = fromString("2023-05-15")
@JvmStatic val V2024_02_01 = fromString("2024-02-01")
@JvmStatic val V2024_06_01 = fromString("2024-06-01")
@JvmStatic val V2024_10_21 = fromString("2024-10-21")
@JvmStatic val V2023_06_01_PREVIEW = fromString("2023-06-01-preview")
@JvmStatic val V2023_07_01_PREVIEW = fromString("2023-07-01-preview")
@JvmStatic val V2024_02_15_PREVIEW = fromString("2024-02-15-preview")
Expand All @@ -25,6 +26,9 @@ class AzureOpenAIServiceVersion private constructor(@get:JvmName("value") val va
@JvmStatic val V2024_07_01_PREVIEW = fromString("2024-07-01-preview")
@JvmStatic val V2024_08_01_PREVIEW = fromString("2024-08-01-preview")
@JvmStatic val V2024_09_01_PREVIEW = fromString("2024-09-01-preview")
@JvmStatic val V2024_10_01_PREVIEW = fromString("2024-10-01-preview")
@JvmStatic val V2024_12_01_PREVIEW = fromString("2024-12-01-preview")
@JvmStatic val V2025_01_01_PREVIEW = fromString("2025-01-01-preview")
}

override fun equals(other: Any?): Boolean =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package com.openai.core

import com.fasterxml.jackson.databind.json.JsonMapper
import com.openai.azure.AzureOpenAIServiceVersion
import com.openai.azure.AzureOpenAIServiceVersion.Companion.V2024_06_01
import com.openai.azure.AzureOpenAIServiceVersion.Companion.V2024_10_21
import com.openai.azure.credential.AzureApiKeyCredential
import com.openai.core.http.Headers
import com.openai.core.http.HttpClient
Expand Down Expand Up @@ -262,7 +262,7 @@ private constructor(
// Default Azure OpenAI version is used if Azure user doesn't
// specific a service API version in 'queryParams'.
// We can update the default value every major announcement if needed.
replaceQueryParams("api-version", (azureServiceVersion ?: V2024_06_01).value)
replaceQueryParams("api-version", (azureServiceVersion ?: V2024_10_21).value)
}

headers.replaceAll(this.headers.build())
Expand Down