diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 5f3ea9b2d..f3a9f0729 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.11.6" + ".": "0.11.7" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index d4b8e3c06..a2936cf33 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## 0.11.7 (2025-01-17) + +Full Changelog: [v0.11.6...v0.11.7](https://github.com/openai/openai-java/compare/v0.11.6...v0.11.7) + +### Chores + +* **internal:** upgrade kotlin compiler and gradle ([#132](https://github.com/openai/openai-java/issues/132)) ([61a0b0d](https://github.com/openai/openai-java/commit/61a0b0debfd50646fc9fe310b5decc2e891f48d0)) + + +### Documentation + +* add javadoc.io badge ([#135](https://github.com/openai/openai-java/issues/135)) ([e905ce5](https://github.com/openai/openai-java/commit/e905ce509aabe1b9db9519b6ff77a79fc95434e1)) +* add more documentation ([#134](https://github.com/openai/openai-java/issues/134)) ([893eafc](https://github.com/openai/openai-java/commit/893eafcb367b4ea96331c6deccb71c865eb67d4b)) + ## 0.11.6 (2025-01-17) Full Changelog: [v0.11.5...v0.11.6](https://github.com/openai/openai-java/compare/v0.11.5...v0.11.6) diff --git a/README.md b/README.md index 443cc8205..b6b7dac02 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,8 @@ -[![Maven Central](https://img.shields.io/maven-central/v/com.openai/openai-java)](https://central.sonatype.com/artifact/com.openai/openai-java/0.11.6) +[![Maven Central](https://img.shields.io/maven-central/v/com.openai/openai-java)](https://central.sonatype.com/artifact/com.openai/openai-java/0.11.7) +[![javadoc](https://javadoc.io/badge2/com.openai/openai-java/0.11.7/javadoc.svg)](https://javadoc.io/doc/com.openai/openai-java/0.11.6) @@ -30,7 +31,7 @@ The REST API documentation can be foundĀ on [platform.openai.com](https://platfo ```kotlin -implementation("com.openai:openai-java:0.11.6") +implementation("com.openai:openai-java:0.11.7") ``` #### Maven @@ -39,7 +40,7 @@ implementation("com.openai:openai-java:0.11.6") com.openai openai-java - 0.11.6 + 0.11.7 ``` diff --git a/build.gradle.kts b/build.gradle.kts index 071e5e97e..72277482d 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -8,7 +8,7 @@ repositories { allprojects { group = "com.openai" - version = "0.11.6" // x-release-please-version + version = "0.11.7" // x-release-please-version } subprojects { diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 493cb3275..8a1d7a102 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -1,6 +1,6 @@ plugins { `kotlin-dsl` - kotlin("jvm") version "1.9.22" + kotlin("jvm") version "2.1.0" id("com.vanniktech.maven.publish") version "0.28.0" } diff --git a/buildSrc/src/main/kotlin/openai.kotlin.gradle.kts b/buildSrc/src/main/kotlin/openai.kotlin.gradle.kts index b88c7af98..b5027a768 100644 --- a/buildSrc/src/main/kotlin/openai.kotlin.gradle.kts +++ b/buildSrc/src/main/kotlin/openai.kotlin.gradle.kts @@ -21,8 +21,12 @@ configure { tasks.withType().configureEach { kotlinOptions { - allWarningsAsErrors = true - freeCompilerArgs = listOf("-Xjvm-default=all", "-Xjdk-release=1.8") + freeCompilerArgs = listOf( + "-Xjvm-default=all", + "-Xjdk-release=1.8", + // Suppress deprecation warnings because we may still reference and test deprecated members. + "-Xsuppress-warning=DEPRECATION" + ) jvmTarget = "1.8" } } diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index e6441136f..a4b76b953 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index b82aa23a4..cea7a793a 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew index 1aa94a426..f3b75f3b0 100755 --- a/gradlew +++ b/gradlew @@ -15,6 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# SPDX-License-Identifier: Apache-2.0 +# ############################################################################## # @@ -55,7 +57,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -84,7 +86,7 @@ done # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) -APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum diff --git a/gradlew.bat b/gradlew.bat index 25da30dbd..9d21a2183 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -13,6 +13,8 @@ @rem See the License for the specific language governing permissions and @rem limitations under the License. @rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem @if "%DEBUG%"=="" @echo off @rem ########################################################################## diff --git a/openai-java-core/src/main/kotlin/com/openai/models/Annotation.kt b/openai-java-core/src/main/kotlin/com/openai/models/Annotation.kt index 866cc36ce..c88dd472d 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/Annotation.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/Annotation.kt @@ -140,8 +140,17 @@ private constructor( interface Visitor { + /** + * A citation within the message that points to a specific quote from a specific File + * associated with the assistant or the message. Generated when the assistant uses the + * "file_search" tool to search files. + */ fun visitFileCitationAnnotation(fileCitationAnnotation: FileCitationAnnotation): T + /** + * A URL for the file that's generated when the assistant used the `code_interpreter` tool + * to generate a file. + */ fun visitFilePathAnnotation(filePathAnnotation: FilePathAnnotation): T fun unknown(json: JsonValue?): T { diff --git a/openai-java-core/src/main/kotlin/com/openai/models/AnnotationDelta.kt b/openai-java-core/src/main/kotlin/com/openai/models/AnnotationDelta.kt index 0216f292a..76bfbfadd 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/AnnotationDelta.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/AnnotationDelta.kt @@ -146,10 +146,19 @@ private constructor( interface Visitor { + /** + * A citation within the message that points to a specific quote from a specific File + * associated with the assistant or the message. Generated when the assistant uses the + * "file_search" tool to search files. + */ fun visitFileCitationDeltaAnnotation( fileCitationDeltaAnnotation: FileCitationDeltaAnnotation ): T + /** + * A URL for the file that's generated when the assistant used the `code_interpreter` tool + * to generate a file. + */ fun visitFilePathDeltaAnnotation(filePathDeltaAnnotation: FilePathDeltaAnnotation): T fun unknown(json: JsonValue?): T { diff --git a/openai-java-core/src/main/kotlin/com/openai/models/Assistant.kt b/openai-java-core/src/main/kotlin/com/openai/models/Assistant.kt index aaa80bda8..887b00b0e 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/Assistant.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/Assistant.kt @@ -706,6 +706,7 @@ private constructor( ) } + /** The object type, which is always `assistant`. */ class Object @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/AssistantResponseFormatOption.kt b/openai-java-core/src/main/kotlin/com/openai/models/AssistantResponseFormatOption.kt index 2ebeca355..d692af323 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/AssistantResponseFormatOption.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/AssistantResponseFormatOption.kt @@ -171,6 +171,7 @@ private constructor( interface Visitor { + /** `auto` is the default value */ fun visitBehavior(behavior: Behavior): T fun visitResponseFormatText(responseFormatText: ResponseFormatText): T @@ -237,6 +238,7 @@ private constructor( } } + /** `auto` is the default value */ class Behavior @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/AssistantStreamEvent.kt b/openai-java-core/src/main/kotlin/com/openai/models/AssistantStreamEvent.kt index 0f8d35306..b6e603c0d 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/AssistantStreamEvent.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/AssistantStreamEvent.kt @@ -861,52 +861,152 @@ private constructor( interface Visitor { + /** + * Occurs when a new [thread](https://platform.openai.com/docs/api-reference/threads/object) + * is created. + */ fun visitThreadCreated(threadCreated: ThreadCreated): T + /** + * Occurs when a new [run](https://platform.openai.com/docs/api-reference/runs/object) is + * created. + */ fun visitThreadRunCreated(threadRunCreated: ThreadRunCreated): T + /** + * Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) moves to + * a `queued` status. + */ fun visitThreadRunQueued(threadRunQueued: ThreadRunQueued): T + /** + * Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) moves to + * an `in_progress` status. + */ fun visitThreadRunInProgress(threadRunInProgress: ThreadRunInProgress): T + /** + * Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) moves to + * a `requires_action` status. + */ fun visitThreadRunRequiresAction(threadRunRequiresAction: ThreadRunRequiresAction): T + /** + * Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) is + * completed. + */ fun visitThreadRunCompleted(threadRunCompleted: ThreadRunCompleted): T + /** + * Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) ends with + * status `incomplete`. + */ fun visitThreadRunIncomplete(threadRunIncomplete: ThreadRunIncomplete): T + /** + * Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) fails. + */ fun visitThreadRunFailed(threadRunFailed: ThreadRunFailed): T + /** + * Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) moves to + * a `cancelling` status. + */ fun visitThreadRunCancelling(threadRunCancelling: ThreadRunCancelling): T + /** + * Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) is + * cancelled. + */ fun visitThreadRunCancelled(threadRunCancelled: ThreadRunCancelled): T + /** + * Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) expires. + */ fun visitThreadRunExpired(threadRunExpired: ThreadRunExpired): T + /** + * Occurs when a + * [run step](https://platform.openai.com/docs/api-reference/run-steps/step-object) is + * created. + */ fun visitThreadRunStepCreated(threadRunStepCreated: ThreadRunStepCreated): T + /** + * Occurs when a + * [run step](https://platform.openai.com/docs/api-reference/run-steps/step-object) moves to + * an `in_progress` state. + */ fun visitThreadRunStepInProgress(threadRunStepInProgress: ThreadRunStepInProgress): T + /** + * Occurs when parts of a + * [run step](https://platform.openai.com/docs/api-reference/run-steps/step-object) are + * being streamed. + */ fun visitThreadRunStepDelta(threadRunStepDelta: ThreadRunStepDelta): T + /** + * Occurs when a + * [run step](https://platform.openai.com/docs/api-reference/run-steps/step-object) is + * completed. + */ fun visitThreadRunStepCompleted(threadRunStepCompleted: ThreadRunStepCompleted): T + /** + * Occurs when a + * [run step](https://platform.openai.com/docs/api-reference/run-steps/step-object) fails. + */ fun visitThreadRunStepFailed(threadRunStepFailed: ThreadRunStepFailed): T + /** + * Occurs when a + * [run step](https://platform.openai.com/docs/api-reference/run-steps/step-object) is + * cancelled. + */ fun visitThreadRunStepCancelled(threadRunStepCancelled: ThreadRunStepCancelled): T + /** + * Occurs when a + * [run step](https://platform.openai.com/docs/api-reference/run-steps/step-object) expires. + */ fun visitThreadRunStepExpired(threadRunStepExpired: ThreadRunStepExpired): T + /** + * Occurs when a [message](https://platform.openai.com/docs/api-reference/messages/object) + * is created. + */ fun visitThreadMessageCreated(threadMessageCreated: ThreadMessageCreated): T + /** + * Occurs when a [message](https://platform.openai.com/docs/api-reference/messages/object) + * moves to an `in_progress` state. + */ fun visitThreadMessageInProgress(threadMessageInProgress: ThreadMessageInProgress): T + /** + * Occurs when parts of a + * [Message](https://platform.openai.com/docs/api-reference/messages/object) are being + * streamed. + */ fun visitThreadMessageDelta(threadMessageDelta: ThreadMessageDelta): T + /** + * Occurs when a [message](https://platform.openai.com/docs/api-reference/messages/object) + * is completed. + */ fun visitThreadMessageCompleted(threadMessageCompleted: ThreadMessageCompleted): T + /** + * Occurs when a [message](https://platform.openai.com/docs/api-reference/messages/object) + * ends before it is completed. + */ fun visitThreadMessageIncomplete(threadMessageIncomplete: ThreadMessageIncomplete): T + /** + * Occurs when an [error](https://platform.openai.com/docs/guides/error-codes#api-errors) + * occurs. This can happen due to an internal server error or a timeout. + */ fun visitErrorEvent(errorEvent: ErrorEvent): T fun unknown(json: JsonValue?): T { diff --git a/openai-java-core/src/main/kotlin/com/openai/models/AssistantToolChoice.kt b/openai-java-core/src/main/kotlin/com/openai/models/AssistantToolChoice.kt index 19e5c2c98..e1bd147e3 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/AssistantToolChoice.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/AssistantToolChoice.kt @@ -119,6 +119,7 @@ private constructor( ) } + /** The type of the tool. If type is `function`, the function name must be set */ class Type @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/AssistantToolChoiceOption.kt b/openai-java-core/src/main/kotlin/com/openai/models/AssistantToolChoiceOption.kt index 4da49b265..c23765f4e 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/AssistantToolChoiceOption.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/AssistantToolChoiceOption.kt @@ -131,8 +131,16 @@ private constructor( interface Visitor { + /** + * `none` means the model will not call any tools and instead generates a message. `auto` + * means the model can pick between generating a message or calling one or more tools. + * `required` means the model must call one or more tools before responding to the user. + */ fun visitBehavior(behavior: Behavior): T + /** + * Specifies a tool the model should use. Use to force the model to call a specific tool. + */ fun visitAssistantToolChoice(assistantToolChoice: AssistantToolChoice): T fun unknown(json: JsonValue?): T { @@ -175,6 +183,11 @@ private constructor( } } + /** + * `none` means the model will not call any tools and instead generates a message. `auto` means + * the model can pick between generating a message or calling one or more tools. `required` + * means the model must call one or more tools before responding to the user. + */ class Behavior @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/AutoFileChunkingStrategyParam.kt b/openai-java-core/src/main/kotlin/com/openai/models/AutoFileChunkingStrategyParam.kt index 3fc9617b2..407ffc4b0 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/AutoFileChunkingStrategyParam.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/AutoFileChunkingStrategyParam.kt @@ -101,6 +101,7 @@ private constructor( ) } + /** Always `auto`. */ class Type @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/Batch.kt b/openai-java-core/src/main/kotlin/com/openai/models/Batch.kt index f8ec56caf..f592739b6 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/Batch.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/Batch.kt @@ -480,6 +480,7 @@ private constructor( ) } + /** The object type, which is always `batch`. */ class Object @JsonCreator private constructor( @@ -531,6 +532,7 @@ private constructor( override fun toString() = value.toString() } + /** The current status of the batch. */ class Status @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/BatchCreateParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/BatchCreateParams.kt index 17433e382..f5bb7b59b 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/BatchCreateParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/BatchCreateParams.kt @@ -551,6 +551,9 @@ constructor( ) } + /** + * The time frame within which the batch should be processed. Currently only `24h` is supported. + */ class CompletionWindow @JsonCreator private constructor( @@ -602,6 +605,11 @@ constructor( override fun toString() = value.toString() } + /** + * The endpoint to be used for all requests in the batch. Currently `/v1/chat/completions`, + * `/v1/embeddings`, and `/v1/completions` are supported. Note that `/v1/embeddings` batches are + * also restricted to a maximum of 50,000 embedding inputs across all requests in the batch. + */ class Endpoint @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/BatchListPage.kt b/openai-java-core/src/main/kotlin/com/openai/models/BatchListPage.kt index c2314395c..ea9f71808 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/BatchListPage.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/BatchListPage.kt @@ -19,6 +19,7 @@ import java.util.Optional import java.util.stream.Stream import java.util.stream.StreamSupport +/** List your organization's batches. */ class BatchListPage private constructor( private val batchesService: BatchService, diff --git a/openai-java-core/src/main/kotlin/com/openai/models/BatchListPageAsync.kt b/openai-java-core/src/main/kotlin/com/openai/models/BatchListPageAsync.kt index 5bd75e6bd..8f3e23ddd 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/BatchListPageAsync.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/BatchListPageAsync.kt @@ -20,6 +20,7 @@ import java.util.concurrent.CompletableFuture import java.util.concurrent.Executor import java.util.function.Predicate +/** List your organization's batches. */ class BatchListPageAsync private constructor( private val batchesService: BatchServiceAsync, diff --git a/openai-java-core/src/main/kotlin/com/openai/models/BetaAssistantListPage.kt b/openai-java-core/src/main/kotlin/com/openai/models/BetaAssistantListPage.kt index 1a4aad2c2..78e0f2509 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/BetaAssistantListPage.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/BetaAssistantListPage.kt @@ -19,6 +19,7 @@ import java.util.Optional import java.util.stream.Stream import java.util.stream.StreamSupport +/** Returns a list of assistants. */ class BetaAssistantListPage private constructor( private val assistantsService: AssistantService, diff --git a/openai-java-core/src/main/kotlin/com/openai/models/BetaAssistantListPageAsync.kt b/openai-java-core/src/main/kotlin/com/openai/models/BetaAssistantListPageAsync.kt index 12101b126..2b03ccbc5 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/BetaAssistantListPageAsync.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/BetaAssistantListPageAsync.kt @@ -20,6 +20,7 @@ import java.util.concurrent.CompletableFuture import java.util.concurrent.Executor import java.util.function.Predicate +/** Returns a list of assistants. */ class BetaAssistantListPageAsync private constructor( private val assistantsService: AssistantServiceAsync, diff --git a/openai-java-core/src/main/kotlin/com/openai/models/BetaAssistantListParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/BetaAssistantListParams.kt index 02d156050..7c335c467 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/BetaAssistantListParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/BetaAssistantListParams.kt @@ -265,6 +265,10 @@ constructor( ) } + /** + * Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` + * for descending order. + */ class Order @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/BetaThreadCreateAndRunParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/BetaThreadCreateAndRunParams.kt index 7abe85d99..ad6b25dd7 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/BetaThreadCreateAndRunParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/BetaThreadCreateAndRunParams.kt @@ -2468,8 +2468,15 @@ constructor( interface Visitor { + /** The text contents of the message. */ fun visitTextContent(textContent: String): T + /** + * An array of content parts with a defined type, each can be of type `text` or + * images can be passed with `image_url` or `image_file`. Image types are only + * supported on + * [Vision-compatible models](https://platform.openai.com/docs/models). + */ fun visitArrayOfContentParts( arrayOfContentParts: List ): T @@ -2516,6 +2523,13 @@ constructor( } } + /** + * The role of the entity that is creating the message. Allowed values include: + * - `user`: Indicates the message is sent by an actual user and should be used in most + * cases to represent user-generated messages. + * - `assistant`: Indicates the message is generated by the assistant. Use this value to + * insert messages from the assistant into the conversation. + */ class Role @JsonCreator private constructor( @@ -2933,6 +2947,7 @@ constructor( ) } + /** The type of tool being defined: `file_search` */ class Type @JsonCreator private constructor( @@ -4500,6 +4515,12 @@ constructor( ) } + /** + * The truncation strategy to use for the thread. The default is `auto`. If set to + * `last_messages`, the thread will be truncated to the n most recent messages in the + * thread. When set to `auto`, messages in the middle of the thread will be dropped to fit + * the context length of the model, `max_prompt_tokens`. + */ class Type @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/BetaThreadCreateParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/BetaThreadCreateParams.kt index d7526a05e..064cbc520 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/BetaThreadCreateParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/BetaThreadCreateParams.kt @@ -795,8 +795,14 @@ constructor( interface Visitor { + /** The text contents of the message. */ fun visitTextContent(textContent: String): T + /** + * An array of content parts with a defined type, each can be of type `text` or + * images can be passed with `image_url` or `image_file`. Image types are only + * supported on [Vision-compatible models](https://platform.openai.com/docs/models). + */ fun visitArrayOfContentParts(arrayOfContentParts: List): T fun unknown(json: JsonValue?): T { @@ -841,6 +847,13 @@ constructor( } } + /** + * The role of the entity that is creating the message. Allowed values include: + * - `user`: Indicates the message is sent by an actual user and should be used in most + * cases to represent user-generated messages. + * - `assistant`: Indicates the message is generated by the assistant. Use this value to + * insert messages from the assistant into the conversation. + */ class Role @JsonCreator private constructor( @@ -1252,6 +1265,7 @@ constructor( ) } + /** The type of tool being defined: `file_search` */ class Type @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/BetaThreadMessageCreateParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/BetaThreadMessageCreateParams.kt index 980e6b288..6a7edb67c 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/BetaThreadMessageCreateParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/BetaThreadMessageCreateParams.kt @@ -628,8 +628,14 @@ constructor( interface Visitor { + /** The text contents of the message. */ fun visitTextContent(textContent: String): T + /** + * An array of content parts with a defined type, each can be of type `text` or images + * can be passed with `image_url` or `image_file`. Image types are only supported on + * [Vision-compatible models](https://platform.openai.com/docs/models). + */ fun visitArrayOfContentParts(arrayOfContentParts: List): T fun unknown(json: JsonValue?): T { @@ -674,6 +680,13 @@ constructor( } } + /** + * The role of the entity that is creating the message. Allowed values include: + * - `user`: Indicates the message is sent by an actual user and should be used in most cases to + * represent user-generated messages. + * - `assistant`: Indicates the message is generated by the assistant. Use this value to insert + * messages from the assistant into the conversation. + */ class Role @JsonCreator private constructor( @@ -1076,6 +1089,7 @@ constructor( FileSearch(checkRequired("type", type), additionalProperties.toImmutable()) } + /** The type of tool being defined: `file_search` */ class Type @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/BetaThreadMessageListPage.kt b/openai-java-core/src/main/kotlin/com/openai/models/BetaThreadMessageListPage.kt index c84be5c32..055f74eed 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/BetaThreadMessageListPage.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/BetaThreadMessageListPage.kt @@ -19,6 +19,7 @@ import java.util.Optional import java.util.stream.Stream import java.util.stream.StreamSupport +/** Returns a list of messages for a given thread. */ class BetaThreadMessageListPage private constructor( private val messagesService: MessageService, diff --git a/openai-java-core/src/main/kotlin/com/openai/models/BetaThreadMessageListPageAsync.kt b/openai-java-core/src/main/kotlin/com/openai/models/BetaThreadMessageListPageAsync.kt index 4654ce979..7e25db964 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/BetaThreadMessageListPageAsync.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/BetaThreadMessageListPageAsync.kt @@ -20,6 +20,7 @@ import java.util.concurrent.CompletableFuture import java.util.concurrent.Executor import java.util.function.Predicate +/** Returns a list of messages for a given thread. */ class BetaThreadMessageListPageAsync private constructor( private val messagesService: MessageServiceAsync, diff --git a/openai-java-core/src/main/kotlin/com/openai/models/BetaThreadMessageListParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/BetaThreadMessageListParams.kt index 1afc7b1bf..80becd751 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/BetaThreadMessageListParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/BetaThreadMessageListParams.kt @@ -295,6 +295,10 @@ constructor( ) } + /** + * Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` + * for descending order. + */ class Order @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/BetaThreadRunCreateParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/BetaThreadRunCreateParams.kt index 95bc3edc4..d0d607ef0 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/BetaThreadRunCreateParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/BetaThreadRunCreateParams.kt @@ -2380,8 +2380,14 @@ constructor( interface Visitor { + /** The text contents of the message. */ fun visitTextContent(textContent: String): T + /** + * An array of content parts with a defined type, each can be of type `text` or + * images can be passed with `image_url` or `image_file`. Image types are only + * supported on [Vision-compatible models](https://platform.openai.com/docs/models). + */ fun visitArrayOfContentParts(arrayOfContentParts: List): T fun unknown(json: JsonValue?): T { @@ -2426,6 +2432,13 @@ constructor( } } + /** + * The role of the entity that is creating the message. Allowed values include: + * - `user`: Indicates the message is sent by an actual user and should be used in most + * cases to represent user-generated messages. + * - `assistant`: Indicates the message is generated by the assistant. Use this value to + * insert messages from the assistant into the conversation. + */ class Role @JsonCreator private constructor( @@ -2837,6 +2850,7 @@ constructor( ) } + /** The type of tool being defined: `file_search` */ class Type @JsonCreator private constructor( @@ -3098,6 +3112,12 @@ constructor( ) } + /** + * The truncation strategy to use for the thread. The default is `auto`. If set to + * `last_messages`, the thread will be truncated to the n most recent messages in the + * thread. When set to `auto`, messages in the middle of the thread will be dropped to fit + * the context length of the model, `max_prompt_tokens`. + */ class Type @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/BetaThreadRunListPage.kt b/openai-java-core/src/main/kotlin/com/openai/models/BetaThreadRunListPage.kt index 36f7bdd01..8b0b72ee6 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/BetaThreadRunListPage.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/BetaThreadRunListPage.kt @@ -19,6 +19,7 @@ import java.util.Optional import java.util.stream.Stream import java.util.stream.StreamSupport +/** Returns a list of runs belonging to a thread. */ class BetaThreadRunListPage private constructor( private val runsService: RunService, diff --git a/openai-java-core/src/main/kotlin/com/openai/models/BetaThreadRunListPageAsync.kt b/openai-java-core/src/main/kotlin/com/openai/models/BetaThreadRunListPageAsync.kt index 72860819d..909c15919 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/BetaThreadRunListPageAsync.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/BetaThreadRunListPageAsync.kt @@ -20,6 +20,7 @@ import java.util.concurrent.CompletableFuture import java.util.concurrent.Executor import java.util.function.Predicate +/** Returns a list of runs belonging to a thread. */ class BetaThreadRunListPageAsync private constructor( private val runsService: RunServiceAsync, diff --git a/openai-java-core/src/main/kotlin/com/openai/models/BetaThreadRunListParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/BetaThreadRunListParams.kt index b5c58e491..211553e35 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/BetaThreadRunListParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/BetaThreadRunListParams.kt @@ -281,6 +281,10 @@ constructor( ) } + /** + * Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` + * for descending order. + */ class Order @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/BetaThreadRunStepListPage.kt b/openai-java-core/src/main/kotlin/com/openai/models/BetaThreadRunStepListPage.kt index 73231a74a..6e74a01e1 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/BetaThreadRunStepListPage.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/BetaThreadRunStepListPage.kt @@ -19,6 +19,7 @@ import java.util.Optional import java.util.stream.Stream import java.util.stream.StreamSupport +/** Returns a list of run steps belonging to a run. */ class BetaThreadRunStepListPage private constructor( private val stepsService: StepService, diff --git a/openai-java-core/src/main/kotlin/com/openai/models/BetaThreadRunStepListPageAsync.kt b/openai-java-core/src/main/kotlin/com/openai/models/BetaThreadRunStepListPageAsync.kt index 3636c07b4..4ad5c9bdb 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/BetaThreadRunStepListPageAsync.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/BetaThreadRunStepListPageAsync.kt @@ -20,6 +20,7 @@ import java.util.concurrent.CompletableFuture import java.util.concurrent.Executor import java.util.function.Predicate +/** Returns a list of run steps belonging to a run. */ class BetaThreadRunStepListPageAsync private constructor( private val stepsService: StepServiceAsync, diff --git a/openai-java-core/src/main/kotlin/com/openai/models/BetaThreadRunStepListParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/BetaThreadRunStepListParams.kt index 9c7d1d6e8..3645c632e 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/BetaThreadRunStepListParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/BetaThreadRunStepListParams.kt @@ -344,6 +344,10 @@ constructor( ) } + /** + * Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` + * for descending order. + */ class Order @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/BetaVectorStoreCreateParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/BetaVectorStoreCreateParams.kt index 891476a8d..b048ee157 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/BetaVectorStoreCreateParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/BetaVectorStoreCreateParams.kt @@ -668,6 +668,10 @@ constructor( ) } + /** + * Anchor timestamp after which the expiration policy applies. Supported anchors: + * `last_active_at`. + */ class Anchor @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/BetaVectorStoreFileBatchListFilesPage.kt b/openai-java-core/src/main/kotlin/com/openai/models/BetaVectorStoreFileBatchListFilesPage.kt index 8ca5da2a7..3bf2a22e3 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/BetaVectorStoreFileBatchListFilesPage.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/BetaVectorStoreFileBatchListFilesPage.kt @@ -19,6 +19,7 @@ import java.util.Optional import java.util.stream.Stream import java.util.stream.StreamSupport +/** Returns a list of vector store files in a batch. */ class BetaVectorStoreFileBatchListFilesPage private constructor( private val fileBatchesService: FileBatchService, diff --git a/openai-java-core/src/main/kotlin/com/openai/models/BetaVectorStoreFileBatchListFilesPageAsync.kt b/openai-java-core/src/main/kotlin/com/openai/models/BetaVectorStoreFileBatchListFilesPageAsync.kt index 375d03afd..b0b612e1a 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/BetaVectorStoreFileBatchListFilesPageAsync.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/BetaVectorStoreFileBatchListFilesPageAsync.kt @@ -20,6 +20,7 @@ import java.util.concurrent.CompletableFuture import java.util.concurrent.Executor import java.util.function.Predicate +/** Returns a list of vector store files in a batch. */ class BetaVectorStoreFileBatchListFilesPageAsync private constructor( private val fileBatchesService: FileBatchServiceAsync, diff --git a/openai-java-core/src/main/kotlin/com/openai/models/BetaVectorStoreFileBatchListFilesParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/BetaVectorStoreFileBatchListFilesParams.kt index 426fbbcc2..79f9d2bf9 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/BetaVectorStoreFileBatchListFilesParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/BetaVectorStoreFileBatchListFilesParams.kt @@ -308,6 +308,7 @@ constructor( ) } + /** Filter by file status. One of `in_progress`, `completed`, `failed`, `cancelled`. */ class Filter @JsonCreator private constructor( @@ -377,6 +378,10 @@ constructor( override fun toString() = value.toString() } + /** + * Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` + * for descending order. + */ class Order @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/BetaVectorStoreFileListPage.kt b/openai-java-core/src/main/kotlin/com/openai/models/BetaVectorStoreFileListPage.kt index fa0a782ac..8a358bb70 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/BetaVectorStoreFileListPage.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/BetaVectorStoreFileListPage.kt @@ -19,6 +19,7 @@ import java.util.Optional import java.util.stream.Stream import java.util.stream.StreamSupport +/** Returns a list of vector store files. */ class BetaVectorStoreFileListPage private constructor( private val filesService: FileService, diff --git a/openai-java-core/src/main/kotlin/com/openai/models/BetaVectorStoreFileListPageAsync.kt b/openai-java-core/src/main/kotlin/com/openai/models/BetaVectorStoreFileListPageAsync.kt index db0150d62..630782551 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/BetaVectorStoreFileListPageAsync.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/BetaVectorStoreFileListPageAsync.kt @@ -20,6 +20,7 @@ import java.util.concurrent.CompletableFuture import java.util.concurrent.Executor import java.util.function.Predicate +/** Returns a list of vector store files. */ class BetaVectorStoreFileListPageAsync private constructor( private val filesService: FileServiceAsync, diff --git a/openai-java-core/src/main/kotlin/com/openai/models/BetaVectorStoreFileListParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/BetaVectorStoreFileListParams.kt index b392f5297..996bf87ca 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/BetaVectorStoreFileListParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/BetaVectorStoreFileListParams.kt @@ -295,6 +295,7 @@ constructor( ) } + /** Filter by file status. One of `in_progress`, `completed`, `failed`, `cancelled`. */ class Filter @JsonCreator private constructor( @@ -364,6 +365,10 @@ constructor( override fun toString() = value.toString() } + /** + * Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` + * for descending order. + */ class Order @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/BetaVectorStoreListPage.kt b/openai-java-core/src/main/kotlin/com/openai/models/BetaVectorStoreListPage.kt index c5aabc38d..fee0db39f 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/BetaVectorStoreListPage.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/BetaVectorStoreListPage.kt @@ -19,6 +19,7 @@ import java.util.Optional import java.util.stream.Stream import java.util.stream.StreamSupport +/** Returns a list of vector stores. */ class BetaVectorStoreListPage private constructor( private val vectorStoresService: VectorStoreService, diff --git a/openai-java-core/src/main/kotlin/com/openai/models/BetaVectorStoreListPageAsync.kt b/openai-java-core/src/main/kotlin/com/openai/models/BetaVectorStoreListPageAsync.kt index 3015b61af..b029a8b7e 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/BetaVectorStoreListPageAsync.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/BetaVectorStoreListPageAsync.kt @@ -20,6 +20,7 @@ import java.util.concurrent.CompletableFuture import java.util.concurrent.Executor import java.util.function.Predicate +/** Returns a list of vector stores. */ class BetaVectorStoreListPageAsync private constructor( private val vectorStoresService: VectorStoreServiceAsync, diff --git a/openai-java-core/src/main/kotlin/com/openai/models/BetaVectorStoreListParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/BetaVectorStoreListParams.kt index 2918d6b23..1f6feda96 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/BetaVectorStoreListParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/BetaVectorStoreListParams.kt @@ -265,6 +265,10 @@ constructor( ) } + /** + * Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` + * for descending order. + */ class Order @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/BetaVectorStoreUpdateParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/BetaVectorStoreUpdateParams.kt index d4f9bad0c..f2cd9c16f 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/BetaVectorStoreUpdateParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/BetaVectorStoreUpdateParams.kt @@ -513,6 +513,10 @@ constructor( ) } + /** + * Anchor timestamp after which the expiration policy applies. Supported anchors: + * `last_active_at`. + */ class Anchor @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletion.kt b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletion.kt index fe32cdad7..c922018bb 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletion.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletion.kt @@ -469,6 +469,13 @@ private constructor( ) } + /** + * The reason the model stopped generating tokens. This will be `stop` if the model hit a + * natural stop point or a provided stop sequence, `length` if the maximum number of tokens + * specified in the request was reached, `content_filter` if content was omitted due to a + * flag from our content filters, `tool_calls` if the model called a tool, or + * `function_call` (deprecated) if the model called a function. + */ class FinishReason @JsonCreator private constructor( @@ -733,6 +740,7 @@ private constructor( "Choice{finishReason=$finishReason, index=$index, logprobs=$logprobs, message=$message, additionalProperties=$additionalProperties}" } + /** The object type, which is always `chat.completion`. */ class Object @JsonCreator private constructor( @@ -784,6 +792,10 @@ private constructor( override fun toString() = value.toString() } + /** + * The service tier used for processing the request. This field is only included if the + * `service_tier` parameter is specified in the request. + */ class ServiceTier @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionAssistantMessageParam.kt b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionAssistantMessageParam.kt index 37261d5b6..3898db162 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionAssistantMessageParam.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionAssistantMessageParam.kt @@ -72,6 +72,7 @@ private constructor( * Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be * called, as generated by the model. */ + @Deprecated("deprecated") fun functionCall(): Optional = Optional.ofNullable(functionCall.getNullable("function_call")) @@ -107,6 +108,7 @@ private constructor( * Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be * called, as generated by the model. */ + @Deprecated("deprecated") @JsonProperty("function_call") @ExcludeMissing fun _functionCall(): JsonField = functionCall @@ -236,6 +238,7 @@ private constructor( * Deprecated and replaced by `tool_calls`. The name and arguments of a function that should * be called, as generated by the model. */ + @Deprecated("deprecated") fun functionCall(functionCall: FunctionCall?) = functionCall(JsonField.ofNullable(functionCall)) @@ -243,6 +246,7 @@ private constructor( * Deprecated and replaced by `tool_calls`. The name and arguments of a function that should * be called, as generated by the model. */ + @Deprecated("deprecated") fun functionCall(functionCall: Optional) = functionCall(functionCall.orElse(null)) @@ -250,6 +254,7 @@ private constructor( * Deprecated and replaced by `tool_calls`. The name and arguments of a function that should * be called, as generated by the model. */ + @Deprecated("deprecated") fun functionCall(functionCall: JsonField) = apply { this.functionCall = functionCall } @@ -330,6 +335,7 @@ private constructor( ) } + /** The role of the messages author, in this case `assistant`. */ class Role @JsonCreator private constructor( @@ -583,8 +589,13 @@ private constructor( interface Visitor { + /** The contents of the assistant message. */ fun visitTextContent(textContent: String): T + /** + * An array of content parts with a defined type. Can be one or more of type `text`, or + * exactly one of type `refusal`. + */ fun visitArrayOfContentParts( arrayOfContentParts: List ): T @@ -756,6 +767,10 @@ private constructor( interface Visitor { + /** + * Learn about + * [text inputs](https://platform.openai.com/docs/guides/text-generation). + */ fun visitChatCompletionContentPartText( chatCompletionContentPartText: ChatCompletionContentPartText ): T @@ -844,6 +859,7 @@ private constructor( * Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be * called, as generated by the model. */ + @Deprecated("deprecated") @NoAutoDetect class FunctionCall @JsonCreator diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionAudioParam.kt b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionAudioParam.kt index d8352f4dc..1c511e4eb 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionAudioParam.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionAudioParam.kt @@ -146,6 +146,9 @@ private constructor( ) } + /** + * Specifies the output audio format. Must be one of `wav`, `mp3`, `flac`, `opus`, or `pcm16`. + */ class Format @JsonCreator private constructor( @@ -221,6 +224,11 @@ private constructor( override fun toString() = value.toString() } + /** + * The voice the model uses to respond. Supported voices are `ash`, `ballad`, `coral`, `sage`, + * and `verse` (also supported but not recommended are `alloy`, `echo`, and `shimmer`; these + * voices are less expressive). + */ class Voice @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionChunk.kt b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionChunk.kt index aee2da499..8d1945aa2 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionChunk.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionChunk.kt @@ -562,6 +562,7 @@ private constructor( * Deprecated and replaced by `tool_calls`. The name and arguments of a function that * should be called, as generated by the model. */ + @Deprecated("deprecated") fun functionCall(): Optional = Optional.ofNullable(functionCall.getNullable("function_call")) @@ -581,6 +582,7 @@ private constructor( * Deprecated and replaced by `tool_calls`. The name and arguments of a function that * should be called, as generated by the model. */ + @Deprecated("deprecated") @JsonProperty("function_call") @ExcludeMissing fun _functionCall(): JsonField = functionCall @@ -653,6 +655,7 @@ private constructor( * Deprecated and replaced by `tool_calls`. The name and arguments of a function * that should be called, as generated by the model. */ + @Deprecated("deprecated") fun functionCall(functionCall: FunctionCall) = functionCall(JsonField.of(functionCall)) @@ -660,6 +663,7 @@ private constructor( * Deprecated and replaced by `tool_calls`. The name and arguments of a function * that should be called, as generated by the model. */ + @Deprecated("deprecated") fun functionCall(functionCall: JsonField) = apply { this.functionCall = functionCall } @@ -735,6 +739,7 @@ private constructor( * Deprecated and replaced by `tool_calls`. The name and arguments of a function that * should be called, as generated by the model. */ + @Deprecated("deprecated") @NoAutoDetect class FunctionCall @JsonCreator @@ -882,6 +887,7 @@ private constructor( "FunctionCall{arguments=$arguments, name=$name, additionalProperties=$additionalProperties}" } + /** The role of the author of this message. */ class Role @JsonCreator private constructor( @@ -1236,6 +1242,7 @@ private constructor( "Function{arguments=$arguments, name=$name, additionalProperties=$additionalProperties}" } + /** The type of the tool. Currently, only `function` is supported. */ class Type @JsonCreator private constructor( @@ -1324,6 +1331,13 @@ private constructor( "Delta{content=$content, functionCall=$functionCall, refusal=$refusal, role=$role, toolCalls=$toolCalls, additionalProperties=$additionalProperties}" } + /** + * The reason the model stopped generating tokens. This will be `stop` if the model hit a + * natural stop point or a provided stop sequence, `length` if the maximum number of tokens + * specified in the request was reached, `content_filter` if content was omitted due to a + * flag from our content filters, `tool_calls` if the model called a tool, or + * `function_call` (deprecated) if the model called a function. + */ class FinishReason @JsonCreator private constructor( @@ -1588,6 +1602,7 @@ private constructor( "Choice{delta=$delta, finishReason=$finishReason, index=$index, logprobs=$logprobs, additionalProperties=$additionalProperties}" } + /** The object type, which is always `chat.completion.chunk`. */ class Object @JsonCreator private constructor( @@ -1639,6 +1654,10 @@ private constructor( override fun toString() = value.toString() } + /** + * The service tier used for processing the request. This field is only included if the + * `service_tier` parameter is specified in the request. + */ class ServiceTier @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionContentPart.kt b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionContentPart.kt index 45340bbba..2bcc088a5 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionContentPart.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionContentPart.kt @@ -158,14 +158,17 @@ private constructor( interface Visitor { + /** Learn about [text inputs](https://platform.openai.com/docs/guides/text-generation). */ fun visitChatCompletionContentPartText( chatCompletionContentPartText: ChatCompletionContentPartText ): T + /** Learn about [image inputs](https://platform.openai.com/docs/guides/vision). */ fun visitChatCompletionContentPartImage( chatCompletionContentPartImage: ChatCompletionContentPartImage ): T + /** Learn about [audio inputs](https://platform.openai.com/docs/guides/audio). */ fun visitChatCompletionContentPartInputAudio( chatCompletionContentPartInputAudio: ChatCompletionContentPartInputAudio ): T diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionContentPartImage.kt b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionContentPartImage.kt index baa3e3fef..34af5e469 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionContentPartImage.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionContentPartImage.kt @@ -226,6 +226,10 @@ private constructor( ) } + /** + * Specifies the detail level of the image. Learn more in the + * [Vision guide](https://platform.openai.com/docs/guides/vision#low-or-high-fidelity-image-understanding). + */ class Detail @JsonCreator private constructor( @@ -307,6 +311,7 @@ private constructor( "ImageUrl{url=$url, detail=$detail, additionalProperties=$additionalProperties}" } + /** The type of the content part. */ class Type @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionContentPartInputAudio.kt b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionContentPartInputAudio.kt index a5259d2d7..ae7ea1e6d 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionContentPartInputAudio.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionContentPartInputAudio.kt @@ -219,6 +219,7 @@ private constructor( ) } + /** The format of the encoded audio data. Currently supports "wav" and "mp3". */ class Format @JsonCreator private constructor( @@ -294,6 +295,7 @@ private constructor( "InputAudio{data=$data, format=$format, additionalProperties=$additionalProperties}" } + /** The type of the content part. Always `input_audio`. */ class Type @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionContentPartRefusal.kt b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionContentPartRefusal.kt index 286ba4e27..1994bb042 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionContentPartRefusal.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionContentPartRefusal.kt @@ -118,6 +118,7 @@ private constructor( ) } + /** The type of the content part. */ class Type @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionContentPartText.kt b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionContentPartText.kt index 7a18c16d8..88185414e 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionContentPartText.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionContentPartText.kt @@ -115,6 +115,7 @@ private constructor( ) } + /** The type of the content part. */ class Type @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionCreateParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionCreateParams.kt index 7086e3d42..361895dd3 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionCreateParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionCreateParams.kt @@ -94,14 +94,14 @@ constructor( * `none` is the default when no functions are present. `auto` is the default if functions are * present. */ - fun functionCall(): Optional = body.functionCall() + @Deprecated("deprecated") fun functionCall(): Optional = body.functionCall() /** * Deprecated in favor of `tools`. * * A list of functions the model may generate JSON inputs for. */ - fun functions(): Optional> = body.functions() + @Deprecated("deprecated") fun functions(): Optional> = body.functions() /** * Modify the likelihood of specified tokens appearing in the completion. @@ -135,7 +135,7 @@ constructor( * This value is now deprecated in favor of `max_completion_tokens`, and is not compatible with * [o1 series models](https://platform.openai.com/docs/guides/reasoning). */ - fun maxTokens(): Optional = body.maxTokens() + @Deprecated("deprecated") fun maxTokens(): Optional = body.maxTokens() /** * Developer-defined tags and values used for filtering completions in the @@ -341,14 +341,14 @@ constructor( * `none` is the default when no functions are present. `auto` is the default if functions are * present. */ - fun _functionCall(): JsonField = body._functionCall() + @Deprecated("deprecated") fun _functionCall(): JsonField = body._functionCall() /** * Deprecated in favor of `tools`. * * A list of functions the model may generate JSON inputs for. */ - fun _functions(): JsonField> = body._functions() + @Deprecated("deprecated") fun _functions(): JsonField> = body._functions() /** * Modify the likelihood of specified tokens appearing in the completion. @@ -382,7 +382,7 @@ constructor( * This value is now deprecated in favor of `max_completion_tokens`, and is not compatible with * [o1 series models](https://platform.openai.com/docs/guides/reasoning). */ - fun _maxTokens(): JsonField = body._maxTokens() + @Deprecated("deprecated") fun _maxTokens(): JsonField = body._maxTokens() /** * Developer-defined tags and values used for filtering completions in the @@ -691,6 +691,7 @@ constructor( * `none` is the default when no functions are present. `auto` is the default if functions * are present. */ + @Deprecated("deprecated") fun functionCall(): Optional = Optional.ofNullable(functionCall.getNullable("function_call")) @@ -699,6 +700,7 @@ constructor( * * A list of functions the model may generate JSON inputs for. */ + @Deprecated("deprecated") fun functions(): Optional> = Optional.ofNullable(functions.getNullable("functions")) @@ -736,6 +738,7 @@ constructor( * This value is now deprecated in favor of `max_completion_tokens`, and is not compatible * with [o1 series models](https://platform.openai.com/docs/guides/reasoning). */ + @Deprecated("deprecated") fun maxTokens(): Optional = Optional.ofNullable(maxTokens.getNullable("max_tokens")) /** @@ -962,6 +965,7 @@ constructor( * `none` is the default when no functions are present. `auto` is the default if functions * are present. */ + @Deprecated("deprecated") @JsonProperty("function_call") @ExcludeMissing fun _functionCall(): JsonField = functionCall @@ -971,6 +975,7 @@ constructor( * * A list of functions the model may generate JSON inputs for. */ + @Deprecated("deprecated") @JsonProperty("functions") @ExcludeMissing fun _functions(): JsonField> = functions @@ -1011,7 +1016,10 @@ constructor( * This value is now deprecated in favor of `max_completion_tokens`, and is not compatible * with [o1 series models](https://platform.openai.com/docs/guides/reasoning). */ - @JsonProperty("max_tokens") @ExcludeMissing fun _maxTokens(): JsonField = maxTokens + @Deprecated("deprecated") + @JsonProperty("max_tokens") + @ExcludeMissing + fun _maxTokens(): JsonField = maxTokens /** * Developer-defined tags and values used for filtering completions in the @@ -1428,6 +1436,7 @@ constructor( * [images](https://platform.openai.com/docs/guides/vision), and * [audio](https://platform.openai.com/docs/guides/audio). */ + @Deprecated("deprecated") fun addMessage(chatCompletionFunctionMessageParam: ChatCompletionFunctionMessageParam) = addMessage( ChatCompletionMessageParam.ofChatCompletionFunctionMessageParam( @@ -1523,6 +1532,7 @@ constructor( * `none` is the default when no functions are present. `auto` is the default if * functions are present. */ + @Deprecated("deprecated") fun functionCall(functionCall: FunctionCall) = functionCall(JsonField.of(functionCall)) /** @@ -1540,6 +1550,7 @@ constructor( * `none` is the default when no functions are present. `auto` is the default if * functions are present. */ + @Deprecated("deprecated") fun functionCall(functionCall: JsonField) = apply { this.functionCall = functionCall } @@ -1563,6 +1574,7 @@ constructor( * * A list of functions the model may generate JSON inputs for. */ + @Deprecated("deprecated") fun functions(functions: List) = functions(JsonField.of(functions)) /** @@ -1570,6 +1582,7 @@ constructor( * * A list of functions the model may generate JSON inputs for. */ + @Deprecated("deprecated") fun functions(functions: JsonField>) = apply { this.functions = functions.map { it.toMutableList() } } @@ -1579,6 +1592,7 @@ constructor( * * A list of functions the model may generate JSON inputs for. */ + @Deprecated("deprecated") fun addFunction(function: Function) = apply { functions = (functions ?: JsonField.of(mutableListOf())).apply { @@ -1696,6 +1710,7 @@ constructor( * compatible with * [o1 series models](https://platform.openai.com/docs/guides/reasoning). */ + @Deprecated("deprecated") fun maxTokens(maxTokens: Long?) = maxTokens(JsonField.ofNullable(maxTokens)) /** @@ -1707,7 +1722,7 @@ constructor( * compatible with * [o1 series models](https://platform.openai.com/docs/guides/reasoning). */ - fun maxTokens(maxTokens: Long) = maxTokens(maxTokens as Long?) + @Deprecated("deprecated") fun maxTokens(maxTokens: Long) = maxTokens(maxTokens as Long?) /** * The maximum number of [tokens](/tokenizer) that can be generated in the chat @@ -1718,6 +1733,7 @@ constructor( * compatible with * [o1 series models](https://platform.openai.com/docs/guides/reasoning). */ + @Deprecated("deprecated") @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun maxTokens(maxTokens: Optional) = maxTokens(maxTokens.orElse(null) as Long?) @@ -1730,6 +1746,7 @@ constructor( * compatible with * [o1 series models](https://platform.openai.com/docs/guides/reasoning). */ + @Deprecated("deprecated") fun maxTokens(maxTokens: JsonField) = apply { this.maxTokens = maxTokens } /** @@ -2561,6 +2578,7 @@ constructor( * [images](https://platform.openai.com/docs/guides/vision), and * [audio](https://platform.openai.com/docs/guides/audio). */ + @Deprecated("deprecated") fun addMessage(chatCompletionFunctionMessageParam: ChatCompletionFunctionMessageParam) = apply { body.addMessage(chatCompletionFunctionMessageParam) @@ -2655,6 +2673,7 @@ constructor( * `none` is the default when no functions are present. `auto` is the default if functions * are present. */ + @Deprecated("deprecated") fun functionCall(functionCall: FunctionCall) = apply { body.functionCall(functionCall) } /** @@ -2672,6 +2691,7 @@ constructor( * `none` is the default when no functions are present. `auto` is the default if functions * are present. */ + @Deprecated("deprecated") fun functionCall(functionCall: JsonField) = apply { body.functionCall(functionCall) } @@ -2695,6 +2715,7 @@ constructor( * * A list of functions the model may generate JSON inputs for. */ + @Deprecated("deprecated") fun functions(functions: List) = apply { body.functions(functions) } /** @@ -2702,6 +2723,7 @@ constructor( * * A list of functions the model may generate JSON inputs for. */ + @Deprecated("deprecated") fun functions(functions: JsonField>) = apply { body.functions(functions) } /** @@ -2709,6 +2731,7 @@ constructor( * * A list of functions the model may generate JSON inputs for. */ + @Deprecated("deprecated") fun addFunction(function: Function) = apply { body.addFunction(function) } /** @@ -2812,6 +2835,7 @@ constructor( * This value is now deprecated in favor of `max_completion_tokens`, and is not compatible * with [o1 series models](https://platform.openai.com/docs/guides/reasoning). */ + @Deprecated("deprecated") fun maxTokens(maxTokens: Long?) = apply { body.maxTokens(maxTokens) } /** @@ -2822,7 +2846,7 @@ constructor( * This value is now deprecated in favor of `max_completion_tokens`, and is not compatible * with [o1 series models](https://platform.openai.com/docs/guides/reasoning). */ - fun maxTokens(maxTokens: Long) = maxTokens(maxTokens as Long?) + @Deprecated("deprecated") fun maxTokens(maxTokens: Long) = maxTokens(maxTokens as Long?) /** * The maximum number of [tokens](/tokenizer) that can be generated in the chat completion. @@ -2832,6 +2856,7 @@ constructor( * This value is now deprecated in favor of `max_completion_tokens`, and is not compatible * with [o1 series models](https://platform.openai.com/docs/guides/reasoning). */ + @Deprecated("deprecated") @Suppress("USELESS_CAST") // See https://youtrack.jetbrains.com/issue/KT-74228 fun maxTokens(maxTokens: Optional) = maxTokens(maxTokens.orElse(null) as Long?) @@ -2843,6 +2868,7 @@ constructor( * This value is now deprecated in favor of `max_completion_tokens`, and is not compatible * with [o1 series models](https://platform.openai.com/docs/guides/reasoning). */ + @Deprecated("deprecated") fun maxTokens(maxTokens: JsonField) = apply { body.maxTokens(maxTokens) } /** @@ -3608,6 +3634,7 @@ constructor( * `none` is the default when no functions are present. `auto` is the default if functions are * present. */ + @Deprecated("deprecated") @JsonDeserialize(using = FunctionCall.Deserializer::class) @JsonSerialize(using = FunctionCall.Serializer::class) class FunctionCall @@ -3715,8 +3742,16 @@ constructor( interface Visitor { + /** + * `none` means the model will not call a function and instead generates a message. + * `auto` means the model can pick between generating a message or calling a function. + */ fun visitBehavior(behavior: Behavior): T + /** + * Specifying a particular function via `{"name": "my_function"}` forces the model to + * call that function. + */ fun visitFunctionCallOption(functionCallOption: ChatCompletionFunctionCallOption): T fun unknown(json: JsonValue?): T { @@ -3760,6 +3795,10 @@ constructor( } } + /** + * `none` means the model will not call a function and instead generates a message. `auto` + * means the model can pick between generating a message or calling a function. + */ class Behavior @JsonCreator private constructor( @@ -3818,6 +3857,7 @@ constructor( } } + @Deprecated("deprecated") @NoAutoDetect class Function @JsonCreator @@ -4371,6 +4411,19 @@ constructor( } } + /** + * Specifies the latency tier to use for processing the request. This parameter is relevant for + * customers subscribed to the scale tier service: + * - If set to 'auto', and the Project is Scale tier enabled, the system will utilize scale tier + * credits until they are exhausted. + * - If set to 'auto', and the Project is not Scale tier enabled, the request will be processed + * using the default service tier with a lower uptime SLA and no latency guarentee. + * - If set to 'default', the request will be processed using the default service tier with a + * lower uptime SLA and no latency guarentee. + * - When not set, the default behavior is 'auto'. + * + * When this parameter is set, the response body will include the `service_tier` utilized. + */ class ServiceTier @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionDeveloperMessageParam.kt b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionDeveloperMessageParam.kt index f2e29c047..da36a6ac5 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionDeveloperMessageParam.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionDeveloperMessageParam.kt @@ -272,8 +272,13 @@ private constructor( interface Visitor { + /** The contents of the developer message. */ fun visitTextContent(textContent: String): T + /** + * An array of content parts with a defined type. For developer messages, only type + * `text` is supported. + */ fun visitArrayOfContentParts( arrayOfContentParts: List ): T @@ -320,6 +325,7 @@ private constructor( } } + /** The role of the messages author, in this case `developer`. */ class Role @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionFunctionMessageParam.kt b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionFunctionMessageParam.kt index d27388f16..346804280 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionFunctionMessageParam.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionFunctionMessageParam.kt @@ -19,6 +19,7 @@ import com.openai.errors.OpenAIInvalidDataException import java.util.Objects import java.util.Optional +@Deprecated("deprecated") @NoAutoDetect class ChatCompletionFunctionMessageParam @JsonCreator @@ -139,6 +140,7 @@ private constructor( ) } + /** The role of the messages author, in this case `function`. */ class Role @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionMessage.kt b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionMessage.kt index aadd5c3a3..168eef7f2 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionMessage.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionMessage.kt @@ -62,6 +62,7 @@ private constructor( * Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be * called, as generated by the model. */ + @Deprecated("deprecated") fun functionCall(): Optional = Optional.ofNullable(functionCall.getNullable("function_call")) @@ -88,6 +89,7 @@ private constructor( * Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be * called, as generated by the model. */ + @Deprecated("deprecated") @JsonProperty("function_call") @ExcludeMissing fun _functionCall(): JsonField = functionCall @@ -191,12 +193,14 @@ private constructor( * Deprecated and replaced by `tool_calls`. The name and arguments of a function that should * be called, as generated by the model. */ + @Deprecated("deprecated") fun functionCall(functionCall: FunctionCall) = functionCall(JsonField.of(functionCall)) /** * Deprecated and replaced by `tool_calls`. The name and arguments of a function that should * be called, as generated by the model. */ + @Deprecated("deprecated") fun functionCall(functionCall: JsonField) = apply { this.functionCall = functionCall } @@ -255,6 +259,7 @@ private constructor( ) } + /** The role of the author of this message. */ class Role @JsonCreator private constructor( @@ -310,6 +315,7 @@ private constructor( * Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be * called, as generated by the model. */ + @Deprecated("deprecated") @NoAutoDetect class FunctionCall @JsonCreator diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionMessageParam.kt b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionMessageParam.kt index 825b2b521..f737a7cd6 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionMessageParam.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionMessageParam.kt @@ -61,6 +61,7 @@ private constructor( fun chatCompletionToolMessageParam(): Optional = Optional.ofNullable(chatCompletionToolMessageParam) + @Deprecated("deprecated") fun chatCompletionFunctionMessageParam(): Optional = Optional.ofNullable(chatCompletionFunctionMessageParam) @@ -76,6 +77,7 @@ private constructor( fun isChatCompletionToolMessageParam(): Boolean = chatCompletionToolMessageParam != null + @Deprecated("deprecated") fun isChatCompletionFunctionMessageParam(): Boolean = chatCompletionFunctionMessageParam != null /** @@ -104,6 +106,7 @@ private constructor( fun asChatCompletionToolMessageParam(): ChatCompletionToolMessageParam = chatCompletionToolMessageParam.getOrThrow("chatCompletionToolMessageParam") + @Deprecated("deprecated") fun asChatCompletionFunctionMessageParam(): ChatCompletionFunctionMessageParam = chatCompletionFunctionMessageParam.getOrThrow("chatCompletionFunctionMessageParam") @@ -261,6 +264,7 @@ private constructor( chatCompletionToolMessageParam = chatCompletionToolMessageParam ) + @Deprecated("deprecated") @JvmStatic fun ofChatCompletionFunctionMessageParam( chatCompletionFunctionMessageParam: ChatCompletionFunctionMessageParam @@ -272,18 +276,29 @@ private constructor( interface Visitor { + /** + * Developer-provided instructions that the model should follow, regardless of messages sent + * by the user. With o1 models and newer, `developer` messages replace the previous `system` + * messages. + */ fun visitChatCompletionDeveloperMessageParam( chatCompletionDeveloperMessageParam: ChatCompletionDeveloperMessageParam ): T + /** + * Developer-provided instructions that the model should follow, regardless of messages sent + * by the user. With o1 models and newer, use `developer` messages for this purpose instead. + */ fun visitChatCompletionSystemMessageParam( chatCompletionSystemMessageParam: ChatCompletionSystemMessageParam ): T + /** Messages sent by an end user, containing prompts or additional context information. */ fun visitChatCompletionUserMessageParam( chatCompletionUserMessageParam: ChatCompletionUserMessageParam ): T + /** Messages sent by the model in response to user messages. */ fun visitChatCompletionAssistantMessageParam( chatCompletionAssistantMessageParam: ChatCompletionAssistantMessageParam ): T @@ -292,6 +307,7 @@ private constructor( chatCompletionToolMessageParam: ChatCompletionToolMessageParam ): T + @Deprecated("deprecated") fun visitChatCompletionFunctionMessageParam( chatCompletionFunctionMessageParam: ChatCompletionFunctionMessageParam ): T diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionMessageToolCall.kt b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionMessageToolCall.kt index 9a5564561..4e1c1b401 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionMessageToolCall.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionMessageToolCall.kt @@ -273,6 +273,7 @@ private constructor( "Function{arguments=$arguments, name=$name, additionalProperties=$additionalProperties}" } + /** The type of the tool. Currently, only `function` is supported. */ class Type @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionNamedToolChoice.kt b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionNamedToolChoice.kt index cda251b55..bccb2996b 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionNamedToolChoice.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionNamedToolChoice.kt @@ -209,6 +209,7 @@ private constructor( override fun toString() = "Function{name=$name, additionalProperties=$additionalProperties}" } + /** The type of the tool. Currently, only `function` is supported. */ class Type @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionPredictionContent.kt b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionPredictionContent.kt index 53ef0f590..a73e0705f 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionPredictionContent.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionPredictionContent.kt @@ -284,8 +284,17 @@ private constructor( interface Visitor { + /** + * The content used for a Predicted Output. This is often the text of a file you are + * regenerating with minor changes. + */ fun visitTextContent(textContent: String): T + /** + * An array of content parts with a defined type. Supported options differ based on the + * [model](https://platform.openai.com/docs/models) being used to generate the response. + * Can contain text inputs. + */ fun visitArrayOfContentParts( arrayOfContentParts: List ): T @@ -332,6 +341,10 @@ private constructor( } } + /** + * The type of the predicted content you want to provide. This type is currently always + * `content`. + */ class Type @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionReasoningEffort.kt b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionReasoningEffort.kt index 1a77f1382..6ad438e85 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionReasoningEffort.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionReasoningEffort.kt @@ -7,6 +7,14 @@ import com.openai.core.Enum import com.openai.core.JsonField import com.openai.errors.OpenAIInvalidDataException +/** + * **o1 models only** + * + * Constrains effort on reasoning for + * [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently supported values + * are `low`, `medium`, and `high`. Reducing reasoning effort can result in faster responses and + * fewer tokens used on reasoning in a response. + */ class ChatCompletionReasoningEffort @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionRole.kt b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionRole.kt index 356fc492d..c6e940b03 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionRole.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionRole.kt @@ -7,6 +7,7 @@ import com.openai.core.Enum import com.openai.core.JsonField import com.openai.errors.OpenAIInvalidDataException +/** The role of the author of a message */ class ChatCompletionRole @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionSystemMessageParam.kt b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionSystemMessageParam.kt index a027f864e..8151f6c00 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionSystemMessageParam.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionSystemMessageParam.kt @@ -271,8 +271,13 @@ private constructor( interface Visitor { + /** The contents of the system message. */ fun visitTextContent(textContent: String): T + /** + * An array of content parts with a defined type. For system messages, only type `text` + * is supported. + */ fun visitArrayOfContentParts( arrayOfContentParts: List ): T @@ -319,6 +324,7 @@ private constructor( } } + /** The role of the messages author, in this case `system`. */ class Role @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionTool.kt b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionTool.kt index 1f5856fa1..f378e0e74 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionTool.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionTool.kt @@ -114,6 +114,7 @@ private constructor( ) } + /** The type of the tool. Currently, only `function` is supported. */ class Type @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionToolChoiceOption.kt b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionToolChoiceOption.kt index b3f74e5f7..934e1ce1b 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionToolChoiceOption.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionToolChoiceOption.kt @@ -144,8 +144,17 @@ private constructor( interface Visitor { + /** + * `none` means the model will not call any tool and instead generates a message. `auto` + * means the model can pick between generating a message or calling one or more tools. + * `required` means the model must call one or more tools. + */ fun visitBehavior(behavior: Behavior): T + /** + * Specifies a tool the model should use. Use to force the model to call a specific + * function. + */ fun visitChatCompletionNamedToolChoice( chatCompletionNamedToolChoice: ChatCompletionNamedToolChoice ): T @@ -194,6 +203,11 @@ private constructor( } } + /** + * `none` means the model will not call any tool and instead generates a message. `auto` means + * the model can pick between generating a message or calling one or more tools. `required` + * means the model must call one or more tools. + */ class Behavior @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionToolMessageParam.kt b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionToolMessageParam.kt index 5070842ce..493320e0f 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionToolMessageParam.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionToolMessageParam.kt @@ -256,8 +256,13 @@ private constructor( interface Visitor { + /** The contents of the tool message. */ fun visitTextContent(textContent: String): T + /** + * An array of content parts with a defined type. For tool messages, only type `text` is + * supported. + */ fun visitArrayOfContentParts( arrayOfContentParts: List ): T @@ -304,6 +309,7 @@ private constructor( } } + /** The role of the messages author, in this case `tool`. */ class Role @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionUserMessageParam.kt b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionUserMessageParam.kt index 985c32534..72851696f 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionUserMessageParam.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionUserMessageParam.kt @@ -271,8 +271,14 @@ private constructor( interface Visitor { + /** The text contents of the message. */ fun visitTextContent(textContent: String): T + /** + * An array of content parts with a defined type. Supported options differ based on the + * [model](https://platform.openai.com/docs/models) being used to generate the response. + * Can contain text, image, or audio inputs. + */ fun visitArrayOfContentParts(arrayOfContentParts: List): T fun unknown(json: JsonValue?): T { @@ -317,6 +323,7 @@ private constructor( } } + /** The role of the messages author, in this case `user`. */ class Role @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/CodeInterpreterLogs.kt b/openai-java-core/src/main/kotlin/com/openai/models/CodeInterpreterLogs.kt index 424be89ec..a3a167270 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/CodeInterpreterLogs.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/CodeInterpreterLogs.kt @@ -133,6 +133,7 @@ private constructor( ) } + /** Always `logs`. */ class Type @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/CodeInterpreterOutputImage.kt b/openai-java-core/src/main/kotlin/com/openai/models/CodeInterpreterOutputImage.kt index 7f010728f..a4acf0e23 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/CodeInterpreterOutputImage.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/CodeInterpreterOutputImage.kt @@ -128,6 +128,7 @@ private constructor( ) } + /** Always `image`. */ class Type @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/CodeInterpreterTool.kt b/openai-java-core/src/main/kotlin/com/openai/models/CodeInterpreterTool.kt index 7e4412a23..f97b7ea88 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/CodeInterpreterTool.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/CodeInterpreterTool.kt @@ -94,6 +94,7 @@ private constructor( CodeInterpreterTool(checkRequired("type", type), additionalProperties.toImmutable()) } + /** The type of tool being defined: `code_interpreter` */ class Type @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/CodeInterpreterToolCall.kt b/openai-java-core/src/main/kotlin/com/openai/models/CodeInterpreterToolCall.kt index ce6650700..319189d5c 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/CodeInterpreterToolCall.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/CodeInterpreterToolCall.kt @@ -394,6 +394,7 @@ private constructor( interface Visitor { + /** Text output from the Code Interpreter tool call as part of a run step. */ fun visitLogs(logs: LogsOutput): T fun visitImage(image: ImageOutput): T @@ -549,6 +550,7 @@ private constructor( ) } + /** Always `logs`. */ class Type @JsonCreator private constructor( @@ -837,6 +839,7 @@ private constructor( "Image{fileId=$fileId, additionalProperties=$additionalProperties}" } + /** Always `image`. */ class Type @JsonCreator private constructor( @@ -926,6 +929,10 @@ private constructor( "CodeInterpreter{input=$input, outputs=$outputs, additionalProperties=$additionalProperties}" } + /** + * The type of tool call. This is always going to be `code_interpreter` for this type of tool + * call. + */ class Type @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/CodeInterpreterToolCallDelta.kt b/openai-java-core/src/main/kotlin/com/openai/models/CodeInterpreterToolCallDelta.kt index 8814a0ee8..3007cd13e 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/CodeInterpreterToolCallDelta.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/CodeInterpreterToolCallDelta.kt @@ -181,6 +181,10 @@ private constructor( ) } + /** + * The type of tool call. This is always going to be `code_interpreter` for this type of tool + * call. + */ class Type @JsonCreator private constructor( @@ -482,6 +486,7 @@ private constructor( interface Visitor { + /** Text output from the Code Interpreter tool call as part of a run step. */ fun visitCodeInterpreterLogs(codeInterpreterLogs: CodeInterpreterLogs): T fun visitCodeInterpreterOutputImage( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/Completion.kt b/openai-java-core/src/main/kotlin/com/openai/models/Completion.kt index 88cd0de7a..9c0cecbe8 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/Completion.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/Completion.kt @@ -258,6 +258,7 @@ private constructor( ) } + /** The object type, which is always "text_completion" */ class Object @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/CompletionChoice.kt b/openai-java-core/src/main/kotlin/com/openai/models/CompletionChoice.kt index 58d1cdfc6..c8ac0a46f 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/CompletionChoice.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/CompletionChoice.kt @@ -167,6 +167,12 @@ private constructor( ) } + /** + * The reason the model stopped generating tokens. This will be `stop` if the model hit a + * natural stop point or a provided stop sequence, `length` if the maximum number of tokens + * specified in the request was reached, or `content_filter` if content was omitted due to a + * flag from our content filters. + */ class FinishReason @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/CompletionCreateParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/CompletionCreateParams.kt index 3adbb94cc..41f6b8956 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/CompletionCreateParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/CompletionCreateParams.kt @@ -2221,6 +2221,12 @@ constructor( ) } + /** + * ID of the model to use. You can use the + * [List models](https://platform.openai.com/docs/api-reference/models/list) API to see all of + * your available models, or see our [Model overview](https://platform.openai.com/docs/models) + * for descriptions of them. + */ class Model @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/CreateEmbeddingResponse.kt b/openai-java-core/src/main/kotlin/com/openai/models/CreateEmbeddingResponse.kt index 46edf49a1..38d9061cc 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/CreateEmbeddingResponse.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/CreateEmbeddingResponse.kt @@ -168,6 +168,7 @@ private constructor( ) } + /** The object type, which is always "list". */ class Object @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/Embedding.kt b/openai-java-core/src/main/kotlin/com/openai/models/Embedding.kt index 23eca76b7..dacdec235 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/Embedding.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/Embedding.kt @@ -170,6 +170,7 @@ private constructor( ) } + /** The object type, which is always "embedding". */ class Object @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/EmbeddingCreateParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/EmbeddingCreateParams.kt index 31e2e5c80..96bece3aa 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/EmbeddingCreateParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/EmbeddingCreateParams.kt @@ -798,12 +798,16 @@ constructor( interface Visitor { + /** The string that will be turned into an embedding. */ fun visitString(string: String): T + /** The array of strings that will be turned into an embedding. */ fun visitArrayOfStrings(arrayOfStrings: List): T + /** The array of integers that will be turned into an embedding. */ fun visitArrayOfTokens(arrayOfTokens: List): T + /** The array of arrays containing integers that will be turned into an embedding. */ fun visitArrayOfTokenArrays(arrayOfTokenArrays: List>): T fun unknown(json: JsonValue?): T { @@ -853,6 +857,10 @@ constructor( } } + /** + * The format to return the embeddings in. Can be either `float` or + * [`base64`](https://pypi.org/project/pybase64/). + */ class EncodingFormat @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/FileChunkingStrategy.kt b/openai-java-core/src/main/kotlin/com/openai/models/FileChunkingStrategy.kt index 1cde5e028..eb3f3b97d 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/FileChunkingStrategy.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/FileChunkingStrategy.kt @@ -135,6 +135,10 @@ private constructor( staticFileChunkingStrategyObject: StaticFileChunkingStrategyObject ): T + /** + * This is returned when the chunking strategy is unknown. Typically, this is because the + * file was indexed before the `chunking_strategy` concept was introduced in the API. + */ fun visitOtherFileChunkingStrategyObject( otherFileChunkingStrategyObject: OtherFileChunkingStrategyObject ): T diff --git a/openai-java-core/src/main/kotlin/com/openai/models/FileChunkingStrategyParam.kt b/openai-java-core/src/main/kotlin/com/openai/models/FileChunkingStrategyParam.kt index 1a4b5b258..941f6f939 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/FileChunkingStrategyParam.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/FileChunkingStrategyParam.kt @@ -138,6 +138,10 @@ private constructor( interface Visitor { + /** + * The default strategy. This strategy currently uses a `max_chunk_size_tokens` of `800` and + * `chunk_overlap_tokens` of `400`. + */ fun visitAutoFileChunkingStrategyParam( autoFileChunkingStrategyParam: AutoFileChunkingStrategyParam ): T diff --git a/openai-java-core/src/main/kotlin/com/openai/models/FileCitationAnnotation.kt b/openai-java-core/src/main/kotlin/com/openai/models/FileCitationAnnotation.kt index ab5454432..b66c0eed6 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/FileCitationAnnotation.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/FileCitationAnnotation.kt @@ -265,6 +265,7 @@ private constructor( "FileCitation{fileId=$fileId, additionalProperties=$additionalProperties}" } + /** Always `file_citation`. */ class Type @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/FileCitationDeltaAnnotation.kt b/openai-java-core/src/main/kotlin/com/openai/models/FileCitationDeltaAnnotation.kt index 0eb36de56..38e2df618 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/FileCitationDeltaAnnotation.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/FileCitationDeltaAnnotation.kt @@ -187,6 +187,7 @@ private constructor( ) } + /** Always `file_citation`. */ class Type @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/FileListPage.kt b/openai-java-core/src/main/kotlin/com/openai/models/FileListPage.kt index 613b20e13..f0be2a797 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/FileListPage.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/FileListPage.kt @@ -19,6 +19,7 @@ import java.util.Optional import java.util.stream.Stream import java.util.stream.StreamSupport +/** Returns a list of files. */ class FileListPage private constructor( private val filesService: FileService, diff --git a/openai-java-core/src/main/kotlin/com/openai/models/FileListPageAsync.kt b/openai-java-core/src/main/kotlin/com/openai/models/FileListPageAsync.kt index 06a569a04..f4f79443c 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/FileListPageAsync.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/FileListPageAsync.kt @@ -20,6 +20,7 @@ import java.util.concurrent.CompletableFuture import java.util.concurrent.Executor import java.util.function.Predicate +/** Returns a list of files. */ class FileListPageAsync private constructor( private val filesService: FileServiceAsync, diff --git a/openai-java-core/src/main/kotlin/com/openai/models/FileListParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/FileListParams.kt index bc3c75afd..2e9086819 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/FileListParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/FileListParams.kt @@ -251,6 +251,10 @@ constructor( ) } + /** + * Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` + * for descending order. + */ class Order @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/FileObject.kt b/openai-java-core/src/main/kotlin/com/openai/models/FileObject.kt index 7b71c555b..62a30604b 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/FileObject.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/FileObject.kt @@ -72,12 +72,13 @@ private constructor( * Deprecated. The current status of the file, which can be either `uploaded`, `processed`, or * `error`. */ - fun status(): Status = status.getRequired("status") + @Deprecated("deprecated") fun status(): Status = status.getRequired("status") /** * Deprecated. For details on why a fine-tuning training file failed validation, see the `error` * field on `fine_tuning.job`. */ + @Deprecated("deprecated") fun statusDetails(): Optional = Optional.ofNullable(statusDetails.getNullable("status_details")) @@ -106,12 +107,16 @@ private constructor( * Deprecated. The current status of the file, which can be either `uploaded`, `processed`, or * `error`. */ - @JsonProperty("status") @ExcludeMissing fun _status(): JsonField = status + @Deprecated("deprecated") + @JsonProperty("status") + @ExcludeMissing + fun _status(): JsonField = status /** * Deprecated. For details on why a fine-tuning training file failed validation, see the `error` * field on `fine_tuning.job`. */ + @Deprecated("deprecated") @JsonProperty("status_details") @ExcludeMissing fun _statusDetails(): JsonField = statusDetails @@ -216,24 +221,27 @@ private constructor( * Deprecated. The current status of the file, which can be either `uploaded`, `processed`, * or `error`. */ - fun status(status: Status) = status(JsonField.of(status)) + @Deprecated("deprecated") fun status(status: Status) = status(JsonField.of(status)) /** * Deprecated. The current status of the file, which can be either `uploaded`, `processed`, * or `error`. */ + @Deprecated("deprecated") fun status(status: JsonField) = apply { this.status = status } /** * Deprecated. For details on why a fine-tuning training file failed validation, see the * `error` field on `fine_tuning.job`. */ + @Deprecated("deprecated") fun statusDetails(statusDetails: String) = statusDetails(JsonField.of(statusDetails)) /** * Deprecated. For details on why a fine-tuning training file failed validation, see the * `error` field on `fine_tuning.job`. */ + @Deprecated("deprecated") fun statusDetails(statusDetails: JsonField) = apply { this.statusDetails = statusDetails } @@ -271,6 +279,7 @@ private constructor( ) } + /** The object type, which is always `file`. */ class Object @JsonCreator private constructor( @@ -322,6 +331,10 @@ private constructor( override fun toString() = value.toString() } + /** + * The intended purpose of the file. Supported values are `assistants`, `assistants_output`, + * `batch`, `batch_output`, `fine-tune`, `fine-tune-results` and `vision`. + */ class Purpose @JsonCreator private constructor( @@ -409,6 +422,11 @@ private constructor( override fun toString() = value.toString() } + /** + * Deprecated. The current status of the file, which can be either `uploaded`, `processed`, or + * `error`. + */ + @Deprecated("deprecated") class Status @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/FilePathAnnotation.kt b/openai-java-core/src/main/kotlin/com/openai/models/FilePathAnnotation.kt index 36d47a2e0..0f40561eb 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/FilePathAnnotation.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/FilePathAnnotation.kt @@ -260,6 +260,7 @@ private constructor( "FilePath{fileId=$fileId, additionalProperties=$additionalProperties}" } + /** Always `file_path`. */ class Type @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/FilePathDeltaAnnotation.kt b/openai-java-core/src/main/kotlin/com/openai/models/FilePathDeltaAnnotation.kt index 613ef30b4..acf75a5bc 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/FilePathDeltaAnnotation.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/FilePathDeltaAnnotation.kt @@ -181,6 +181,7 @@ private constructor( ) } + /** Always `file_path`. */ class Type @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/FilePurpose.kt b/openai-java-core/src/main/kotlin/com/openai/models/FilePurpose.kt index 88278ca5d..775a2a75e 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/FilePurpose.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/FilePurpose.kt @@ -7,6 +7,14 @@ import com.openai.core.Enum import com.openai.core.JsonField import com.openai.errors.OpenAIInvalidDataException +/** + * The intended purpose of the uploaded file. + * + * Use "assistants" for [Assistants](https://platform.openai.com/docs/api-reference/assistants) and + * [Message](https://platform.openai.com/docs/api-reference/messages) files, "vision" for Assistants + * image file inputs, "batch" for [Batch API](https://platform.openai.com/docs/guides/batch), and + * "fine-tune" for [Fine-tuning](https://platform.openai.com/docs/api-reference/fine-tuning). + */ class FilePurpose @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/FileSearchTool.kt b/openai-java-core/src/main/kotlin/com/openai/models/FileSearchTool.kt index 228fee63a..1b649c285 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/FileSearchTool.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/FileSearchTool.kt @@ -120,6 +120,7 @@ private constructor( ) } + /** The type of tool being defined: `file_search` */ class Type @JsonCreator private constructor( @@ -485,6 +486,9 @@ private constructor( ) } + /** + * The ranker to use for the file search. If not specified will use the `auto` ranker. + */ class Ranker @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/FileSearchToolCall.kt b/openai-java-core/src/main/kotlin/com/openai/models/FileSearchToolCall.kt index 9561d0216..9645535b7 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/FileSearchToolCall.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/FileSearchToolCall.kt @@ -392,6 +392,7 @@ private constructor( ) } + /** The ranker used for the file search. */ class Ranker @JsonCreator private constructor( @@ -752,6 +753,7 @@ private constructor( ) } + /** The type of the content. */ class Type @JsonCreator private constructor( @@ -858,6 +860,9 @@ private constructor( "FileSearch{rankingOptions=$rankingOptions, results=$results, additionalProperties=$additionalProperties}" } + /** + * The type of tool call. This is always going to be `file_search` for this type of tool call. + */ class Type @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/FileSearchToolCallDelta.kt b/openai-java-core/src/main/kotlin/com/openai/models/FileSearchToolCallDelta.kt index 1358a2c7d..619c2526a 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/FileSearchToolCallDelta.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/FileSearchToolCallDelta.kt @@ -154,6 +154,9 @@ private constructor( ) } + /** + * The type of tool call. This is always going to be `file_search` for this type of tool call. + */ class Type @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJob.kt b/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJob.kt index 73816649e..ca4ea76dd 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJob.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJob.kt @@ -1600,6 +1600,7 @@ private constructor( "Hyperparameters{batchSize=$batchSize, learningRateMultiplier=$learningRateMultiplier, nEpochs=$nEpochs, additionalProperties=$additionalProperties}" } + /** The object type, which is always "fine_tuning.job". */ class Object @JsonCreator private constructor( @@ -1651,6 +1652,10 @@ private constructor( override fun toString() = value.toString() } + /** + * The current status of the fine-tuning job, which can be either `validating_files`, `queued`, + * `running`, `succeeded`, `failed`, or `cancelled`. + */ class Status @JsonCreator private constructor( @@ -3807,6 +3812,7 @@ private constructor( "Supervised{hyperparameters=$hyperparameters, additionalProperties=$additionalProperties}" } + /** The type of method. Is either `supervised` or `dpo`. */ class Type @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobCheckpoint.kt b/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobCheckpoint.kt index 0f28ab0f3..52b9bd17c 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobCheckpoint.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobCheckpoint.kt @@ -439,6 +439,7 @@ private constructor( "Metrics{fullValidLoss=$fullValidLoss, fullValidMeanTokenAccuracy=$fullValidMeanTokenAccuracy, step=$step, trainLoss=$trainLoss, trainMeanTokenAccuracy=$trainMeanTokenAccuracy, validLoss=$validLoss, validMeanTokenAccuracy=$validMeanTokenAccuracy, additionalProperties=$additionalProperties}" } + /** The object type, which is always "fine_tuning.job.checkpoint". */ class Object @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobCheckpointListPage.kt b/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobCheckpointListPage.kt index 136e22e68..d0345ed65 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobCheckpointListPage.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobCheckpointListPage.kt @@ -19,6 +19,7 @@ import java.util.Optional import java.util.stream.Stream import java.util.stream.StreamSupport +/** List checkpoints for a fine-tuning job. */ class FineTuningJobCheckpointListPage private constructor( private val checkpointsService: CheckpointService, diff --git a/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobCheckpointListPageAsync.kt b/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobCheckpointListPageAsync.kt index a69c99ddf..9caa1f4dc 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobCheckpointListPageAsync.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobCheckpointListPageAsync.kt @@ -20,6 +20,7 @@ import java.util.concurrent.CompletableFuture import java.util.concurrent.Executor import java.util.function.Predicate +/** List checkpoints for a fine-tuning job. */ class FineTuningJobCheckpointListPageAsync private constructor( private val checkpointsService: CheckpointServiceAsync, diff --git a/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobCreateParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobCreateParams.kt index c0b5d6400..2bc69c06d 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobCreateParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobCreateParams.kt @@ -77,6 +77,7 @@ constructor( * The hyperparameters used for the fine-tuning job. This value is now deprecated in favor of * `method`, and should be passed in under the `method` parameter. */ + @Deprecated("deprecated") fun hyperparameters(): Optional = body.hyperparameters() /** A list of integrations to enable for your fine-tuning job. */ @@ -146,6 +147,7 @@ constructor( * The hyperparameters used for the fine-tuning job. This value is now deprecated in favor of * `method`, and should be passed in under the `method` parameter. */ + @Deprecated("deprecated") fun _hyperparameters(): JsonField = body._hyperparameters() /** A list of integrations to enable for your fine-tuning job. */ @@ -257,6 +259,7 @@ constructor( * The hyperparameters used for the fine-tuning job. This value is now deprecated in favor * of `method`, and should be passed in under the `method` parameter. */ + @Deprecated("deprecated") fun hyperparameters(): Optional = Optional.ofNullable(hyperparameters.getNullable("hyperparameters")) @@ -331,6 +334,7 @@ constructor( * The hyperparameters used for the fine-tuning job. This value is now deprecated in favor * of `method`, and should be passed in under the `method` parameter. */ + @Deprecated("deprecated") @JsonProperty("hyperparameters") @ExcludeMissing fun _hyperparameters(): JsonField = hyperparameters @@ -495,6 +499,7 @@ constructor( * The hyperparameters used for the fine-tuning job. This value is now deprecated in * favor of `method`, and should be passed in under the `method` parameter. */ + @Deprecated("deprecated") fun hyperparameters(hyperparameters: Hyperparameters) = hyperparameters(JsonField.of(hyperparameters)) @@ -502,6 +507,7 @@ constructor( * The hyperparameters used for the fine-tuning job. This value is now deprecated in * favor of `method`, and should be passed in under the `method` parameter. */ + @Deprecated("deprecated") fun hyperparameters(hyperparameters: JsonField) = apply { this.hyperparameters = hyperparameters } @@ -779,6 +785,7 @@ constructor( * The hyperparameters used for the fine-tuning job. This value is now deprecated in favor * of `method`, and should be passed in under the `method` parameter. */ + @Deprecated("deprecated") fun hyperparameters(hyperparameters: Hyperparameters) = apply { body.hyperparameters(hyperparameters) } @@ -787,6 +794,7 @@ constructor( * The hyperparameters used for the fine-tuning job. This value is now deprecated in favor * of `method`, and should be passed in under the `method` parameter. */ + @Deprecated("deprecated") fun hyperparameters(hyperparameters: JsonField) = apply { body.hyperparameters(hyperparameters) } @@ -1040,6 +1048,10 @@ constructor( ) } + /** + * The name of the model to fine-tune. You can select one of the + * [supported models](https://platform.openai.com/docs/guides/fine-tuning#which-models-can-be-fine-tuned). + */ class Model @JsonCreator private constructor( @@ -1113,6 +1125,7 @@ constructor( * The hyperparameters used for the fine-tuning job. This value is now deprecated in favor of * `method`, and should be passed in under the `method` parameter. */ + @Deprecated("deprecated") @NoAutoDetect class Hyperparameters @JsonCreator @@ -1985,6 +1998,10 @@ constructor( ) } + /** + * The type of integration to enable. Currently, only "wandb" (Weights and Biases) is + * supported. + */ class Type @JsonCreator private constructor( @@ -4370,6 +4387,7 @@ constructor( "Supervised{hyperparameters=$hyperparameters, additionalProperties=$additionalProperties}" } + /** The type of method. Is either `supervised` or `dpo`. */ class Type @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobEvent.kt b/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobEvent.kt index d629b0d0b..8dcc919b1 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobEvent.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobEvent.kt @@ -200,6 +200,7 @@ private constructor( ) } + /** The log level of the event. */ class Level @JsonCreator private constructor( @@ -263,6 +264,7 @@ private constructor( override fun toString() = value.toString() } + /** The object type, which is always "fine_tuning.job.event". */ class Object @JsonCreator private constructor( @@ -314,6 +316,7 @@ private constructor( override fun toString() = value.toString() } + /** The type of event. */ class Type @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobListEventsPage.kt b/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobListEventsPage.kt index 6b5d3758d..83abdbd79 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobListEventsPage.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobListEventsPage.kt @@ -19,6 +19,7 @@ import java.util.Optional import java.util.stream.Stream import java.util.stream.StreamSupport +/** Get status updates for a fine-tuning job. */ class FineTuningJobListEventsPage private constructor( private val jobsService: JobService, diff --git a/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobListEventsPageAsync.kt b/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobListEventsPageAsync.kt index 20a5ad2b3..79d5c084b 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobListEventsPageAsync.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobListEventsPageAsync.kt @@ -20,6 +20,7 @@ import java.util.concurrent.CompletableFuture import java.util.concurrent.Executor import java.util.function.Predicate +/** Get status updates for a fine-tuning job. */ class FineTuningJobListEventsPageAsync private constructor( private val jobsService: JobServiceAsync, diff --git a/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobListPage.kt b/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobListPage.kt index 39388bc90..8cbc4c42f 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobListPage.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobListPage.kt @@ -19,6 +19,7 @@ import java.util.Optional import java.util.stream.Stream import java.util.stream.StreamSupport +/** List your organization's fine-tuning jobs */ class FineTuningJobListPage private constructor( private val jobsService: JobService, diff --git a/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobListPageAsync.kt b/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobListPageAsync.kt index 8169e05a0..3f3d08dbe 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobListPageAsync.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobListPageAsync.kt @@ -20,6 +20,7 @@ import java.util.concurrent.CompletableFuture import java.util.concurrent.Executor import java.util.function.Predicate +/** List your organization's fine-tuning jobs */ class FineTuningJobListPageAsync private constructor( private val jobsService: JobServiceAsync, diff --git a/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobWandbIntegrationObject.kt b/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobWandbIntegrationObject.kt index d57f9259a..214463852 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobWandbIntegrationObject.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobWandbIntegrationObject.kt @@ -141,6 +141,7 @@ private constructor( ) } + /** The type of the integration being enabled for the fine-tuning job */ class Type @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/FunctionTool.kt b/openai-java-core/src/main/kotlin/com/openai/models/FunctionTool.kt index c2e640ab5..f910830dc 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/FunctionTool.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/FunctionTool.kt @@ -114,6 +114,7 @@ private constructor( ) } + /** The type of tool being defined: `function` */ class Type @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/FunctionToolCall.kt b/openai-java-core/src/main/kotlin/com/openai/models/FunctionToolCall.kt index 767045266..44ed6c63d 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/FunctionToolCall.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/FunctionToolCall.kt @@ -298,6 +298,7 @@ private constructor( "Function{arguments=$arguments, name=$name, output=$output, additionalProperties=$additionalProperties}" } + /** The type of tool call. This is always going to be `function` for this type of tool call. */ class Type @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/FunctionToolCallDelta.kt b/openai-java-core/src/main/kotlin/com/openai/models/FunctionToolCallDelta.kt index 0b31b4669..78a52f195 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/FunctionToolCallDelta.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/FunctionToolCallDelta.kt @@ -155,6 +155,7 @@ private constructor( ) } + /** The type of tool call. This is always going to be `function` for this type of tool call. */ class Type @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ImageFile.kt b/openai-java-core/src/main/kotlin/com/openai/models/ImageFile.kt index 7c6413b60..8c4ef12bc 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ImageFile.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ImageFile.kt @@ -147,6 +147,10 @@ private constructor( ) } + /** + * Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, + * you can opt in to high resolution using `high`. + */ class Detail @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ImageFileContentBlock.kt b/openai-java-core/src/main/kotlin/com/openai/models/ImageFileContentBlock.kt index c8bc8f811..2067223a1 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ImageFileContentBlock.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ImageFileContentBlock.kt @@ -116,6 +116,7 @@ private constructor( ) } + /** Always `image_file`. */ class Type @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ImageFileDelta.kt b/openai-java-core/src/main/kotlin/com/openai/models/ImageFileDelta.kt index c3fd5385a..2bc7e2870 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ImageFileDelta.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ImageFileDelta.kt @@ -146,6 +146,10 @@ private constructor( ) } + /** + * Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, + * you can opt in to high resolution using `high`. + */ class Detail @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ImageFileDeltaBlock.kt b/openai-java-core/src/main/kotlin/com/openai/models/ImageFileDeltaBlock.kt index 191a82b51..d8eeac01d 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ImageFileDeltaBlock.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ImageFileDeltaBlock.kt @@ -137,6 +137,7 @@ private constructor( ) } + /** Always `image_file`. */ class Type @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ImageGenerateParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/ImageGenerateParams.kt index 5e3fa3019..303315f63 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ImageGenerateParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ImageGenerateParams.kt @@ -804,6 +804,10 @@ constructor( ) } + /** + * The quality of the image that will be generated. `hd` creates images with finer details and + * greater consistency across the image. This param is only supported for `dall-e-3`. + */ class Quality @JsonCreator private constructor( @@ -861,6 +865,10 @@ constructor( override fun toString() = value.toString() } + /** + * The format in which the generated images are returned. Must be one of `url` or `b64_json`. + * URLs are only valid for 60 minutes after the image has been generated. + */ class ResponseFormat @JsonCreator private constructor( @@ -918,6 +926,10 @@ constructor( override fun toString() = value.toString() } + /** + * The size of the generated images. Must be one of `256x256`, `512x512`, or `1024x1024` for + * `dall-e-2`. Must be one of `1024x1024`, `1792x1024`, or `1024x1792` for `dall-e-3` models. + */ class Size @JsonCreator private constructor( @@ -993,6 +1005,12 @@ constructor( override fun toString() = value.toString() } + /** + * The style of the generated images. Must be one of `vivid` or `natural`. Vivid causes the + * model to lean towards generating hyper-real and dramatic images. Natural causes the model to + * produce more natural, less hyper-real looking images. This param is only supported for + * `dall-e-3`. + */ class Style @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ImageUrl.kt b/openai-java-core/src/main/kotlin/com/openai/models/ImageUrl.kt index 49455b097..5c1fdfd95 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ImageUrl.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ImageUrl.kt @@ -139,6 +139,10 @@ private constructor( ) } + /** + * Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high + * resolution using `high`. Default value is `auto` + */ class Detail @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ImageUrlContentBlock.kt b/openai-java-core/src/main/kotlin/com/openai/models/ImageUrlContentBlock.kt index c1decb363..e5f85bac9 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ImageUrlContentBlock.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ImageUrlContentBlock.kt @@ -113,6 +113,7 @@ private constructor( ) } + /** The type of the content part. */ class Type @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ImageUrlDelta.kt b/openai-java-core/src/main/kotlin/com/openai/models/ImageUrlDelta.kt index 45c12359f..83d61a56a 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ImageUrlDelta.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ImageUrlDelta.kt @@ -128,6 +128,10 @@ private constructor( ) } + /** + * Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high + * resolution using `high`. + */ class Detail @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ImageUrlDeltaBlock.kt b/openai-java-core/src/main/kotlin/com/openai/models/ImageUrlDeltaBlock.kt index 6970211c9..00afe7caa 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ImageUrlDeltaBlock.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ImageUrlDeltaBlock.kt @@ -131,6 +131,7 @@ private constructor( ) } + /** Always `image_url`. */ class Type @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/Message.kt b/openai-java-core/src/main/kotlin/com/openai/models/Message.kt index 205cc6b2c..1c7dc2b51 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/Message.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/Message.kt @@ -874,6 +874,7 @@ private constructor( ) } + /** The type of tool being defined: `file_search` */ class Type @JsonCreator private constructor( @@ -1046,6 +1047,7 @@ private constructor( ) } + /** The reason the message is incomplete. */ class Reason @JsonCreator private constructor( @@ -1139,6 +1141,7 @@ private constructor( "IncompleteDetails{reason=$reason, additionalProperties=$additionalProperties}" } + /** The object type, which is always `thread.message`. */ class Object @JsonCreator private constructor( @@ -1190,6 +1193,7 @@ private constructor( override fun toString() = value.toString() } + /** The entity that produced the message. One of `user` or `assistant`. */ class Role @JsonCreator private constructor( @@ -1247,6 +1251,9 @@ private constructor( override fun toString() = value.toString() } + /** + * The status of the message, which can be either `in_progress`, `incomplete`, or `completed`. + */ class Status @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/MessageContent.kt b/openai-java-core/src/main/kotlin/com/openai/models/MessageContent.kt index 2202678af..b4b900fed 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/MessageContent.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/MessageContent.kt @@ -172,12 +172,19 @@ private constructor( interface Visitor { + /** + * References an image [File](https://platform.openai.com/docs/api-reference/files) in the + * content of a message. + */ fun visitImageFileContentBlock(imageFileContentBlock: ImageFileContentBlock): T + /** References an image URL in the content of a message. */ fun visitImageUrlContentBlock(imageUrlContentBlock: ImageUrlContentBlock): T + /** The text content that is part of a message. */ fun visitTextContentBlock(textContentBlock: TextContentBlock): T + /** The refusal content generated by the assistant. */ fun visitRefusalContentBlock(refusalContentBlock: RefusalContentBlock): T fun unknown(json: JsonValue?): T { diff --git a/openai-java-core/src/main/kotlin/com/openai/models/MessageContentDelta.kt b/openai-java-core/src/main/kotlin/com/openai/models/MessageContentDelta.kt index 266a71102..54b94cbe5 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/MessageContentDelta.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/MessageContentDelta.kt @@ -165,12 +165,19 @@ private constructor( interface Visitor { + /** + * References an image [File](https://platform.openai.com/docs/api-reference/files) in the + * content of a message. + */ fun visitImageFileDeltaBlock(imageFileDeltaBlock: ImageFileDeltaBlock): T + /** The text content that is part of a message. */ fun visitTextDeltaBlock(textDeltaBlock: TextDeltaBlock): T + /** The refusal content that is part of a message. */ fun visitRefusalDeltaBlock(refusalDeltaBlock: RefusalDeltaBlock): T + /** References an image URL in the content of a message. */ fun visitImageUrlDeltaBlock(imageUrlDeltaBlock: ImageUrlDeltaBlock): T fun unknown(json: JsonValue?): T { diff --git a/openai-java-core/src/main/kotlin/com/openai/models/MessageContentPartParam.kt b/openai-java-core/src/main/kotlin/com/openai/models/MessageContentPartParam.kt index 4f7c2663b..fccef67ae 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/MessageContentPartParam.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/MessageContentPartParam.kt @@ -155,10 +155,16 @@ private constructor( interface Visitor { + /** + * References an image [File](https://platform.openai.com/docs/api-reference/files) in the + * content of a message. + */ fun visitImageFileContentBlock(imageFileContentBlock: ImageFileContentBlock): T + /** References an image URL in the content of a message. */ fun visitImageUrlContentBlock(imageUrlContentBlock: ImageUrlContentBlock): T + /** The text content that is part of a message. */ fun visitTextContentBlockParam(textContentBlockParam: TextContentBlockParam): T fun unknown(json: JsonValue?): T { diff --git a/openai-java-core/src/main/kotlin/com/openai/models/MessageCreationStepDetails.kt b/openai-java-core/src/main/kotlin/com/openai/models/MessageCreationStepDetails.kt index 353200b73..ee918d571 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/MessageCreationStepDetails.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/MessageCreationStepDetails.kt @@ -218,6 +218,7 @@ private constructor( "MessageCreation{messageId=$messageId, additionalProperties=$additionalProperties}" } + /** Always `message_creation`. */ class Type @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/MessageDelta.kt b/openai-java-core/src/main/kotlin/com/openai/models/MessageDelta.kt index 3dc9933c8..5b6d3a5bc 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/MessageDelta.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/MessageDelta.kt @@ -155,6 +155,7 @@ private constructor( ) } + /** The entity that produced the message. One of `user` or `assistant`. */ class Role @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/MessageDeltaEvent.kt b/openai-java-core/src/main/kotlin/com/openai/models/MessageDeltaEvent.kt index 81fffa520..520ee578e 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/MessageDeltaEvent.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/MessageDeltaEvent.kt @@ -136,6 +136,7 @@ private constructor( ) } + /** The object type, which is always `thread.message.delta`. */ class Object @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/MessageStreamEvent.kt b/openai-java-core/src/main/kotlin/com/openai/models/MessageStreamEvent.kt index 2d52203b6..c0dc87271 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/MessageStreamEvent.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/MessageStreamEvent.kt @@ -252,14 +252,35 @@ private constructor( interface Visitor { + /** + * Occurs when a [message](https://platform.openai.com/docs/api-reference/messages/object) + * is created. + */ fun visitThreadMessageCreated(threadMessageCreated: ThreadMessageCreated): T + /** + * Occurs when a [message](https://platform.openai.com/docs/api-reference/messages/object) + * moves to an `in_progress` state. + */ fun visitThreadMessageInProgress(threadMessageInProgress: ThreadMessageInProgress): T + /** + * Occurs when parts of a + * [Message](https://platform.openai.com/docs/api-reference/messages/object) are being + * streamed. + */ fun visitThreadMessageDelta(threadMessageDelta: ThreadMessageDelta): T + /** + * Occurs when a [message](https://platform.openai.com/docs/api-reference/messages/object) + * is completed. + */ fun visitThreadMessageCompleted(threadMessageCompleted: ThreadMessageCompleted): T + /** + * Occurs when a [message](https://platform.openai.com/docs/api-reference/messages/object) + * ends before it is completed. + */ fun visitThreadMessageIncomplete(threadMessageIncomplete: ThreadMessageIncomplete): T fun unknown(json: JsonValue?): T { diff --git a/openai-java-core/src/main/kotlin/com/openai/models/Model.kt b/openai-java-core/src/main/kotlin/com/openai/models/Model.kt index ddd6610ba..327554096 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/Model.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/Model.kt @@ -155,6 +155,7 @@ private constructor( ) } + /** The object type, which is always "model". */ class Object @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ModelListPage.kt b/openai-java-core/src/main/kotlin/com/openai/models/ModelListPage.kt index bdb76b173..81d7f1dad 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ModelListPage.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ModelListPage.kt @@ -19,6 +19,10 @@ import java.util.Optional import java.util.stream.Stream import java.util.stream.StreamSupport +/** + * Lists the currently available models, and provides basic information about each one such as the + * owner and availability. + */ class ModelListPage private constructor( private val modelsService: ModelService, diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ModelListPageAsync.kt b/openai-java-core/src/main/kotlin/com/openai/models/ModelListPageAsync.kt index d668f98e5..e4b4c1609 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ModelListPageAsync.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ModelListPageAsync.kt @@ -20,6 +20,10 @@ import java.util.concurrent.CompletableFuture import java.util.concurrent.Executor import java.util.function.Predicate +/** + * Lists the currently available models, and provides basic information about each one such as the + * owner and availability. + */ class ModelListPageAsync private constructor( private val modelsService: ModelServiceAsync, diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ModerationCreateParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/ModerationCreateParams.kt index 06e2dd2ca..ffc5220ef 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ModerationCreateParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ModerationCreateParams.kt @@ -546,10 +546,13 @@ constructor( interface Visitor { + /** A string of text to classify for moderation. */ fun visitString(string: String): T + /** An array of strings to classify for moderation. */ fun visitStrings(strings: List): T + /** An array of multi-modal inputs to the moderation model. */ fun visitModerationMultiModalArray( moderationMultiModalArray: List ): T diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ModerationImageUrlInput.kt b/openai-java-core/src/main/kotlin/com/openai/models/ModerationImageUrlInput.kt index 900d46eb0..1f8e730c8 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ModerationImageUrlInput.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ModerationImageUrlInput.kt @@ -212,6 +212,7 @@ private constructor( override fun toString() = "ImageUrl{url=$url, additionalProperties=$additionalProperties}" } + /** Always `image_url`. */ class Type @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ModerationMultiModalInput.kt b/openai-java-core/src/main/kotlin/com/openai/models/ModerationMultiModalInput.kt index 890abff66..1316bfb62 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ModerationMultiModalInput.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ModerationMultiModalInput.kt @@ -117,8 +117,10 @@ private constructor( interface Visitor { + /** An object describing an image to classify. */ fun visitModerationImageUrlInput(moderationImageUrlInput: ModerationImageUrlInput): T + /** An object describing text to classify. */ fun visitModerationTextInput(moderationTextInput: ModerationTextInput): T fun unknown(json: JsonValue?): T { diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ModerationTextInput.kt b/openai-java-core/src/main/kotlin/com/openai/models/ModerationTextInput.kt index 52e8c6b66..bb9cecc6e 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ModerationTextInput.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ModerationTextInput.kt @@ -115,6 +115,7 @@ private constructor( ) } + /** Always `text`. */ class Type @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/OtherFileChunkingStrategyObject.kt b/openai-java-core/src/main/kotlin/com/openai/models/OtherFileChunkingStrategyObject.kt index ca56fc1e3..6c65f17ce 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/OtherFileChunkingStrategyObject.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/OtherFileChunkingStrategyObject.kt @@ -103,6 +103,7 @@ private constructor( ) } + /** Always `other`. */ class Type @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/RefusalContentBlock.kt b/openai-java-core/src/main/kotlin/com/openai/models/RefusalContentBlock.kt index d5bf4ac43..f395129e0 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/RefusalContentBlock.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/RefusalContentBlock.kt @@ -113,6 +113,7 @@ private constructor( ) } + /** Always `refusal`. */ class Type @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/RefusalDeltaBlock.kt b/openai-java-core/src/main/kotlin/com/openai/models/RefusalDeltaBlock.kt index e1427cc38..dfdad5745 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/RefusalDeltaBlock.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/RefusalDeltaBlock.kt @@ -131,6 +131,7 @@ private constructor( ) } + /** Always `refusal`. */ class Type @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/RequiredActionFunctionToolCall.kt b/openai-java-core/src/main/kotlin/com/openai/models/RequiredActionFunctionToolCall.kt index aff74004a..bc03d8d49 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/RequiredActionFunctionToolCall.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/RequiredActionFunctionToolCall.kt @@ -275,6 +275,7 @@ private constructor( "Function{arguments=$arguments, name=$name, additionalProperties=$additionalProperties}" } + /** The type of tool call the output is required for. For now, this is always `function`. */ class Type @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ResponseFormatJsonObject.kt b/openai-java-core/src/main/kotlin/com/openai/models/ResponseFormatJsonObject.kt index 5f779f083..5aa4f0414 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ResponseFormatJsonObject.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ResponseFormatJsonObject.kt @@ -97,6 +97,7 @@ private constructor( ) } + /** The type of response format being defined: `json_object` */ class Type @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ResponseFormatJsonSchema.kt b/openai-java-core/src/main/kotlin/com/openai/models/ResponseFormatJsonSchema.kt index 2f34d54ec..bdf53598b 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ResponseFormatJsonSchema.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ResponseFormatJsonSchema.kt @@ -419,6 +419,7 @@ private constructor( "JsonSchema{name=$name, description=$description, schema=$schema, strict=$strict, additionalProperties=$additionalProperties}" } + /** The type of response format being defined: `json_schema` */ class Type @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ResponseFormatText.kt b/openai-java-core/src/main/kotlin/com/openai/models/ResponseFormatText.kt index 12f083fac..47a5a1542 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ResponseFormatText.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ResponseFormatText.kt @@ -94,6 +94,7 @@ private constructor( ResponseFormatText(checkRequired("type", type), additionalProperties.toImmutable()) } + /** The type of response format being defined: `text` */ class Type @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/Run.kt b/openai-java-core/src/main/kotlin/com/openai/models/Run.kt index 0d54a6ada..8f9662845 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/Run.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/Run.kt @@ -1256,6 +1256,10 @@ private constructor( IncompleteDetails(reason, additionalProperties.toImmutable()) } + /** + * The reason why the run is incomplete. This will point to which specific token limit was + * reached over the course of the run. + */ class Reason @JsonCreator private constructor( @@ -1431,6 +1435,7 @@ private constructor( ) } + /** One of `server_error`, `rate_limit_exceeded`, or `invalid_prompt`. */ class Code @JsonCreator private constructor( @@ -1512,6 +1517,7 @@ private constructor( "LastError{code=$code, message=$message, additionalProperties=$additionalProperties}" } + /** The object type, which is always `thread.run`. */ class Object @JsonCreator private constructor( @@ -1797,6 +1803,7 @@ private constructor( "SubmitToolOutputs{toolCalls=$toolCalls, additionalProperties=$additionalProperties}" } + /** For now, this is always `submit_tool_outputs`. */ class Type @JsonCreator private constructor( @@ -2020,6 +2027,12 @@ private constructor( ) } + /** + * The truncation strategy to use for the thread. The default is `auto`. If set to + * `last_messages`, the thread will be truncated to the n most recent messages in the + * thread. When set to `auto`, messages in the middle of the thread will be dropped to fit + * the context length of the model, `max_prompt_tokens`. + */ class Type @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/RunStatus.kt b/openai-java-core/src/main/kotlin/com/openai/models/RunStatus.kt index 2c1d2afc1..895a39c8a 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/RunStatus.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/RunStatus.kt @@ -7,6 +7,10 @@ import com.openai.core.Enum import com.openai.core.JsonField import com.openai.errors.OpenAIInvalidDataException +/** + * The status of the run, which can be either `queued`, `in_progress`, `requires_action`, + * `cancelling`, `cancelled`, `failed`, `completed`, `incomplete`, or `expired`. + */ class RunStatus @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/RunStep.kt b/openai-java-core/src/main/kotlin/com/openai/models/RunStep.kt index ce80dcfd3..281b4c5a6 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/RunStep.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/RunStep.kt @@ -617,6 +617,7 @@ private constructor( ) } + /** One of `server_error` or `rate_limit_exceeded`. */ class Code @JsonCreator private constructor( @@ -692,6 +693,7 @@ private constructor( "LastError{code=$code, message=$message, additionalProperties=$additionalProperties}" } + /** The object type, which is always `thread.run.step`. */ class Object @JsonCreator private constructor( @@ -743,6 +745,10 @@ private constructor( override fun toString() = value.toString() } + /** + * The status of the run step, which can be either `in_progress`, `cancelled`, `failed`, + * `completed`, or `expired`. + */ class Status @JsonCreator private constructor( @@ -921,10 +927,12 @@ private constructor( interface Visitor { + /** Details of the message creation by the run step. */ fun visitMessageCreationStepDetails( messageCreationStepDetails: MessageCreationStepDetails ): T + /** Details of the tool call. */ fun visitToolCallsStepDetails(toolCallsStepDetails: ToolCallsStepDetails): T fun unknown(json: JsonValue?): T { @@ -980,6 +988,7 @@ private constructor( } } + /** The type of run step, which can be either `message_creation` or `tool_calls`. */ class Type @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/RunStepDelta.kt b/openai-java-core/src/main/kotlin/com/openai/models/RunStepDelta.kt index 12b39f4a7..52223425a 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/RunStepDelta.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/RunStepDelta.kt @@ -220,8 +220,10 @@ private constructor( interface Visitor { + /** Details of the message creation by the run step. */ fun visitRunStepDeltaMessageDelta(runStepDeltaMessageDelta: RunStepDeltaMessageDelta): T + /** Details of the tool call. */ fun visitToolCallDeltaObject(toolCallDeltaObject: ToolCallDeltaObject): T fun unknown(json: JsonValue?): T { diff --git a/openai-java-core/src/main/kotlin/com/openai/models/RunStepDeltaEvent.kt b/openai-java-core/src/main/kotlin/com/openai/models/RunStepDeltaEvent.kt index 3f4e0139a..9a706dbb9 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/RunStepDeltaEvent.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/RunStepDeltaEvent.kt @@ -136,6 +136,7 @@ private constructor( ) } + /** The object type, which is always `thread.run.step.delta`. */ class Object @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/RunStepDeltaMessageDelta.kt b/openai-java-core/src/main/kotlin/com/openai/models/RunStepDeltaMessageDelta.kt index bcec33dd0..a342170ca 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/RunStepDeltaMessageDelta.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/RunStepDeltaMessageDelta.kt @@ -120,6 +120,7 @@ private constructor( ) } + /** Always `message_creation`. */ class Type @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/RunStepStreamEvent.kt b/openai-java-core/src/main/kotlin/com/openai/models/RunStepStreamEvent.kt index d74d5dc67..20b157f07 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/RunStepStreamEvent.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/RunStepStreamEvent.kt @@ -328,18 +328,51 @@ private constructor( interface Visitor { + /** + * Occurs when a + * [run step](https://platform.openai.com/docs/api-reference/run-steps/step-object) is + * created. + */ fun visitThreadRunStepCreated(threadRunStepCreated: ThreadRunStepCreated): T + /** + * Occurs when a + * [run step](https://platform.openai.com/docs/api-reference/run-steps/step-object) moves to + * an `in_progress` state. + */ fun visitThreadRunStepInProgress(threadRunStepInProgress: ThreadRunStepInProgress): T + /** + * Occurs when parts of a + * [run step](https://platform.openai.com/docs/api-reference/run-steps/step-object) are + * being streamed. + */ fun visitThreadRunStepDelta(threadRunStepDelta: ThreadRunStepDelta): T + /** + * Occurs when a + * [run step](https://platform.openai.com/docs/api-reference/run-steps/step-object) is + * completed. + */ fun visitThreadRunStepCompleted(threadRunStepCompleted: ThreadRunStepCompleted): T + /** + * Occurs when a + * [run step](https://platform.openai.com/docs/api-reference/run-steps/step-object) fails. + */ fun visitThreadRunStepFailed(threadRunStepFailed: ThreadRunStepFailed): T + /** + * Occurs when a + * [run step](https://platform.openai.com/docs/api-reference/run-steps/step-object) is + * cancelled. + */ fun visitThreadRunStepCancelled(threadRunStepCancelled: ThreadRunStepCancelled): T + /** + * Occurs when a + * [run step](https://platform.openai.com/docs/api-reference/run-steps/step-object) expires. + */ fun visitThreadRunStepExpired(threadRunStepExpired: ThreadRunStepExpired): T fun unknown(json: JsonValue?): T { diff --git a/openai-java-core/src/main/kotlin/com/openai/models/RunStreamEvent.kt b/openai-java-core/src/main/kotlin/com/openai/models/RunStreamEvent.kt index 9da21fa11..390975345 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/RunStreamEvent.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/RunStreamEvent.kt @@ -371,24 +371,62 @@ private constructor( interface Visitor { + /** + * Occurs when a new [run](https://platform.openai.com/docs/api-reference/runs/object) is + * created. + */ fun visitThreadRunCreated(threadRunCreated: ThreadRunCreated): T + /** + * Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) moves to + * a `queued` status. + */ fun visitThreadRunQueued(threadRunQueued: ThreadRunQueued): T + /** + * Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) moves to + * an `in_progress` status. + */ fun visitThreadRunInProgress(threadRunInProgress: ThreadRunInProgress): T + /** + * Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) moves to + * a `requires_action` status. + */ fun visitThreadRunRequiresAction(threadRunRequiresAction: ThreadRunRequiresAction): T + /** + * Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) is + * completed. + */ fun visitThreadRunCompleted(threadRunCompleted: ThreadRunCompleted): T + /** + * Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) ends with + * status `incomplete`. + */ fun visitThreadRunIncomplete(threadRunIncomplete: ThreadRunIncomplete): T + /** + * Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) fails. + */ fun visitThreadRunFailed(threadRunFailed: ThreadRunFailed): T + /** + * Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) moves to + * a `cancelling` status. + */ fun visitThreadRunCancelling(threadRunCancelling: ThreadRunCancelling): T + /** + * Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) is + * cancelled. + */ fun visitThreadRunCancelled(threadRunCancelled: ThreadRunCancelled): T + /** + * Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object) expires. + */ fun visitThreadRunExpired(threadRunExpired: ThreadRunExpired): T fun unknown(json: JsonValue?): T { diff --git a/openai-java-core/src/main/kotlin/com/openai/models/StaticFileChunkingStrategyObject.kt b/openai-java-core/src/main/kotlin/com/openai/models/StaticFileChunkingStrategyObject.kt index d5149c40e..2e1f9b70c 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/StaticFileChunkingStrategyObject.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/StaticFileChunkingStrategyObject.kt @@ -118,6 +118,7 @@ private constructor( ) } + /** Always `static`. */ class Type @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/StaticFileChunkingStrategyObjectParam.kt b/openai-java-core/src/main/kotlin/com/openai/models/StaticFileChunkingStrategyObjectParam.kt index 43f9bdb5a..dc73a6572 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/StaticFileChunkingStrategyObjectParam.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/StaticFileChunkingStrategyObjectParam.kt @@ -119,6 +119,7 @@ private constructor( ) } + /** Always `static`. */ class Type @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/TextContentBlock.kt b/openai-java-core/src/main/kotlin/com/openai/models/TextContentBlock.kt index 1fe20f220..9b2e75229 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/TextContentBlock.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/TextContentBlock.kt @@ -111,6 +111,7 @@ private constructor( ) } + /** Always `text`. */ class Type @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/TextContentBlockParam.kt b/openai-java-core/src/main/kotlin/com/openai/models/TextContentBlockParam.kt index 686be7b82..abf1729f5 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/TextContentBlockParam.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/TextContentBlockParam.kt @@ -115,6 +115,7 @@ private constructor( ) } + /** Always `text`. */ class Type @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/TextDeltaBlock.kt b/openai-java-core/src/main/kotlin/com/openai/models/TextDeltaBlock.kt index c982bb9ea..17a34115b 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/TextDeltaBlock.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/TextDeltaBlock.kt @@ -129,6 +129,7 @@ private constructor( ) } + /** Always `text`. */ class Type @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/Thread.kt b/openai-java-core/src/main/kotlin/com/openai/models/Thread.kt index 02ee933e8..1691fd440 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/Thread.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/Thread.kt @@ -210,6 +210,7 @@ private constructor( ) } + /** The object type, which is always `thread`. */ class Object @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ToolCall.kt b/openai-java-core/src/main/kotlin/com/openai/models/ToolCall.kt index 4063845d9..082d90189 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ToolCall.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ToolCall.kt @@ -129,6 +129,7 @@ private constructor( interface Visitor { + /** Details of the Code Interpreter tool call the run step was involved in. */ fun visitCodeInterpreterToolCall(codeInterpreterToolCall: CodeInterpreterToolCall): T fun visitFileSearchToolCall(fileSearchToolCall: FileSearchToolCall): T diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ToolCallDelta.kt b/openai-java-core/src/main/kotlin/com/openai/models/ToolCallDelta.kt index b36de06ea..918c3977a 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ToolCallDelta.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ToolCallDelta.kt @@ -141,6 +141,7 @@ private constructor( interface Visitor { + /** Details of the Code Interpreter tool call the run step was involved in. */ fun visitCodeInterpreterToolCallDelta( codeInterpreterToolCallDelta: CodeInterpreterToolCallDelta ): T diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ToolCallDeltaObject.kt b/openai-java-core/src/main/kotlin/com/openai/models/ToolCallDeltaObject.kt index d16bd04ca..703c02212 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ToolCallDeltaObject.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ToolCallDeltaObject.kt @@ -170,6 +170,7 @@ private constructor( ) } + /** Always `tool_calls`. */ class Type @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ToolCallsStepDetails.kt b/openai-java-core/src/main/kotlin/com/openai/models/ToolCallsStepDetails.kt index 3a908149c..ff44078c5 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ToolCallsStepDetails.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ToolCallsStepDetails.kt @@ -168,6 +168,7 @@ private constructor( ) } + /** Always `tool_calls`. */ class Type @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/Upload.kt b/openai-java-core/src/main/kotlin/com/openai/models/Upload.kt index 433357efe..edb7b0ad3 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/Upload.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/Upload.kt @@ -268,6 +268,7 @@ private constructor( ) } + /** The object type, which is always "upload". */ class Object @JsonCreator private constructor( @@ -319,6 +320,7 @@ private constructor( override fun toString() = value.toString() } + /** The status of the Upload. */ class Status @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/UploadPart.kt b/openai-java-core/src/main/kotlin/com/openai/models/UploadPart.kt index 355943b34..635e76264 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/UploadPart.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/UploadPart.kt @@ -155,6 +155,7 @@ private constructor( ) } + /** The object type, which is always `upload.part`. */ class Object @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/VectorStore.kt b/openai-java-core/src/main/kotlin/com/openai/models/VectorStore.kt index 830a35110..962be7410 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/VectorStore.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/VectorStore.kt @@ -495,6 +495,7 @@ private constructor( "FileCounts{cancelled=$cancelled, completed=$completed, failed=$failed, inProgress=$inProgress, total=$total, additionalProperties=$additionalProperties}" } + /** The object type, which is always `vector_store`. */ class Object @JsonCreator private constructor( @@ -546,6 +547,10 @@ private constructor( override fun toString() = value.toString() } + /** + * The status of the vector store, which can be either `expired`, `in_progress`, or `completed`. + * A status of `completed` indicates that the vector store is ready for use. + */ class Status @JsonCreator private constructor( @@ -721,6 +726,10 @@ private constructor( ) } + /** + * Anchor timestamp after which the expiration policy applies. Supported anchors: + * `last_active_at`. + */ class Anchor @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/VectorStoreFile.kt b/openai-java-core/src/main/kotlin/com/openai/models/VectorStoreFile.kt index df9510c56..3457ae188 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/VectorStoreFile.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/VectorStoreFile.kt @@ -423,6 +423,7 @@ private constructor( ) } + /** One of `server_error` or `rate_limit_exceeded`. */ class Code @JsonCreator private constructor( @@ -504,6 +505,7 @@ private constructor( "LastError{code=$code, message=$message, additionalProperties=$additionalProperties}" } + /** The object type, which is always `vector_store.file`. */ class Object @JsonCreator private constructor( @@ -555,6 +557,11 @@ private constructor( override fun toString() = value.toString() } + /** + * The status of the vector store file, which can be either `in_progress`, `completed`, + * `cancelled`, or `failed`. The status `completed` indicates that the vector store file is + * ready for use. + */ class Status @JsonCreator private constructor( diff --git a/openai-java-core/src/main/kotlin/com/openai/models/VectorStoreFileBatch.kt b/openai-java-core/src/main/kotlin/com/openai/models/VectorStoreFileBatch.kt index 78b232f2e..94e53907f 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/VectorStoreFileBatch.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/VectorStoreFileBatch.kt @@ -399,6 +399,7 @@ private constructor( "FileCounts{cancelled=$cancelled, completed=$completed, failed=$failed, inProgress=$inProgress, total=$total, additionalProperties=$additionalProperties}" } + /** The object type, which is always `vector_store.file_batch`. */ class Object @JsonCreator private constructor( @@ -450,6 +451,10 @@ private constructor( override fun toString() = value.toString() } + /** + * The status of the vector store files batch, which can be either `in_progress`, `completed`, + * `cancelled` or `failed`. + */ class Status @JsonCreator private constructor(