diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 8a1d7a10..d1ed374d 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -1,6 +1,6 @@ plugins { `kotlin-dsl` - kotlin("jvm") version "2.1.0" + kotlin("jvm") version "2.1.10" id("com.vanniktech.maven.publish") version "0.28.0" } @@ -10,7 +10,7 @@ repositories { } dependencies { - implementation("com.diffplug.spotless:spotless-plugin-gradle:6.25.0") - implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.23") + implementation("com.diffplug.spotless:spotless-plugin-gradle:7.0.2") + implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:2.1.10") implementation("com.vanniktech:gradle-maven-publish-plugin:0.28.0") } diff --git a/buildSrc/src/main/kotlin/openai.java.gradle.kts b/buildSrc/src/main/kotlin/openai.java.gradle.kts index a2c35b93..597b6e80 100644 --- a/buildSrc/src/main/kotlin/openai.java.gradle.kts +++ b/buildSrc/src/main/kotlin/openai.java.gradle.kts @@ -39,9 +39,13 @@ tasks.named("jar") { } } -tasks.named("test") { +tasks.withType().configureEach { useJUnitPlatform() + // Run tests in parallel to some degree. + maxParallelForks = (Runtime.getRuntime().availableProcessors() / 2).coerceAtLeast(1) + forkEvery = 100 + testLogging { exceptionFormat = TestExceptionFormat.FULL } diff --git a/buildSrc/src/main/kotlin/openai.kotlin.gradle.kts b/buildSrc/src/main/kotlin/openai.kotlin.gradle.kts index b5027a76..977ff80b 100644 --- a/buildSrc/src/main/kotlin/openai.kotlin.gradle.kts +++ b/buildSrc/src/main/kotlin/openai.kotlin.gradle.kts @@ -1,4 +1,5 @@ import com.diffplug.gradle.spotless.SpotlessExtension +import org.jetbrains.kotlin.gradle.dsl.JvmTarget import org.jetbrains.kotlin.gradle.tasks.KotlinCompile plugins { @@ -20,13 +21,19 @@ configure { } tasks.withType().configureEach { - kotlinOptions { + compilerOptions { 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" + jvmTarget.set(JvmTarget.JVM_1_8) } } + +// Run tests in parallel to some degree. +tasks.withType().configureEach { + maxParallelForks = (Runtime.getRuntime().availableProcessors() / 2).coerceAtLeast(1) + forkEvery = 100 +} diff --git a/gradle.properties b/gradle.properties index a3bc58f2..ec5c5092 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,6 @@ +org.gradle.configuration-cache=true org.gradle.caching=true -org.gradle.jvmargs=-Xmx4g org.gradle.parallel=true +org.gradle.daemon=false +org.gradle.jvmargs=-Xmx4g kotlin.daemon.jvmargs=-Xmx4g diff --git a/openai-java-client-okhttp/src/main/kotlin/com/openai/client/okhttp/OkHttpClient.kt b/openai-java-client-okhttp/src/main/kotlin/com/openai/client/okhttp/OkHttpClient.kt index 7aa0a252..409bcf9d 100644 --- a/openai-java-client-okhttp/src/main/kotlin/com/openai/client/okhttp/OkHttpClient.kt +++ b/openai-java-client-okhttp/src/main/kotlin/com/openai/client/okhttp/OkHttpClient.kt @@ -31,10 +31,7 @@ class OkHttpClient private constructor(private val okHttpClient: okhttp3.OkHttpClient, private val baseUrl: HttpUrl) : HttpClient { - override fun execute( - request: HttpRequest, - requestOptions: RequestOptions, - ): HttpResponse { + override fun execute(request: HttpRequest, requestOptions: RequestOptions): HttpResponse { val call = newCall(request, requestOptions) return try { @@ -120,13 +117,13 @@ private constructor(private val okHttpClient: okhttp3.OkHttpClient, private val ) { builder.header( "X-Stainless-Read-Timeout", - Duration.ofMillis(client.readTimeoutMillis.toLong()).seconds.toString() + Duration.ofMillis(client.readTimeoutMillis.toLong()).seconds.toString(), ) } if (!headers.names().contains("X-Stainless-Timeout") && client.callTimeoutMillis != 0) { builder.header( "X-Stainless-Timeout", - Duration.ofMillis(client.callTimeoutMillis.toLong()).seconds.toString() + Duration.ofMillis(client.callTimeoutMillis.toLong()).seconds.toString(), ) } diff --git a/openai-java-core/src/main/kotlin/com/openai/azure/HttpRequestBuilderExtensions.kt b/openai-java-core/src/main/kotlin/com/openai/azure/HttpRequestBuilderExtensions.kt index c45a696e..2530d3a2 100644 --- a/openai-java-core/src/main/kotlin/com/openai/azure/HttpRequestBuilderExtensions.kt +++ b/openai-java-core/src/main/kotlin/com/openai/azure/HttpRequestBuilderExtensions.kt @@ -8,7 +8,7 @@ import com.openai.credential.BearerTokenCredential @JvmSynthetic internal fun HttpRequest.Builder.addPathSegmentsForAzure( clientOptions: ClientOptions, - deploymentModel: String? + deploymentModel: String?, ): HttpRequest.Builder = apply { if (isAzureEndpoint(clientOptions.baseUrl) && deploymentModel != null) { addPathSegments("openai", "deployments", deploymentModel) diff --git a/openai-java-core/src/main/kotlin/com/openai/client/OpenAIClientAsyncImpl.kt b/openai-java-core/src/main/kotlin/com/openai/client/OpenAIClientAsyncImpl.kt index 737ca9c2..d69c816f 100644 --- a/openai-java-core/src/main/kotlin/com/openai/client/OpenAIClientAsyncImpl.kt +++ b/openai-java-core/src/main/kotlin/com/openai/client/OpenAIClientAsyncImpl.kt @@ -27,9 +27,7 @@ import com.openai.services.async.ModerationServiceAsyncImpl import com.openai.services.async.UploadServiceAsync import com.openai.services.async.UploadServiceAsyncImpl -class OpenAIClientAsyncImpl( - private val clientOptions: ClientOptions, -) : OpenAIClientAsync { +class OpenAIClientAsyncImpl(private val clientOptions: ClientOptions) : OpenAIClientAsync { private val clientOptionsWithUserAgent = if (clientOptions.headers.names().contains("User-Agent")) clientOptions diff --git a/openai-java-core/src/main/kotlin/com/openai/client/OpenAIClientImpl.kt b/openai-java-core/src/main/kotlin/com/openai/client/OpenAIClientImpl.kt index 53b181c2..bc2e8927 100644 --- a/openai-java-core/src/main/kotlin/com/openai/client/OpenAIClientImpl.kt +++ b/openai-java-core/src/main/kotlin/com/openai/client/OpenAIClientImpl.kt @@ -27,9 +27,7 @@ import com.openai.services.blocking.ModerationServiceImpl import com.openai.services.blocking.UploadService import com.openai.services.blocking.UploadServiceImpl -class OpenAIClientImpl( - private val clientOptions: ClientOptions, -) : OpenAIClient { +class OpenAIClientImpl(private val clientOptions: ClientOptions) : OpenAIClient { private val clientOptionsWithUserAgent = if (clientOptions.headers.names().contains("User-Agent")) clientOptions diff --git a/openai-java-core/src/main/kotlin/com/openai/core/BaseDeserializer.kt b/openai-java-core/src/main/kotlin/com/openai/core/BaseDeserializer.kt index f382d1eb..5b549044 100644 --- a/openai-java-core/src/main/kotlin/com/openai/core/BaseDeserializer.kt +++ b/openai-java-core/src/main/kotlin/com/openai/core/BaseDeserializer.kt @@ -18,7 +18,7 @@ abstract class BaseDeserializer(type: KClass) : override fun createContextual( context: DeserializationContext, - property: BeanProperty? + property: BeanProperty?, ): JsonDeserializer { return this } @@ -32,7 +32,7 @@ abstract class BaseDeserializer(type: KClass) : protected fun ObjectCodec.tryDeserialize( node: JsonNode, type: TypeReference, - validate: (T) -> Unit = {} + validate: (T) -> Unit = {}, ): T? { return try { readValue(treeAsTokens(node), type).apply(validate) @@ -46,7 +46,7 @@ abstract class BaseDeserializer(type: KClass) : protected fun ObjectCodec.tryDeserialize( node: JsonNode, type: JavaType, - validate: (T) -> Unit = {} + validate: (T) -> Unit = {}, ): T? { return try { readValue(treeAsTokens(node), type).apply(validate) diff --git a/openai-java-core/src/main/kotlin/com/openai/core/HttpRequestBodies.kt b/openai-java-core/src/main/kotlin/com/openai/core/HttpRequestBodies.kt index 1af6841a..253e7e53 100644 --- a/openai-java-core/src/main/kotlin/com/openai/core/HttpRequestBodies.kt +++ b/openai-java-core/src/main/kotlin/com/openai/core/HttpRequestBodies.kt @@ -10,10 +10,7 @@ import java.io.OutputStream import org.apache.hc.client5.http.entity.mime.MultipartEntityBuilder @JvmSynthetic -internal inline fun json( - jsonMapper: JsonMapper, - value: T, -): HttpRequestBody { +internal inline fun json(jsonMapper: JsonMapper, value: T): HttpRequestBody { return object : HttpRequestBody { private var cachedBytes: ByteArray? = null @@ -49,7 +46,7 @@ internal inline fun json( @JvmSynthetic internal fun multipartFormData( jsonMapper: JsonMapper, - parts: Array?> + parts: Array?>, ): HttpRequestBody { val builder = MultipartEntityBuilder.create() parts.forEach { part -> @@ -66,14 +63,14 @@ internal fun multipartFormData( part.name, buffer.toByteArray(), part.contentType, - part.filename + part.filename, ) } is Boolean -> builder.addTextBody( part.name, if (part.value) "true" else "false", - part.contentType + part.contentType, ) is Int -> builder.addTextBody(part.name, part.value.toString(), part.contentType) is Long -> builder.addTextBody(part.name, part.value.toString(), part.contentType) diff --git a/openai-java-core/src/main/kotlin/com/openai/core/PrepareRequest.kt b/openai-java-core/src/main/kotlin/com/openai/core/PrepareRequest.kt index ab0c04b4..1ae7f533 100644 --- a/openai-java-core/src/main/kotlin/com/openai/core/PrepareRequest.kt +++ b/openai-java-core/src/main/kotlin/com/openai/core/PrepareRequest.kt @@ -11,7 +11,7 @@ import java.util.concurrent.CompletableFuture internal fun HttpRequest.prepare( clientOptions: ClientOptions, params: Params, - deploymentModel: String? + deploymentModel: String?, ): HttpRequest = toBuilder() // Clear the path segments and add them back below after the Azure path segments. @@ -29,7 +29,7 @@ internal fun HttpRequest.prepare( internal fun HttpRequest.prepareAsync( clientOptions: ClientOptions, params: Params, - deploymentModel: String? + deploymentModel: String?, ): CompletableFuture = // This async version exists to make it easier to add async specific preparation logic in the // future. diff --git a/openai-java-core/src/main/kotlin/com/openai/core/RequestOptions.kt b/openai-java-core/src/main/kotlin/com/openai/core/RequestOptions.kt index 9b4a7c40..c72629c4 100644 --- a/openai-java-core/src/main/kotlin/com/openai/core/RequestOptions.kt +++ b/openai-java-core/src/main/kotlin/com/openai/core/RequestOptions.kt @@ -2,11 +2,7 @@ package com.openai.core import java.time.Duration -class RequestOptions -private constructor( - val responseValidation: Boolean?, - val timeout: Duration?, -) { +class RequestOptions private constructor(val responseValidation: Boolean?, val timeout: Duration?) { fun applyDefaults(options: RequestOptions): RequestOptions { return RequestOptions( responseValidation = this.responseValidation ?: options.responseValidation, diff --git a/openai-java-core/src/main/kotlin/com/openai/core/Values.kt b/openai-java-core/src/main/kotlin/com/openai/core/Values.kt index 1cf968e2..38a87788 100644 --- a/openai-java-core/src/main/kotlin/com/openai/core/Values.kt +++ b/openai-java-core/src/main/kotlin/com/openai/core/Values.kt @@ -287,7 +287,7 @@ class JsonMissing : JsonValue() { override fun serialize( value: JsonMissing, generator: JsonGenerator, - provider: SerializerProvider + provider: SerializerProvider, ) { throw RuntimeException("JsonMissing cannot be serialized") } @@ -422,10 +422,7 @@ private constructor( } @JacksonAnnotationsInside -@JsonInclude( - JsonInclude.Include.CUSTOM, - valueFilter = JsonField.IsMissing::class, -) +@JsonInclude(JsonInclude.Include.CUSTOM, valueFilter = JsonField.IsMissing::class) annotation class ExcludeMissing @JacksonAnnotationsInside @@ -434,7 +431,7 @@ annotation class ExcludeMissing isGetterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE, creatorVisibility = Visibility.NONE, - fieldVisibility = Visibility.NONE + fieldVisibility = Visibility.NONE, ) annotation class NoAutoDetect @@ -443,7 +440,7 @@ internal constructor( val name: String, val value: T, val contentType: ContentType, - val filename: String? = null + val filename: String? = null, ) { private var hashCode: Int = 0 @@ -462,7 +459,7 @@ internal constructor( is Long -> value is Double -> value else -> value?.hashCode() - } + }, ) } return hashCode @@ -496,7 +493,7 @@ internal constructor( internal fun fromString( name: String, value: String, - contentType: ContentType + contentType: ContentType, ): MultipartFormValue = MultipartFormValue(name, value, contentType) internal fun fromBoolean( @@ -520,14 +517,14 @@ internal constructor( internal fun fromEnum( name: String, value: T, - contentType: ContentType + contentType: ContentType, ): MultipartFormValue = MultipartFormValue(name, value, contentType) internal fun fromByteArray( name: String, value: ByteArray, contentType: ContentType, - filename: String? = null + filename: String? = null, ): MultipartFormValue = MultipartFormValue(name, value, contentType, filename) } } diff --git a/openai-java-core/src/main/kotlin/com/openai/core/handlers/SseHandler.kt b/openai-java-core/src/main/kotlin/com/openai/core/handlers/SseHandler.kt index 82476f9f..4797c9e9 100644 --- a/openai-java-core/src/main/kotlin/com/openai/core/handlers/SseHandler.kt +++ b/openai-java-core/src/main/kotlin/com/openai/core/handlers/SseHandler.kt @@ -50,7 +50,7 @@ private class SseState( var event: String? = null, val data: MutableList = mutableListOf(), var lastId: String? = null, - var retry: Int? = null + var retry: Int? = null, ) { // https://html.spec.whatwg.org/multipage/server-sent-events.html#event-stream-interpretation fun decode(line: String): SseMessage? { diff --git a/openai-java-core/src/main/kotlin/com/openai/core/http/AsyncStreamResponse.kt b/openai-java-core/src/main/kotlin/com/openai/core/http/AsyncStreamResponse.kt index 90288990..0e240930 100644 --- a/openai-java-core/src/main/kotlin/com/openai/core/http/AsyncStreamResponse.kt +++ b/openai-java-core/src/main/kotlin/com/openai/core/http/AsyncStreamResponse.kt @@ -40,7 +40,7 @@ internal fun CompletableFuture>.toAsync(streamHandlerExecu override fun subscribe( handler: Handler, - executor: Executor + executor: Executor, ): AsyncStreamResponse = apply { // TODO(JDK): Use `compareAndExchange` once targeting JDK 9. check(state.compareAndSet(State.NEW, State.SUBSCRIBED)) { @@ -75,7 +75,7 @@ internal fun CompletableFuture>.toAsync(streamHandlerExecu close() } }, - executor + executor, ) } @@ -93,5 +93,5 @@ internal fun CompletableFuture>.toAsync(streamHandlerExecu private enum class State { NEW, SUBSCRIBED, - CLOSED + CLOSED, } diff --git a/openai-java-core/src/main/kotlin/com/openai/core/http/Headers.kt b/openai-java-core/src/main/kotlin/com/openai/core/http/Headers.kt index 508fe916..ba5b242f 100644 --- a/openai-java-core/src/main/kotlin/com/openai/core/http/Headers.kt +++ b/openai-java-core/src/main/kotlin/com/openai/core/http/Headers.kt @@ -6,7 +6,7 @@ import java.util.TreeMap class Headers private constructor( private val map: Map>, - @get:JvmName("size") val size: Int + @get:JvmName("size") val size: Int, ) { fun isEmpty(): Boolean = map.isEmpty() @@ -74,7 +74,7 @@ private constructor( values.toImmutable() } .toImmutable(), - size + size, ) } diff --git a/openai-java-core/src/main/kotlin/com/openai/core/http/PhantomReachableClosingHttpClient.kt b/openai-java-core/src/main/kotlin/com/openai/core/http/PhantomReachableClosingHttpClient.kt index 43c0f4c0..4d891cc6 100644 --- a/openai-java-core/src/main/kotlin/com/openai/core/http/PhantomReachableClosingHttpClient.kt +++ b/openai-java-core/src/main/kotlin/com/openai/core/http/PhantomReachableClosingHttpClient.kt @@ -19,7 +19,7 @@ internal class PhantomReachableClosingHttpClient(private val httpClient: HttpCli override fun executeAsync( request: HttpRequest, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture = httpClient.executeAsync(request, requestOptions) override fun close() = httpClient.close() diff --git a/openai-java-core/src/main/kotlin/com/openai/core/http/QueryParams.kt b/openai-java-core/src/main/kotlin/com/openai/core/http/QueryParams.kt index 00a1009a..ba39d9e4 100644 --- a/openai-java-core/src/main/kotlin/com/openai/core/http/QueryParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/core/http/QueryParams.kt @@ -5,7 +5,7 @@ import com.openai.core.toImmutable class QueryParams private constructor( private val map: Map>, - @get:JvmName("size") val size: Int + @get:JvmName("size") val size: Int, ) { fun isEmpty(): Boolean = map.isEmpty() diff --git a/openai-java-core/src/main/kotlin/com/openai/core/http/RetryingHttpClient.kt b/openai-java-core/src/main/kotlin/com/openai/core/http/RetryingHttpClient.kt index f74d19a9..274ae58b 100644 --- a/openai-java-core/src/main/kotlin/com/openai/core/http/RetryingHttpClient.kt +++ b/openai-java-core/src/main/kotlin/com/openai/core/http/RetryingHttpClient.kt @@ -28,10 +28,7 @@ private constructor( private val idempotencyHeader: String?, ) : HttpClient { - override fun execute( - request: HttpRequest, - requestOptions: RequestOptions, - ): HttpResponse { + override fun execute(request: HttpRequest, requestOptions: RequestOptions): HttpResponse { if (!isRetryable(request) || maxRetries <= 0) { return httpClient.execute(request, requestOptions) } @@ -100,7 +97,7 @@ private constructor( .handleAsync( fun( response: HttpResponse?, - throwable: Throwable? + throwable: Throwable?, ): CompletableFuture { if (response != null) { if (++retries > maxRetries || !shouldRetry(response)) { @@ -120,7 +117,7 @@ private constructor( return sleepAsync(backoffMillis.toMillis()).thenCompose { executeWithRetries(requestWithRetryCount, requestOptions) } - }, + } ) { // Run in the same thread. it.run() @@ -200,8 +197,8 @@ private constructor( OffsetDateTime.now(clock), OffsetDateTime.parse( retryAfter, - DateTimeFormatter.RFC_1123_DATE_TIME - ) + DateTimeFormatter.RFC_1123_DATE_TIME, + ), ) } catch (e: DateTimeParseException) { null @@ -239,7 +236,7 @@ private constructor( future.complete(null) } }, - millis + millis, ) return future } diff --git a/openai-java-core/src/main/kotlin/com/openai/errors/BadRequestException.kt b/openai-java-core/src/main/kotlin/com/openai/errors/BadRequestException.kt index d793e186..64fd9146 100644 --- a/openai-java-core/src/main/kotlin/com/openai/errors/BadRequestException.kt +++ b/openai-java-core/src/main/kotlin/com/openai/errors/BadRequestException.kt @@ -2,8 +2,5 @@ package com.openai.errors import com.openai.core.http.Headers -class BadRequestException( - headers: Headers, - body: String, - error: OpenAIError, -) : OpenAIServiceException(400, headers, body, error) +class BadRequestException(headers: Headers, body: String, error: OpenAIError) : + OpenAIServiceException(400, headers, body, error) diff --git a/openai-java-core/src/main/kotlin/com/openai/errors/InternalServerException.kt b/openai-java-core/src/main/kotlin/com/openai/errors/InternalServerException.kt index a89ff2b7..5c5a37ea 100644 --- a/openai-java-core/src/main/kotlin/com/openai/errors/InternalServerException.kt +++ b/openai-java-core/src/main/kotlin/com/openai/errors/InternalServerException.kt @@ -2,9 +2,5 @@ package com.openai.errors import com.openai.core.http.Headers -class InternalServerException( - statusCode: Int, - headers: Headers, - body: String, - error: OpenAIError, -) : OpenAIServiceException(statusCode, headers, body, error) +class InternalServerException(statusCode: Int, headers: Headers, body: String, error: OpenAIError) : + OpenAIServiceException(statusCode, headers, body, error) diff --git a/openai-java-core/src/main/kotlin/com/openai/errors/NotFoundException.kt b/openai-java-core/src/main/kotlin/com/openai/errors/NotFoundException.kt index fb10dd59..9904cc66 100644 --- a/openai-java-core/src/main/kotlin/com/openai/errors/NotFoundException.kt +++ b/openai-java-core/src/main/kotlin/com/openai/errors/NotFoundException.kt @@ -2,8 +2,5 @@ package com.openai.errors import com.openai.core.http.Headers -class NotFoundException( - headers: Headers, - body: String, - error: OpenAIError, -) : OpenAIServiceException(404, headers, body, error) +class NotFoundException(headers: Headers, body: String, error: OpenAIError) : + OpenAIServiceException(404, headers, body, error) diff --git a/openai-java-core/src/main/kotlin/com/openai/errors/OpenAIError.kt b/openai-java-core/src/main/kotlin/com/openai/errors/OpenAIError.kt index 9508dc2c..343f946c 100644 --- a/openai-java-core/src/main/kotlin/com/openai/errors/OpenAIError.kt +++ b/openai-java-core/src/main/kotlin/com/openai/errors/OpenAIError.kt @@ -20,7 +20,7 @@ private constructor( @ExcludeMissing @JsonAnySetter @get:JvmName("additionalProperties") - val additionalProperties: Map = immutableEmptyMap(), + val additionalProperties: Map = immutableEmptyMap() ) { fun toBuilder() = Builder().from(this) diff --git a/openai-java-core/src/main/kotlin/com/openai/errors/OpenAIServiceException.kt b/openai-java-core/src/main/kotlin/com/openai/errors/OpenAIServiceException.kt index 901ff393..1e6bcca8 100644 --- a/openai-java-core/src/main/kotlin/com/openai/errors/OpenAIServiceException.kt +++ b/openai-java-core/src/main/kotlin/com/openai/errors/OpenAIServiceException.kt @@ -10,7 +10,7 @@ constructor( private val body: String, private val error: OpenAIError, message: String = "$statusCode: $error", - cause: Throwable? = null + cause: Throwable? = null, ) : OpenAIException(message, cause) { fun statusCode(): Int = statusCode diff --git a/openai-java-core/src/main/kotlin/com/openai/errors/PermissionDeniedException.kt b/openai-java-core/src/main/kotlin/com/openai/errors/PermissionDeniedException.kt index 03191fd7..b7680679 100644 --- a/openai-java-core/src/main/kotlin/com/openai/errors/PermissionDeniedException.kt +++ b/openai-java-core/src/main/kotlin/com/openai/errors/PermissionDeniedException.kt @@ -2,8 +2,5 @@ package com.openai.errors import com.openai.core.http.Headers -class PermissionDeniedException( - headers: Headers, - body: String, - error: OpenAIError, -) : OpenAIServiceException(403, headers, body, error) +class PermissionDeniedException(headers: Headers, body: String, error: OpenAIError) : + OpenAIServiceException(403, headers, body, error) diff --git a/openai-java-core/src/main/kotlin/com/openai/errors/RateLimitException.kt b/openai-java-core/src/main/kotlin/com/openai/errors/RateLimitException.kt index 2851cb88..a3bf052b 100644 --- a/openai-java-core/src/main/kotlin/com/openai/errors/RateLimitException.kt +++ b/openai-java-core/src/main/kotlin/com/openai/errors/RateLimitException.kt @@ -2,8 +2,5 @@ package com.openai.errors import com.openai.core.http.Headers -class RateLimitException( - headers: Headers, - body: String, - error: OpenAIError, -) : OpenAIServiceException(429, headers, body, error) +class RateLimitException(headers: Headers, body: String, error: OpenAIError) : + OpenAIServiceException(429, headers, body, error) diff --git a/openai-java-core/src/main/kotlin/com/openai/errors/UnauthorizedException.kt b/openai-java-core/src/main/kotlin/com/openai/errors/UnauthorizedException.kt index 2813395f..b752c2db 100644 --- a/openai-java-core/src/main/kotlin/com/openai/errors/UnauthorizedException.kt +++ b/openai-java-core/src/main/kotlin/com/openai/errors/UnauthorizedException.kt @@ -2,8 +2,5 @@ package com.openai.errors import com.openai.core.http.Headers -class UnauthorizedException( - headers: Headers, - body: String, - error: OpenAIError, -) : OpenAIServiceException(401, headers, body, error) +class UnauthorizedException(headers: Headers, body: String, error: OpenAIError) : + OpenAIServiceException(401, headers, body, error) diff --git a/openai-java-core/src/main/kotlin/com/openai/errors/UnprocessableEntityException.kt b/openai-java-core/src/main/kotlin/com/openai/errors/UnprocessableEntityException.kt index 46d3464e..64610dfc 100644 --- a/openai-java-core/src/main/kotlin/com/openai/errors/UnprocessableEntityException.kt +++ b/openai-java-core/src/main/kotlin/com/openai/errors/UnprocessableEntityException.kt @@ -2,8 +2,5 @@ package com.openai.errors import com.openai.core.http.Headers -class UnprocessableEntityException( - headers: Headers, - body: String, - error: OpenAIError, -) : OpenAIServiceException(422, headers, body, error) +class UnprocessableEntityException(headers: Headers, body: String, error: OpenAIError) : + OpenAIServiceException(422, headers, body, error) 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 487dd69a..cb7a15d3 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 @@ -189,7 +189,7 @@ private constructor( override fun serialize( value: Annotation, generator: JsonGenerator, - provider: SerializerProvider + provider: SerializerProvider, ) { when { value.fileCitation != null -> generator.writeObject(value.fileCitation) 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 7eb9f641..410e0160 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 @@ -198,7 +198,7 @@ private constructor( override fun serialize( value: AnnotationDelta, generator: JsonGenerator, - provider: SerializerProvider + provider: SerializerProvider, ) { when { value.fileCitation != null -> generator.writeObject(value.fileCitation) 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 1816c3df..7b80a02e 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 @@ -848,11 +848,7 @@ private constructor( } fun build(): ToolResources = - ToolResources( - codeInterpreter, - fileSearch, - additionalProperties.toImmutable(), - ) + ToolResources(codeInterpreter, fileSearch, additionalProperties.toImmutable()) } @NoAutoDetect @@ -976,7 +972,7 @@ private constructor( fun build(): CodeInterpreter = CodeInterpreter( (fileIds ?: JsonMissing.of()).map { it.toImmutable() }, - additionalProperties.toImmutable() + additionalProperties.toImmutable(), ) } @@ -1125,7 +1121,7 @@ private constructor( fun build(): FileSearch = FileSearch( (vectorStoreIds ?: JsonMissing.of()).map { it.toImmutable() }, - additionalProperties.toImmutable() + additionalProperties.toImmutable(), ) } 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 2ed580f3..9f2f3fe9 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 @@ -225,14 +225,14 @@ private constructor( ?.let { return AssistantResponseFormatOption( responseFormatJsonObject = it, - _json = json + _json = json, ) } tryDeserialize(node, jacksonTypeRef()) { it.validate() } ?.let { return AssistantResponseFormatOption( responseFormatJsonSchema = it, - _json = json + _json = json, ) } @@ -246,7 +246,7 @@ private constructor( override fun serialize( value: AssistantResponseFormatOption, generator: JsonGenerator, - provider: SerializerProvider + provider: SerializerProvider, ) { when { value.auto != null -> generator.writeObject(value.auto) 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 86c6ad82..19e1fc07 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 @@ -1198,7 +1198,7 @@ private constructor( override fun serialize( value: AssistantStreamEvent, generator: JsonGenerator, - provider: SerializerProvider + provider: SerializerProvider, ) { when { value.threadCreated != null -> generator.writeObject(value.threadCreated) @@ -4227,11 +4227,7 @@ private constructor( } fun build(): ErrorEvent = - ErrorEvent( - checkRequired("data", data), - event, - additionalProperties.toImmutable(), - ) + ErrorEvent(checkRequired("data", data), event, additionalProperties.toImmutable()) } override fun equals(other: Any?): Boolean { diff --git a/openai-java-core/src/main/kotlin/com/openai/models/AssistantTool.kt b/openai-java-core/src/main/kotlin/com/openai/models/AssistantTool.kt index 06b06179..4c18f02c 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/AssistantTool.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/AssistantTool.kt @@ -174,7 +174,7 @@ private constructor( override fun serialize( value: AssistantTool, generator: JsonGenerator, - provider: SerializerProvider + provider: SerializerProvider, ) { when { value.codeInterpreter != null -> generator.writeObject(value.codeInterpreter) 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 c6eecedd..7621a080 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 @@ -121,11 +121,7 @@ private constructor( } /** The type of the tool. If type is `function`, the function name must be set */ - class Type - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Type @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. diff --git a/openai-java-core/src/main/kotlin/com/openai/models/AssistantToolChoiceFunction.kt b/openai-java-core/src/main/kotlin/com/openai/models/AssistantToolChoiceFunction.kt index b01f621b..a19ebcf2 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/AssistantToolChoiceFunction.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/AssistantToolChoiceFunction.kt @@ -92,7 +92,7 @@ private constructor( fun build(): AssistantToolChoiceFunction = AssistantToolChoiceFunction( checkRequired("name", name), - additionalProperties.toImmutable() + additionalProperties.toImmutable(), ) } 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 8b0e9348..e8f45bc7 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 @@ -185,7 +185,7 @@ private constructor( override fun serialize( value: AssistantToolChoiceOption, generator: JsonGenerator, - provider: SerializerProvider + provider: SerializerProvider, ) { when { value.auto != null -> generator.writeObject(value.auto) @@ -202,11 +202,7 @@ private constructor( * 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 Auto - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Auto @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. 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 6b99b3c2..18407604 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 @@ -517,11 +517,7 @@ private constructor( } /** The current status of the batch. */ - class Status - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Status @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. 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 9d5aaa10..0a277363 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 @@ -627,11 +627,8 @@ private constructor( /** * The time frame within which the batch should be processed. Currently only `24h` is supported. */ - class CompletionWindow - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class CompletionWindow @JsonCreator private constructor(private val value: JsonField) : + Enum { /** * Returns this class instance's raw value. @@ -652,7 +649,7 @@ private constructor( /** An enum containing [CompletionWindow]'s known values. */ enum class Known { - _24H, + _24H } /** @@ -721,11 +718,7 @@ private constructor( * `/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( - private val value: JsonField, - ) : Enum { + class Endpoint @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. diff --git a/openai-java-core/src/main/kotlin/com/openai/models/BatchError.kt b/openai-java-core/src/main/kotlin/com/openai/models/BatchError.kt index c9688668..33eee763 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/BatchError.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/BatchError.kt @@ -150,13 +150,7 @@ private constructor( } fun build(): BatchError = - BatchError( - code, - line, - message, - param, - additionalProperties.toImmutable(), - ) + BatchError(code, line, message, param, additionalProperties.toImmutable()) } override fun equals(other: Any?): Boolean { 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 7a39f3aa..81d3e2a7 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 @@ -68,11 +68,7 @@ private constructor( @JvmStatic fun of(batchesService: BatchService, params: BatchListParams, response: Response) = - BatchListPage( - batchesService, - params, - response, - ) + BatchListPage(batchesService, params, response) } @NoAutoDetect @@ -156,18 +152,11 @@ private constructor( this.additionalProperties.put(key, value) } - fun build() = - Response( - data, - hasMore, - additionalProperties.toImmutable(), - ) + fun build() = Response(data, hasMore, additionalProperties.toImmutable()) } } - class AutoPager( - private val firstPage: BatchListPage, - ) : Iterable { + class AutoPager(private val firstPage: BatchListPage) : Iterable { override fun iterator(): Iterator = iterator { var page = firstPage 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 a1799551..1479fd04 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 @@ -71,11 +71,7 @@ private constructor( @JvmStatic fun of(batchesService: BatchServiceAsync, params: BatchListParams, response: Response) = - BatchListPageAsync( - batchesService, - params, - response, - ) + BatchListPageAsync(batchesService, params, response) } @NoAutoDetect @@ -159,23 +155,16 @@ private constructor( this.additionalProperties.put(key, value) } - fun build() = - Response( - data, - hasMore, - additionalProperties.toImmutable(), - ) + fun build() = Response(data, hasMore, additionalProperties.toImmutable()) } } - class AutoPager( - private val firstPage: BatchListPageAsync, - ) { + class AutoPager(private val firstPage: BatchListPageAsync) { fun forEach(action: Predicate, executor: Executor): CompletableFuture { fun CompletableFuture>.forEach( action: (Batch) -> Boolean, - executor: Executor + executor: Executor, ): CompletableFuture = thenComposeAsync( { page -> @@ -184,7 +173,7 @@ private constructor( .map { it.getNextPage().forEach(action, executor) } .orElseGet { CompletableFuture.completedFuture(null) } }, - executor + executor, ) return CompletableFuture.completedFuture(Optional.of(firstPage)) .forEach(action::test, executor) diff --git a/openai-java-core/src/main/kotlin/com/openai/models/BatchListParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/BatchListParams.kt index c758f343..25d77a98 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/BatchListParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/BatchListParams.kt @@ -203,12 +203,7 @@ private constructor( } fun build(): BatchListParams = - BatchListParams( - after, - limit, - additionalHeaders.build(), - additionalQueryParams.build(), - ) + BatchListParams(after, limit, additionalHeaders.build(), additionalQueryParams.build()) } override fun equals(other: Any?): Boolean { diff --git a/openai-java-core/src/main/kotlin/com/openai/models/BetaAssistantCreateParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/BetaAssistantCreateParams.kt index 51a37772..49d39ebf 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/BetaAssistantCreateParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/BetaAssistantCreateParams.kt @@ -1582,11 +1582,8 @@ private constructor( * values are `low`, `medium`, and `high`. Reducing reasoning effort can result in faster * responses and fewer tokens used on reasoning in a response. */ - class ReasoningEffort - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class ReasoningEffort @JsonCreator private constructor(private val value: JsonField) : + Enum { /** * Returns this class instance's raw value. @@ -1786,11 +1783,7 @@ private constructor( } fun build(): ToolResources = - ToolResources( - codeInterpreter, - fileSearch, - additionalProperties.toImmutable(), - ) + ToolResources(codeInterpreter, fileSearch, additionalProperties.toImmutable()) } @NoAutoDetect @@ -1914,7 +1907,7 @@ private constructor( fun build(): CodeInterpreter = CodeInterpreter( (fileIds ?: JsonMissing.of()).map { it.toImmutable() }, - additionalProperties.toImmutable() + additionalProperties.toImmutable(), ) } 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 83ef8f81..666527f5 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 @@ -72,13 +72,8 @@ private constructor( fun of( assistantsService: AssistantService, params: BetaAssistantListParams, - response: Response - ) = - BetaAssistantListPage( - assistantsService, - params, - response, - ) + response: Response, + ) = BetaAssistantListPage(assistantsService, params, response) } @NoAutoDetect @@ -162,18 +157,11 @@ private constructor( this.additionalProperties.put(key, value) } - fun build() = - Response( - data, - hasMore, - additionalProperties.toImmutable(), - ) + fun build() = Response(data, hasMore, additionalProperties.toImmutable()) } } - class AutoPager( - private val firstPage: BetaAssistantListPage, - ) : Iterable { + class AutoPager(private val firstPage: BetaAssistantListPage) : Iterable { override fun iterator(): Iterator = iterator { var page = firstPage 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 8547031a..79a24461 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 @@ -75,13 +75,8 @@ private constructor( fun of( assistantsService: AssistantServiceAsync, params: BetaAssistantListParams, - response: Response - ) = - BetaAssistantListPageAsync( - assistantsService, - params, - response, - ) + response: Response, + ) = BetaAssistantListPageAsync(assistantsService, params, response) } @NoAutoDetect @@ -165,23 +160,16 @@ private constructor( this.additionalProperties.put(key, value) } - fun build() = - Response( - data, - hasMore, - additionalProperties.toImmutable(), - ) + fun build() = Response(data, hasMore, additionalProperties.toImmutable()) } } - class AutoPager( - private val firstPage: BetaAssistantListPageAsync, - ) { + class AutoPager(private val firstPage: BetaAssistantListPageAsync) { fun forEach(action: Predicate, executor: Executor): CompletableFuture { fun CompletableFuture>.forEach( action: (Assistant) -> Boolean, - executor: Executor + executor: Executor, ): CompletableFuture = thenComposeAsync( { page -> @@ -190,7 +178,7 @@ private constructor( .map { it.getNextPage().forEach(action, executor) } .orElseGet { CompletableFuture.completedFuture(null) } }, - executor + executor, ) return CompletableFuture.completedFuture(Optional.of(firstPage)) .forEach(action::test, executor) 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 0a6aa520..9aec4bb9 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 @@ -270,11 +270,7 @@ private 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( - private val value: JsonField, - ) : Enum { + class Order @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. diff --git a/openai-java-core/src/main/kotlin/com/openai/models/BetaAssistantUpdateParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/BetaAssistantUpdateParams.kt index 18bae55b..24f37768 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/BetaAssistantUpdateParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/BetaAssistantUpdateParams.kt @@ -1595,11 +1595,7 @@ private constructor( * your available models, or see our [Model overview](https://platform.openai.com/docs/models) * for descriptions of them. */ - class Model - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Model @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. @@ -1851,11 +1847,8 @@ private constructor( * values are `low`, `medium`, and `high`. Reducing reasoning effort can result in faster * responses and fewer tokens used on reasoning in a response. */ - class ReasoningEffort - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class ReasoningEffort @JsonCreator private constructor(private val value: JsonField) : + Enum { /** * Returns this class instance's raw value. @@ -2055,11 +2048,7 @@ private constructor( } fun build(): ToolResources = - ToolResources( - codeInterpreter, - fileSearch, - additionalProperties.toImmutable(), - ) + ToolResources(codeInterpreter, fileSearch, additionalProperties.toImmutable()) } @NoAutoDetect @@ -2186,7 +2175,7 @@ private constructor( fun build(): CodeInterpreter = CodeInterpreter( (fileIds ?: JsonMissing.of()).map { it.toImmutable() }, - additionalProperties.toImmutable() + additionalProperties.toImmutable(), ) } @@ -2335,7 +2324,7 @@ private constructor( fun build(): FileSearch = FileSearch( (vectorStoreIds ?: JsonMissing.of()).map { it.toImmutable() }, - additionalProperties.toImmutable() + additionalProperties.toImmutable(), ) } 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 885100ed..f6191847 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 @@ -2696,7 +2696,7 @@ private constructor( override fun serialize( value: Content, generator: JsonGenerator, - provider: SerializerProvider + provider: SerializerProvider, ) { when { value.text != null -> generator.writeObject(value.text) @@ -2716,11 +2716,8 @@ private constructor( * - `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( - private val value: JsonField, - ) : Enum { + class Role @JsonCreator private constructor(private val value: JsonField) : + Enum { /** * Returns this class instance's raw value. @@ -3100,7 +3097,7 @@ private constructor( override fun serialize( value: Tool, generator: JsonGenerator, - provider: SerializerProvider + provider: SerializerProvider, ) { when { value.codeInterpreter != null -> @@ -3256,11 +3253,7 @@ private constructor( } fun build(): ToolResources = - ToolResources( - codeInterpreter, - fileSearch, - additionalProperties.toImmutable(), - ) + ToolResources(codeInterpreter, fileSearch, additionalProperties.toImmutable()) } @NoAutoDetect @@ -3384,7 +3377,7 @@ private constructor( fun build(): CodeInterpreter = CodeInterpreter( (fileIds ?: JsonMissing.of()).map { it.toImmutable() }, - additionalProperties.toImmutable() + additionalProperties.toImmutable(), ) } @@ -4028,11 +4021,7 @@ private constructor( } fun build(): ToolResources = - ToolResources( - codeInterpreter, - fileSearch, - additionalProperties.toImmutable(), - ) + ToolResources(codeInterpreter, fileSearch, additionalProperties.toImmutable()) } @NoAutoDetect @@ -4156,7 +4145,7 @@ private constructor( fun build(): CodeInterpreter = CodeInterpreter( (fileIds ?: JsonMissing.of()).map { it.toImmutable() }, - additionalProperties.toImmutable() + additionalProperties.toImmutable(), ) } @@ -4305,7 +4294,7 @@ private constructor( fun build(): FileSearch = FileSearch( (vectorStoreIds ?: JsonMissing.of()).map { it.toImmutable() }, - additionalProperties.toImmutable() + additionalProperties.toImmutable(), ) } @@ -4489,7 +4478,7 @@ private constructor( override fun serialize( value: Tool, generator: JsonGenerator, - provider: SerializerProvider + provider: SerializerProvider, ) { when { value.codeInterpreter != null -> generator.writeObject(value.codeInterpreter) @@ -4663,11 +4652,7 @@ private constructor( * 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( - private val value: JsonField, - ) : Enum { + class Type @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. 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 784688f9..2130f3cd 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 @@ -965,7 +965,7 @@ private constructor( override fun serialize( value: Content, generator: JsonGenerator, - provider: SerializerProvider + provider: SerializerProvider, ) { when { value.text != null -> generator.writeObject(value.text) @@ -985,11 +985,7 @@ private constructor( * - `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( - private val value: JsonField, - ) : Enum { + class Role @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. @@ -1363,7 +1359,7 @@ private constructor( override fun serialize( value: Tool, generator: JsonGenerator, - provider: SerializerProvider + provider: SerializerProvider, ) { when { value.codeInterpreter != null -> @@ -1515,11 +1511,7 @@ private constructor( } fun build(): ToolResources = - ToolResources( - codeInterpreter, - fileSearch, - additionalProperties.toImmutable(), - ) + ToolResources(codeInterpreter, fileSearch, additionalProperties.toImmutable()) } @NoAutoDetect @@ -1643,7 +1635,7 @@ private constructor( fun build(): CodeInterpreter = CodeInterpreter( (fileIds ?: JsonMissing.of()).map { it.toImmutable() }, - additionalProperties.toImmutable() + additionalProperties.toImmutable(), ) } 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 62820774..7c1015ac 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 @@ -756,7 +756,7 @@ private constructor( override fun serialize( value: Content, generator: JsonGenerator, - provider: SerializerProvider + provider: SerializerProvider, ) { when { value.text != null -> generator.writeObject(value.text) @@ -776,11 +776,7 @@ private constructor( * - `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( - private val value: JsonField, - ) : Enum { + class Role @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. @@ -1146,7 +1142,7 @@ private constructor( override fun serialize( value: Tool, generator: JsonGenerator, - provider: SerializerProvider + provider: SerializerProvider, ) { when { value.codeInterpreter != null -> 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 eb321ae8..db0cff9d 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 @@ -72,13 +72,8 @@ private constructor( fun of( messagesService: MessageService, params: BetaThreadMessageListParams, - response: Response - ) = - BetaThreadMessageListPage( - messagesService, - params, - response, - ) + response: Response, + ) = BetaThreadMessageListPage(messagesService, params, response) } @NoAutoDetect @@ -162,18 +157,11 @@ private constructor( this.additionalProperties.put(key, value) } - fun build() = - Response( - data, - hasMore, - additionalProperties.toImmutable(), - ) + fun build() = Response(data, hasMore, additionalProperties.toImmutable()) } } - class AutoPager( - private val firstPage: BetaThreadMessageListPage, - ) : Iterable { + class AutoPager(private val firstPage: BetaThreadMessageListPage) : Iterable { override fun iterator(): Iterator = iterator { var page = firstPage 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 bd34ed34..5d644592 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 @@ -75,13 +75,8 @@ private constructor( fun of( messagesService: MessageServiceAsync, params: BetaThreadMessageListParams, - response: Response - ) = - BetaThreadMessageListPageAsync( - messagesService, - params, - response, - ) + response: Response, + ) = BetaThreadMessageListPageAsync(messagesService, params, response) } @NoAutoDetect @@ -165,23 +160,16 @@ private constructor( this.additionalProperties.put(key, value) } - fun build() = - Response( - data, - hasMore, - additionalProperties.toImmutable(), - ) + fun build() = Response(data, hasMore, additionalProperties.toImmutable()) } } - class AutoPager( - private val firstPage: BetaThreadMessageListPageAsync, - ) { + class AutoPager(private val firstPage: BetaThreadMessageListPageAsync) { fun forEach(action: Predicate, executor: Executor): CompletableFuture { fun CompletableFuture>.forEach( action: (Message) -> Boolean, - executor: Executor + executor: Executor, ): CompletableFuture = thenComposeAsync( { page -> @@ -190,7 +178,7 @@ private constructor( .map { it.getNextPage().forEach(action, executor) } .orElseGet { CompletableFuture.completedFuture(null) } }, - executor + executor, ) return CompletableFuture.completedFuture(Optional.of(firstPage)) .forEach(action::test, executor) 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 c17e209d..ee1f1358 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 @@ -300,11 +300,7 @@ private 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( - private val value: JsonField, - ) : Enum { + class Order @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. 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 b4085618..9110a769 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 @@ -2669,7 +2669,7 @@ private constructor( override fun serialize( value: Content, generator: JsonGenerator, - provider: SerializerProvider + provider: SerializerProvider, ) { when { value.text != null -> generator.writeObject(value.text) @@ -2689,11 +2689,7 @@ private constructor( * - `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( - private val value: JsonField, - ) : Enum { + class Role @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. @@ -3067,7 +3063,7 @@ private constructor( override fun serialize( value: Tool, generator: JsonGenerator, - provider: SerializerProvider + provider: SerializerProvider, ) { when { value.codeInterpreter != null -> @@ -3124,11 +3120,8 @@ private constructor( * values are `low`, `medium`, and `high`. Reducing reasoning effort can result in faster * responses and fewer tokens used on reasoning in a response. */ - class ReasoningEffort - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class ReasoningEffort @JsonCreator private constructor(private val value: JsonField) : + Enum { /** * Returns this class instance's raw value. @@ -3386,11 +3379,7 @@ private constructor( * 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( - private val value: JsonField, - ) : Enum { + class Type @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. 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 510ecfce..d1345657 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 @@ -70,11 +70,7 @@ private constructor( @JvmStatic fun of(runsService: RunService, params: BetaThreadRunListParams, response: Response) = - BetaThreadRunListPage( - runsService, - params, - response, - ) + BetaThreadRunListPage(runsService, params, response) } @NoAutoDetect @@ -158,18 +154,11 @@ private constructor( this.additionalProperties.put(key, value) } - fun build() = - Response( - data, - hasMore, - additionalProperties.toImmutable(), - ) + fun build() = Response(data, hasMore, additionalProperties.toImmutable()) } } - class AutoPager( - private val firstPage: BetaThreadRunListPage, - ) : Iterable { + class AutoPager(private val firstPage: BetaThreadRunListPage) : Iterable { override fun iterator(): Iterator = iterator { var page = firstPage 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 1665ab37..bcd8f2ef 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 @@ -73,11 +73,7 @@ private constructor( @JvmStatic fun of(runsService: RunServiceAsync, params: BetaThreadRunListParams, response: Response) = - BetaThreadRunListPageAsync( - runsService, - params, - response, - ) + BetaThreadRunListPageAsync(runsService, params, response) } @NoAutoDetect @@ -161,23 +157,16 @@ private constructor( this.additionalProperties.put(key, value) } - fun build() = - Response( - data, - hasMore, - additionalProperties.toImmutable(), - ) + fun build() = Response(data, hasMore, additionalProperties.toImmutable()) } } - class AutoPager( - private val firstPage: BetaThreadRunListPageAsync, - ) { + class AutoPager(private val firstPage: BetaThreadRunListPageAsync) { fun forEach(action: Predicate, executor: Executor): CompletableFuture { fun CompletableFuture>.forEach( action: (Run) -> Boolean, - executor: Executor + executor: Executor, ): CompletableFuture = thenComposeAsync( { page -> @@ -186,7 +175,7 @@ private constructor( .map { it.getNextPage().forEach(action, executor) } .orElseGet { CompletableFuture.completedFuture(null) } }, - executor + executor, ) return CompletableFuture.completedFuture(Optional.of(firstPage)) .forEach(action::test, executor) 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 5f491b32..861cf6a9 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 @@ -286,11 +286,7 @@ private 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( - private val value: JsonField, - ) : Enum { + class Order @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. 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 d86d1244..6fb4251e 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 @@ -70,11 +70,7 @@ private constructor( @JvmStatic fun of(stepsService: StepService, params: BetaThreadRunStepListParams, response: Response) = - BetaThreadRunStepListPage( - stepsService, - params, - response, - ) + BetaThreadRunStepListPage(stepsService, params, response) } @NoAutoDetect @@ -158,18 +154,11 @@ private constructor( this.additionalProperties.put(key, value) } - fun build() = - Response( - data, - hasMore, - additionalProperties.toImmutable(), - ) + fun build() = Response(data, hasMore, additionalProperties.toImmutable()) } } - class AutoPager( - private val firstPage: BetaThreadRunStepListPage, - ) : Iterable { + class AutoPager(private val firstPage: BetaThreadRunStepListPage) : Iterable { override fun iterator(): Iterator = iterator { var page = firstPage 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 b634b4b3..fce88796 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 @@ -75,13 +75,8 @@ private constructor( fun of( stepsService: StepServiceAsync, params: BetaThreadRunStepListParams, - response: Response - ) = - BetaThreadRunStepListPageAsync( - stepsService, - params, - response, - ) + response: Response, + ) = BetaThreadRunStepListPageAsync(stepsService, params, response) } @NoAutoDetect @@ -165,23 +160,16 @@ private constructor( this.additionalProperties.put(key, value) } - fun build() = - Response( - data, - hasMore, - additionalProperties.toImmutable(), - ) + fun build() = Response(data, hasMore, additionalProperties.toImmutable()) } } - class AutoPager( - private val firstPage: BetaThreadRunStepListPageAsync, - ) { + class AutoPager(private val firstPage: BetaThreadRunStepListPageAsync) { fun forEach(action: Predicate, executor: Executor): CompletableFuture { fun CompletableFuture>.forEach( action: (RunStep) -> Boolean, - executor: Executor + executor: Executor, ): CompletableFuture = thenComposeAsync( { page -> @@ -190,7 +178,7 @@ private constructor( .map { it.getNextPage().forEach(action, executor) } .orElseGet { CompletableFuture.completedFuture(null) } }, - executor + executor, ) return CompletableFuture.completedFuture(Optional.of(firstPage)) .forEach(action::test, executor) 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 b002dff4..2ddbf9b0 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 @@ -349,11 +349,7 @@ private 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( - private val value: JsonField, - ) : Enum { + class Order @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. diff --git a/openai-java-core/src/main/kotlin/com/openai/models/BetaThreadRunSubmitToolOutputsParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/BetaThreadRunSubmitToolOutputsParams.kt index d1ef4fc4..54455b4c 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/BetaThreadRunSubmitToolOutputsParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/BetaThreadRunSubmitToolOutputsParams.kt @@ -165,7 +165,7 @@ private constructor( fun build(): BetaThreadRunSubmitToolOutputsBody = BetaThreadRunSubmitToolOutputsBody( checkRequired("toolOutputs", toolOutputs).map { it.toImmutable() }, - additionalProperties.toImmutable() + additionalProperties.toImmutable(), ) } @@ -469,11 +469,7 @@ private constructor( } fun build(): ToolOutput = - ToolOutput( - output, - toolCallId, - additionalProperties.toImmutable(), - ) + ToolOutput(output, toolCallId, additionalProperties.toImmutable()) } override fun equals(other: Any?): Boolean { diff --git a/openai-java-core/src/main/kotlin/com/openai/models/BetaThreadUpdateParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/BetaThreadUpdateParams.kt index f71b6c3e..d1a9da47 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/BetaThreadUpdateParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/BetaThreadUpdateParams.kt @@ -252,11 +252,7 @@ private constructor( } fun build(): BetaThreadUpdateBody = - BetaThreadUpdateBody( - metadata, - toolResources, - additionalProperties.toImmutable(), - ) + BetaThreadUpdateBody(metadata, toolResources, additionalProperties.toImmutable()) } override fun equals(other: Any?): Boolean { @@ -591,11 +587,7 @@ private constructor( } fun build(): ToolResources = - ToolResources( - codeInterpreter, - fileSearch, - additionalProperties.toImmutable(), - ) + ToolResources(codeInterpreter, fileSearch, additionalProperties.toImmutable()) } @NoAutoDetect @@ -719,7 +711,7 @@ private constructor( fun build(): CodeInterpreter = CodeInterpreter( (fileIds ?: JsonMissing.of()).map { it.toImmutable() }, - additionalProperties.toImmutable() + additionalProperties.toImmutable(), ) } @@ -868,7 +860,7 @@ private constructor( fun build(): FileSearch = FileSearch( (vectorStoreIds ?: JsonMissing.of()).map { it.toImmutable() }, - additionalProperties.toImmutable() + additionalProperties.toImmutable(), ) } 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 2b11cc90..d3d7aeb9 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 @@ -75,13 +75,8 @@ private constructor( fun of( fileBatchesService: FileBatchService, params: BetaVectorStoreFileBatchListFilesParams, - response: Response - ) = - BetaVectorStoreFileBatchListFilesPage( - fileBatchesService, - params, - response, - ) + response: Response, + ) = BetaVectorStoreFileBatchListFilesPage(fileBatchesService, params, response) } @NoAutoDetect @@ -165,18 +160,12 @@ private constructor( this.additionalProperties.put(key, value) } - fun build() = - Response( - data, - hasMore, - additionalProperties.toImmutable(), - ) + fun build() = Response(data, hasMore, additionalProperties.toImmutable()) } } - class AutoPager( - private val firstPage: BetaVectorStoreFileBatchListFilesPage, - ) : Iterable { + class AutoPager(private val firstPage: BetaVectorStoreFileBatchListFilesPage) : + Iterable { override fun iterator(): Iterator = iterator { var page = firstPage 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 6a7963dd..2323bd19 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 @@ -78,13 +78,8 @@ private constructor( fun of( fileBatchesService: FileBatchServiceAsync, params: BetaVectorStoreFileBatchListFilesParams, - response: Response - ) = - BetaVectorStoreFileBatchListFilesPageAsync( - fileBatchesService, - params, - response, - ) + response: Response, + ) = BetaVectorStoreFileBatchListFilesPageAsync(fileBatchesService, params, response) } @NoAutoDetect @@ -168,26 +163,19 @@ private constructor( this.additionalProperties.put(key, value) } - fun build() = - Response( - data, - hasMore, - additionalProperties.toImmutable(), - ) + fun build() = Response(data, hasMore, additionalProperties.toImmutable()) } } - class AutoPager( - private val firstPage: BetaVectorStoreFileBatchListFilesPageAsync, - ) { + class AutoPager(private val firstPage: BetaVectorStoreFileBatchListFilesPageAsync) { fun forEach( action: Predicate, - executor: Executor + executor: Executor, ): CompletableFuture { fun CompletableFuture>.forEach( action: (VectorStoreFile) -> Boolean, - executor: Executor + executor: Executor, ): CompletableFuture = thenComposeAsync( { page -> @@ -196,7 +184,7 @@ private constructor( .map { it.getNextPage().forEach(action, executor) } .orElseGet { CompletableFuture.completedFuture(null) } }, - executor + executor, ) return CompletableFuture.completedFuture(Optional.of(firstPage)) .forEach(action::test, executor) 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 9b20c71f..27356e44 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 @@ -310,11 +310,7 @@ private constructor( } /** Filter by file status. One of `in_progress`, `completed`, `failed`, `cancelled`. */ - class Filter - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Filter @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. @@ -418,11 +414,7 @@ private 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( - private val value: JsonField, - ) : Enum { + class Order @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. 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 6156ca31..2eb33b54 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 @@ -72,13 +72,8 @@ private constructor( fun of( filesService: FileService, params: BetaVectorStoreFileListParams, - response: Response - ) = - BetaVectorStoreFileListPage( - filesService, - params, - response, - ) + response: Response, + ) = BetaVectorStoreFileListPage(filesService, params, response) } @NoAutoDetect @@ -162,18 +157,12 @@ private constructor( this.additionalProperties.put(key, value) } - fun build() = - Response( - data, - hasMore, - additionalProperties.toImmutable(), - ) + fun build() = Response(data, hasMore, additionalProperties.toImmutable()) } } - class AutoPager( - private val firstPage: BetaVectorStoreFileListPage, - ) : Iterable { + class AutoPager(private val firstPage: BetaVectorStoreFileListPage) : + Iterable { override fun iterator(): Iterator = iterator { var page = firstPage 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 bafa4766..5ff6dff4 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 @@ -75,13 +75,8 @@ private constructor( fun of( filesService: FileServiceAsync, params: BetaVectorStoreFileListParams, - response: Response - ) = - BetaVectorStoreFileListPageAsync( - filesService, - params, - response, - ) + response: Response, + ) = BetaVectorStoreFileListPageAsync(filesService, params, response) } @NoAutoDetect @@ -165,26 +160,19 @@ private constructor( this.additionalProperties.put(key, value) } - fun build() = - Response( - data, - hasMore, - additionalProperties.toImmutable(), - ) + fun build() = Response(data, hasMore, additionalProperties.toImmutable()) } } - class AutoPager( - private val firstPage: BetaVectorStoreFileListPageAsync, - ) { + class AutoPager(private val firstPage: BetaVectorStoreFileListPageAsync) { fun forEach( action: Predicate, - executor: Executor + executor: Executor, ): CompletableFuture { fun CompletableFuture>.forEach( action: (VectorStoreFile) -> Boolean, - executor: Executor + executor: Executor, ): CompletableFuture = thenComposeAsync( { page -> @@ -193,7 +181,7 @@ private constructor( .map { it.getNextPage().forEach(action, executor) } .orElseGet { CompletableFuture.completedFuture(null) } }, - executor + executor, ) return CompletableFuture.completedFuture(Optional.of(firstPage)) .forEach(action::test, executor) 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 e067f817..e92bb3d8 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 @@ -297,11 +297,7 @@ private constructor( } /** Filter by file status. One of `in_progress`, `completed`, `failed`, `cancelled`. */ - class Filter - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Filter @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. @@ -405,11 +401,7 @@ private 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( - private val value: JsonField, - ) : Enum { + class Order @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. 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 d4e72e30..4b223a8d 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 @@ -72,13 +72,8 @@ private constructor( fun of( vectorStoresService: VectorStoreService, params: BetaVectorStoreListParams, - response: Response - ) = - BetaVectorStoreListPage( - vectorStoresService, - params, - response, - ) + response: Response, + ) = BetaVectorStoreListPage(vectorStoresService, params, response) } @NoAutoDetect @@ -162,18 +157,11 @@ private constructor( this.additionalProperties.put(key, value) } - fun build() = - Response( - data, - hasMore, - additionalProperties.toImmutable(), - ) + fun build() = Response(data, hasMore, additionalProperties.toImmutable()) } } - class AutoPager( - private val firstPage: BetaVectorStoreListPage, - ) : Iterable { + class AutoPager(private val firstPage: BetaVectorStoreListPage) : Iterable { override fun iterator(): Iterator = iterator { var page = firstPage 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 6327f038..742f3af9 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 @@ -75,13 +75,8 @@ private constructor( fun of( vectorStoresService: VectorStoreServiceAsync, params: BetaVectorStoreListParams, - response: Response - ) = - BetaVectorStoreListPageAsync( - vectorStoresService, - params, - response, - ) + response: Response, + ) = BetaVectorStoreListPageAsync(vectorStoresService, params, response) } @NoAutoDetect @@ -165,23 +160,16 @@ private constructor( this.additionalProperties.put(key, value) } - fun build() = - Response( - data, - hasMore, - additionalProperties.toImmutable(), - ) + fun build() = Response(data, hasMore, additionalProperties.toImmutable()) } } - class AutoPager( - private val firstPage: BetaVectorStoreListPageAsync, - ) { + class AutoPager(private val firstPage: BetaVectorStoreListPageAsync) { fun forEach(action: Predicate, executor: Executor): CompletableFuture { fun CompletableFuture>.forEach( action: (VectorStore) -> Boolean, - executor: Executor + executor: Executor, ): CompletableFuture = thenComposeAsync( { page -> @@ -190,7 +178,7 @@ private constructor( .map { it.getNextPage().forEach(action, executor) } .orElseGet { CompletableFuture.completedFuture(null) } }, - executor + executor, ) return CompletableFuture.completedFuture(Optional.of(firstPage)) .forEach(action::test, executor) 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 6492ec12..e4f21901 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 @@ -270,11 +270,7 @@ private 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( - private val value: JsonField, - ) : Enum { + class Order @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. 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 1afd955c..e2debac7 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 @@ -459,11 +459,8 @@ private constructor( * 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( - private val value: JsonField, - ) : Enum { + class FinishReason @JsonCreator private constructor(private val value: JsonField) : + Enum { /** * Returns this class instance's raw value. @@ -763,11 +760,8 @@ private constructor( } /** The service tier used for processing the request. */ - class ServiceTier - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class ServiceTier @JsonCreator private constructor(private val value: JsonField) : + Enum { /** * Returns this class instance's raw value. 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 9d574d28..20ae74e3 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 @@ -575,7 +575,7 @@ private constructor( } tryDeserialize( node, - jacksonTypeRef>() + jacksonTypeRef>(), ) { it.forEach { it.validate() } } @@ -592,7 +592,7 @@ private constructor( override fun serialize( value: Content, generator: JsonGenerator, - provider: SerializerProvider + provider: SerializerProvider, ) { when { value.text != null -> generator.writeObject(value.text) @@ -754,21 +754,21 @@ private constructor( ?.let { return ChatCompletionRequestAssistantMessageContentPart( text = it, - _json = json + _json = json, ) } } "refusal" -> { tryDeserialize( node, - jacksonTypeRef() + jacksonTypeRef(), ) { it.validate() } ?.let { return ChatCompletionRequestAssistantMessageContentPart( refusal = it, - _json = json + _json = json, ) } } @@ -786,7 +786,7 @@ private constructor( override fun serialize( value: ChatCompletionRequestAssistantMessageContentPart, generator: JsonGenerator, - provider: SerializerProvider + provider: SerializerProvider, ) { when { value.text != null -> generator.writeObject(value.text) 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 02d89242..9a0ec3aa 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 @@ -150,11 +150,7 @@ private constructor( /** * Specifies the output audio format. Must be one of `wav`, `mp3`, `flac`, `opus`, or `pcm16`. */ - class Format - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Format @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. @@ -265,11 +261,7 @@ private constructor( * and `verse` (also supported but not recommended are `alloy`, `echo`, and `shimmer`; these * voices are less expressive). */ - class Voice - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Voice @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. 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 09d206cd..29b0fb99 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 @@ -847,11 +847,7 @@ private constructor( } fun build(): FunctionCall = - FunctionCall( - arguments, - name, - additionalProperties.toImmutable(), - ) + FunctionCall(arguments, name, additionalProperties.toImmutable()) } override fun equals(other: Any?): Boolean { @@ -873,11 +869,8 @@ private constructor( } /** The role of the author of this message. */ - class Role - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Role @JsonCreator private constructor(private val value: JsonField) : + Enum { /** * Returns this class instance's raw value. @@ -1247,11 +1240,7 @@ private constructor( } fun build(): Function = - Function( - arguments, - name, - additionalProperties.toImmutable(), - ) + Function(arguments, name, additionalProperties.toImmutable()) } override fun equals(other: Any?): Boolean { @@ -1273,11 +1262,8 @@ private constructor( } /** The type of the tool. Currently, only `function` is supported. */ - class Type - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Type @JsonCreator private constructor(private val value: JsonField) : + Enum { /** * Returns this class instance's raw value. @@ -1299,7 +1285,7 @@ private constructor( /** An enum containing [Type]'s known values. */ enum class Known { - FUNCTION, + FUNCTION } /** @@ -1406,11 +1392,8 @@ private constructor( * 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( - private val value: JsonField, - ) : Enum { + class FinishReason @JsonCreator private constructor(private val value: JsonField) : + Enum { /** * Returns this class instance's raw value. @@ -1710,11 +1693,8 @@ private constructor( } /** The service tier used for processing the request. */ - class ServiceTier - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class ServiceTier @JsonCreator private constructor(private val value: JsonField) : + Enum { /** * Returns this class instance's raw value. 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 ac540cb7..add05ca5 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 @@ -200,7 +200,7 @@ private constructor( override fun serialize( value: ChatCompletionContentPart, generator: JsonGenerator, - provider: SerializerProvider + provider: SerializerProvider, ) { when { value.text != null -> generator.writeObject(value.text) 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 82d84c8a..65998e73 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 @@ -219,22 +219,14 @@ private constructor( } fun build(): ImageUrl = - ImageUrl( - checkRequired("url", url), - detail, - additionalProperties.toImmutable(), - ) + ImageUrl(checkRequired("url", url), detail, additionalProperties.toImmutable()) } /** * 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( - private val value: JsonField, - ) : Enum { + class Detail @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. 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 2d953c32..3fc65141 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 @@ -220,11 +220,7 @@ private constructor( } /** The format of the encoded audio data. Currently supports "wav" and "mp3". */ - class Format - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Format @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. 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 eee050f0..af8db5d5 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 @@ -3933,7 +3933,7 @@ private constructor( override fun serialize( value: FunctionCall, generator: JsonGenerator, - provider: SerializerProvider + provider: SerializerProvider, ) { when { value.auto != null -> generator.writeObject(value.auto) @@ -3949,11 +3949,7 @@ private 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 Auto - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Auto @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. @@ -4258,7 +4254,7 @@ private constructor( @JsonCreator private constructor( @JsonAnySetter - private val additionalProperties: Map = immutableEmptyMap(), + private val additionalProperties: Map = immutableEmptyMap() ) { @JsonAnyGetter @@ -4498,7 +4494,7 @@ private constructor( override fun serialize( value: ResponseFormat, generator: JsonGenerator, - provider: SerializerProvider + provider: SerializerProvider, ) { when { value.text != null -> generator.writeObject(value.text) @@ -4522,11 +4518,8 @@ private constructor( * lower uptime SLA and no latency guarantee. * - When not set, the default behavior is 'auto'. */ - class ServiceTier - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class ServiceTier @JsonCreator private constructor(private val value: JsonField) : + Enum { /** * Returns this class instance's raw value. @@ -4732,7 +4725,7 @@ private constructor( override fun serialize( value: Stop, generator: JsonGenerator, - provider: SerializerProvider + provider: SerializerProvider, ) { when { value.string != null -> generator.writeObject(value.string) 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 1f464514..0574c4f1 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 @@ -323,7 +323,7 @@ private constructor( override fun serialize( value: Content, generator: JsonGenerator, - provider: SerializerProvider + provider: SerializerProvider, ) { when { value.text != null -> generator.writeObject(value.text) diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionFunctionCallOption.kt b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionFunctionCallOption.kt index 29e94281..7ad35cf7 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionFunctionCallOption.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionFunctionCallOption.kt @@ -98,7 +98,7 @@ private constructor( fun build(): ChatCompletionFunctionCallOption = ChatCompletionFunctionCallOption( checkRequired("name", name), - additionalProperties.toImmutable() + additionalProperties.toImmutable(), ) } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionMessageListPage.kt b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionMessageListPage.kt index 6a0c3a0e..eafba7f0 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionMessageListPage.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionMessageListPage.kt @@ -75,13 +75,8 @@ private constructor( fun of( messagesService: MessageService, params: ChatCompletionMessageListParams, - response: Response - ) = - ChatCompletionMessageListPage( - messagesService, - params, - response, - ) + response: Response, + ) = ChatCompletionMessageListPage(messagesService, params, response) } @NoAutoDetect @@ -167,18 +162,12 @@ private constructor( this.additionalProperties.put(key, value) } - fun build() = - Response( - data, - hasMore, - additionalProperties.toImmutable(), - ) + fun build() = Response(data, hasMore, additionalProperties.toImmutable()) } } - class AutoPager( - private val firstPage: ChatCompletionMessageListPage, - ) : Iterable { + class AutoPager(private val firstPage: ChatCompletionMessageListPage) : + Iterable { override fun iterator(): Iterator = iterator { var page = firstPage diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionMessageListPageAsync.kt b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionMessageListPageAsync.kt index 772f759e..7417066f 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionMessageListPageAsync.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionMessageListPageAsync.kt @@ -78,13 +78,8 @@ private constructor( fun of( messagesService: MessageServiceAsync, params: ChatCompletionMessageListParams, - response: Response - ) = - ChatCompletionMessageListPageAsync( - messagesService, - params, - response, - ) + response: Response, + ) = ChatCompletionMessageListPageAsync(messagesService, params, response) } @NoAutoDetect @@ -170,26 +165,19 @@ private constructor( this.additionalProperties.put(key, value) } - fun build() = - Response( - data, - hasMore, - additionalProperties.toImmutable(), - ) + fun build() = Response(data, hasMore, additionalProperties.toImmutable()) } } - class AutoPager( - private val firstPage: ChatCompletionMessageListPageAsync, - ) { + class AutoPager(private val firstPage: ChatCompletionMessageListPageAsync) { fun forEach( action: Predicate, - executor: Executor + executor: Executor, ): CompletableFuture { fun CompletableFuture>.forEach( action: (ChatCompletionStoreMessage) -> Boolean, - executor: Executor + executor: Executor, ): CompletableFuture = thenComposeAsync( { page -> @@ -198,7 +186,7 @@ private constructor( .map { it.getNextPage().forEach(action, executor) } .orElseGet { CompletableFuture.completedFuture(null) } }, - executor + executor, ) return CompletableFuture.completedFuture(Optional.of(firstPage)) .forEach(action::test, executor) diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionMessageListParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionMessageListParams.kt index 64313bba..37af532d 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionMessageListParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionMessageListParams.kt @@ -237,11 +237,7 @@ private constructor( * Sort order for messages by timestamp. Use `asc` for ascending order or `desc` for descending * order. Defaults to `asc`. */ - class Order - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Order @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. 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 354958eb..eb51803b 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 @@ -317,7 +317,7 @@ private constructor( override fun serialize( value: ChatCompletionMessageParam, generator: JsonGenerator, - provider: SerializerProvider + provider: SerializerProvider, ) { when { value.developer != null -> generator.writeObject(value.developer) diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionModality.kt b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionModality.kt index acc35bd6..cfae4f54 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionModality.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionModality.kt @@ -9,9 +9,7 @@ import com.openai.errors.OpenAIInvalidDataException class ChatCompletionModality @JsonCreator -private constructor( - private val value: JsonField, -) : Enum { +private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. 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 2547a535..aaac9c4a 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 @@ -333,7 +333,7 @@ private constructor( override fun serialize( value: Content, generator: JsonGenerator, - provider: SerializerProvider + provider: SerializerProvider, ) { when { value.text != null -> generator.writeObject(value.text) 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 1b15b0e1..fe04edb3 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 @@ -17,9 +17,7 @@ import com.openai.errors.OpenAIInvalidDataException */ class ChatCompletionReasoningEffort @JsonCreator -private constructor( - private val value: JsonField, -) : Enum { +private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. 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 b3893b26..9aee7899 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 @@ -8,11 +8,8 @@ import com.openai.core.JsonField import com.openai.errors.OpenAIInvalidDataException /** The role of the author of a message */ -class ChatCompletionRole -@JsonCreator -private constructor( - private val value: JsonField, -) : Enum { +class ChatCompletionRole @JsonCreator private constructor(private val value: JsonField) : + Enum { /** * Returns this class instance's raw value. 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 36012d06..3e35f535 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 @@ -322,7 +322,7 @@ private constructor( override fun serialize( value: Content, generator: JsonGenerator, - provider: SerializerProvider + provider: SerializerProvider, ) { when { value.text != null -> generator.writeObject(value.text) 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 19bff6b3..b6916e53 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 @@ -192,7 +192,7 @@ private constructor( override fun serialize( value: ChatCompletionToolChoiceOption, generator: JsonGenerator, - provider: SerializerProvider + provider: SerializerProvider, ) { when { value.auto != null -> generator.writeObject(value.auto) @@ -208,11 +208,7 @@ private constructor( * 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 Auto - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Auto @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. 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 ea7a6974..68639c95 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 @@ -307,7 +307,7 @@ private constructor( override fun serialize( value: Content, generator: JsonGenerator, - provider: SerializerProvider + provider: SerializerProvider, ) { when { value.text != null -> generator.writeObject(value.text) diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionUpdateParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionUpdateParams.kt index f1ac4545..bdc1a1c7 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionUpdateParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionUpdateParams.kt @@ -191,7 +191,7 @@ private constructor( fun build(): ChatCompletionUpdateBody = ChatCompletionUpdateBody( checkRequired("metadata", metadata), - additionalProperties.toImmutable() + additionalProperties.toImmutable(), ) } 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 9bb79dd4..80b53003 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 @@ -321,7 +321,7 @@ private constructor( override fun serialize( value: Content, generator: JsonGenerator, - provider: SerializerProvider + provider: SerializerProvider, ) { when { value.text != null -> generator.writeObject(value.text) diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ChatModel.kt b/openai-java-core/src/main/kotlin/com/openai/models/ChatModel.kt index eb128ce6..5d10f070 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ChatModel.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ChatModel.kt @@ -7,11 +7,7 @@ import com.openai.core.Enum import com.openai.core.JsonField import com.openai.errors.OpenAIInvalidDataException -class ChatModel -@JsonCreator -private constructor( - private val value: JsonField, -) : Enum { +class ChatModel @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. 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 bf90a153..1210b30f 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 @@ -452,7 +452,7 @@ private constructor( override fun serialize( value: Output, generator: JsonGenerator, - provider: SerializerProvider + provider: SerializerProvider, ) { when { value.logs != null -> generator.writeObject(value.logs) @@ -781,7 +781,7 @@ private constructor( fun build(): Image = Image( checkRequired("fileId", fileId), - additionalProperties.toImmutable() + additionalProperties.toImmutable(), ) } 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 5fa395f2..0ea5289e 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 @@ -474,7 +474,7 @@ private constructor( override fun serialize( value: Output, generator: JsonGenerator, - provider: SerializerProvider + provider: SerializerProvider, ) { when { value.logs != null -> generator.writeObject(value.logs) 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 e2f0ff78..85f27c57 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 @@ -174,11 +174,8 @@ private constructor( * 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( - private val value: JsonField, - ) : Enum { + class FinishReason @JsonCreator private constructor(private val value: JsonField) : + Enum { /** * Returns this class instance's raw value. @@ -473,7 +470,7 @@ private constructor( @JsonCreator private constructor( @JsonAnySetter - private val additionalProperties: Map = immutableEmptyMap(), + private val additionalProperties: Map = immutableEmptyMap() ) { @JsonAnyGetter 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 0e4b846a..12e4231c 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 @@ -2230,11 +2230,7 @@ private constructor( * your available models, or see our [Model overview](https://platform.openai.com/docs/models) * for descriptions of them. */ - class Model - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Model @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. @@ -2494,7 +2490,7 @@ private constructor( override fun serialize( value: Prompt, generator: JsonGenerator, - provider: SerializerProvider + provider: SerializerProvider, ) { when { value.string != null -> generator.writeObject(value.string) @@ -2527,7 +2523,7 @@ private constructor( @JsonCreator private constructor( @JsonAnySetter - private val additionalProperties: Map = immutableEmptyMap(), + private val additionalProperties: Map = immutableEmptyMap() ) { @JsonAnyGetter @@ -2719,7 +2715,7 @@ private constructor( override fun serialize( value: Stop, generator: JsonGenerator, - provider: SerializerProvider + provider: SerializerProvider, ) { when { value.string != null -> generator.writeObject(value.string) diff --git a/openai-java-core/src/main/kotlin/com/openai/models/CompletionUsage.kt b/openai-java-core/src/main/kotlin/com/openai/models/CompletionUsage.kt index f661b4d5..303eaff7 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/CompletionUsage.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/CompletionUsage.kt @@ -510,11 +510,7 @@ private constructor( } fun build(): PromptTokensDetails = - PromptTokensDetails( - audioTokens, - cachedTokens, - additionalProperties.toImmutable(), - ) + PromptTokensDetails(audioTokens, cachedTokens, additionalProperties.toImmutable()) } override fun equals(other: Any?): Boolean { 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 e960fec2..a106889f 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 @@ -865,7 +865,7 @@ private constructor( override fun serialize( value: Input, generator: JsonGenerator, - provider: SerializerProvider + provider: SerializerProvider, ) { when { value.string != null -> generator.writeObject(value.string) @@ -884,11 +884,8 @@ private constructor( * The format to return the embeddings in. Can be either `float` or * [`base64`](https://pypi.org/project/pybase64/). */ - class EncodingFormat - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class EncodingFormat @JsonCreator private constructor(private val value: JsonField) : + Enum { /** * Returns this class instance's raw value. diff --git a/openai-java-core/src/main/kotlin/com/openai/models/EmbeddingModel.kt b/openai-java-core/src/main/kotlin/com/openai/models/EmbeddingModel.kt index 03d0a4cc..75ba4f55 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/EmbeddingModel.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/EmbeddingModel.kt @@ -7,11 +7,7 @@ import com.openai.core.Enum import com.openai.core.JsonField import com.openai.errors.OpenAIInvalidDataException -class EmbeddingModel -@JsonCreator -private constructor( - private val value: JsonField, -) : Enum { +class EmbeddingModel @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. 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 a5023116..f6c028ba 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 @@ -175,7 +175,7 @@ private constructor( override fun serialize( value: FileChunkingStrategy, generator: JsonGenerator, - provider: SerializerProvider + provider: SerializerProvider, ) { when { value.static_ != null -> generator.writeObject(value.static_) 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 41ae88b3..2ca3879f 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 @@ -179,7 +179,7 @@ private constructor( override fun serialize( value: FileChunkingStrategyParam, generator: JsonGenerator, - provider: SerializerProvider + provider: SerializerProvider, ) { when { value.auto != null -> generator.writeObject(value.auto) 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 605d2a3d..18067179 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 @@ -280,11 +280,7 @@ private constructor( } fun build(): FileCitation = - FileCitation( - fileId, - quote, - additionalProperties.toImmutable(), - ) + FileCitation(fileId, quote, additionalProperties.toImmutable()) } override fun equals(other: Any?): Boolean { 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 c37a055e..be8e0330 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 @@ -68,11 +68,7 @@ private constructor( @JvmStatic fun of(filesService: FileService, params: FileListParams, response: Response) = - FileListPage( - filesService, - params, - response, - ) + FileListPage(filesService, params, response) } @NoAutoDetect @@ -156,18 +152,11 @@ private constructor( this.additionalProperties.put(key, value) } - fun build() = - Response( - data, - hasMore, - additionalProperties.toImmutable(), - ) + fun build() = Response(data, hasMore, additionalProperties.toImmutable()) } } - class AutoPager( - private val firstPage: FileListPage, - ) : Iterable { + class AutoPager(private val firstPage: FileListPage) : Iterable { override fun iterator(): Iterator = iterator { var page = firstPage 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 3ea12069..db2bb01a 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 @@ -71,11 +71,7 @@ private constructor( @JvmStatic fun of(filesService: FileServiceAsync, params: FileListParams, response: Response) = - FileListPageAsync( - filesService, - params, - response, - ) + FileListPageAsync(filesService, params, response) } @NoAutoDetect @@ -159,23 +155,16 @@ private constructor( this.additionalProperties.put(key, value) } - fun build() = - Response( - data, - hasMore, - additionalProperties.toImmutable(), - ) + fun build() = Response(data, hasMore, additionalProperties.toImmutable()) } } - class AutoPager( - private val firstPage: FileListPageAsync, - ) { + class AutoPager(private val firstPage: FileListPageAsync) { fun forEach(action: Predicate, executor: Executor): CompletableFuture { fun CompletableFuture>.forEach( action: (FileObject) -> Boolean, - executor: Executor + executor: Executor, ): CompletableFuture = thenComposeAsync( { page -> @@ -184,7 +173,7 @@ private constructor( .map { it.getNextPage().forEach(action, executor) } .orElseGet { CompletableFuture.completedFuture(null) } }, - executor + executor, ) return CompletableFuture.completedFuture(Optional.of(firstPage)) .forEach(action::test, executor) 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 7a509d51..79c16ec6 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 @@ -256,11 +256,7 @@ private 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( - private val value: JsonField, - ) : Enum { + class Order @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. 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 c1aef8e0..79979e32 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 @@ -280,11 +280,7 @@ private constructor( * 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( - private val value: JsonField, - ) : Enum { + class Purpose @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. @@ -407,11 +403,7 @@ private constructor( * `error`. */ @Deprecated("deprecated") - class Status - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Status @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. 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 8ecc8846..01228927 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 @@ -15,11 +15,7 @@ import com.openai.errors.OpenAIInvalidDataException * 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( - private val value: JsonField, -) : Enum { +class FilePurpose @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. 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 101d7a82..eb067fcb 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 @@ -112,11 +112,7 @@ private constructor( } fun build(): FileSearchTool = - FileSearchTool( - type, - fileSearch, - additionalProperties.toImmutable(), - ) + FileSearchTool(type, fileSearch, additionalProperties.toImmutable()) } /** Overrides for the file search tool. */ @@ -288,11 +284,7 @@ private constructor( } fun build(): FileSearch = - FileSearch( - maxNumResults, - rankingOptions, - additionalProperties.toImmutable(), - ) + FileSearch(maxNumResults, rankingOptions, additionalProperties.toImmutable()) } /** @@ -438,11 +430,8 @@ private constructor( /** * The ranker to use for the file search. If not specified will use the `auto` ranker. */ - class Ranker - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Ranker @JsonCreator private constructor(private val value: JsonField) : + Enum { /** * Returns this class instance's raw value. 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 e2ea6ab2..48826a13 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 @@ -689,20 +689,12 @@ private constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): Content = - Content( - text, - type, - additionalProperties.toImmutable(), - ) + fun build(): Content = Content(text, type, additionalProperties.toImmutable()) } /** The type of the content. */ - class Type - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Type @JsonCreator private constructor(private val value: JsonField) : + Enum { /** * Returns this class instance's raw value. @@ -724,7 +716,7 @@ private constructor( /** An enum containing [Type]'s known values. */ enum class Known { - TEXT, + TEXT } /** 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 48e98754..34152d31 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 @@ -1207,7 +1207,7 @@ private constructor( override fun serialize( value: BatchSize, generator: JsonGenerator, - provider: SerializerProvider + provider: SerializerProvider, ) { when { value.auto != null -> generator.writeObject(value.auto) @@ -1361,7 +1361,7 @@ private constructor( override fun serialize( value: LearningRateMultiplier, generator: JsonGenerator, - provider: SerializerProvider + provider: SerializerProvider, ) { when { value.auto != null -> generator.writeObject(value.auto) @@ -1513,7 +1513,7 @@ private constructor( override fun serialize( value: NEpochs, generator: JsonGenerator, - provider: SerializerProvider + provider: SerializerProvider, ) { when { value.auto != null -> generator.writeObject(value.auto) @@ -1547,11 +1547,7 @@ private constructor( * 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( - private val value: JsonField, - ) : Enum { + class Status @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. @@ -1777,13 +1773,7 @@ private constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): Method = - Method( - dpo, - supervised, - type, - additionalProperties.toImmutable(), - ) + fun build(): Method = Method(dpo, supervised, type, additionalProperties.toImmutable()) } /** Configuration for the DPO fine-tuning method. */ @@ -2276,7 +2266,7 @@ private constructor( override fun serialize( value: BatchSize, generator: JsonGenerator, - provider: SerializerProvider + provider: SerializerProvider, ) { when { value.auto != null -> generator.writeObject(value.auto) @@ -2428,7 +2418,7 @@ private constructor( override fun serialize( value: Beta, generator: JsonGenerator, - provider: SerializerProvider + provider: SerializerProvider, ) { when { value.auto != null -> generator.writeObject(value.auto) @@ -2589,7 +2579,7 @@ private constructor( override fun serialize( value: LearningRateMultiplier, generator: JsonGenerator, - provider: SerializerProvider + provider: SerializerProvider, ) { when { value.auto != null -> generator.writeObject(value.auto) @@ -2742,7 +2732,7 @@ private constructor( override fun serialize( value: NEpochs, generator: JsonGenerator, - provider: SerializerProvider + provider: SerializerProvider, ) { when { value.auto != null -> generator.writeObject(value.auto) @@ -3238,7 +3228,7 @@ private constructor( override fun serialize( value: BatchSize, generator: JsonGenerator, - provider: SerializerProvider + provider: SerializerProvider, ) { when { value.auto != null -> generator.writeObject(value.auto) @@ -3399,7 +3389,7 @@ private constructor( override fun serialize( value: LearningRateMultiplier, generator: JsonGenerator, - provider: SerializerProvider + provider: SerializerProvider, ) { when { value.auto != null -> generator.writeObject(value.auto) @@ -3552,7 +3542,7 @@ private constructor( override fun serialize( value: NEpochs, generator: JsonGenerator, - provider: SerializerProvider + provider: SerializerProvider, ) { when { value.auto != null -> generator.writeObject(value.auto) @@ -3601,11 +3591,7 @@ private constructor( } /** The type of method. Is either `supervised` or `dpo`. */ - class Type - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Type @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. 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 7fd952a4..98526f03 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 @@ -75,13 +75,8 @@ private constructor( fun of( checkpointsService: CheckpointService, params: FineTuningJobCheckpointListParams, - response: Response - ) = - FineTuningJobCheckpointListPage( - checkpointsService, - params, - response, - ) + response: Response, + ) = FineTuningJobCheckpointListPage(checkpointsService, params, response) } @NoAutoDetect @@ -166,18 +161,12 @@ private constructor( this.additionalProperties.put(key, value) } - fun build() = - Response( - data, - hasMore, - additionalProperties.toImmutable(), - ) + fun build() = Response(data, hasMore, additionalProperties.toImmutable()) } } - class AutoPager( - private val firstPage: FineTuningJobCheckpointListPage, - ) : Iterable { + class AutoPager(private val firstPage: FineTuningJobCheckpointListPage) : + Iterable { override fun iterator(): Iterator = iterator { var page = firstPage 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 9ee40c7e..c39fcb5e 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 @@ -78,13 +78,8 @@ private constructor( fun of( checkpointsService: CheckpointServiceAsync, params: FineTuningJobCheckpointListParams, - response: Response - ) = - FineTuningJobCheckpointListPageAsync( - checkpointsService, - params, - response, - ) + response: Response, + ) = FineTuningJobCheckpointListPageAsync(checkpointsService, params, response) } @NoAutoDetect @@ -169,26 +164,19 @@ private constructor( this.additionalProperties.put(key, value) } - fun build() = - Response( - data, - hasMore, - additionalProperties.toImmutable(), - ) + fun build() = Response(data, hasMore, additionalProperties.toImmutable()) } } - class AutoPager( - private val firstPage: FineTuningJobCheckpointListPageAsync, - ) { + class AutoPager(private val firstPage: FineTuningJobCheckpointListPageAsync) { fun forEach( action: Predicate, - executor: Executor + executor: Executor, ): CompletableFuture { fun CompletableFuture>.forEach( action: (FineTuningJobCheckpoint) -> Boolean, - executor: Executor + executor: Executor, ): CompletableFuture = thenComposeAsync( { page -> @@ -197,7 +185,7 @@ private constructor( .map { it.getNextPage().forEach(action, executor) } .orElseGet { CompletableFuture.completedFuture(null) } }, - executor + executor, ) return CompletableFuture.completedFuture(Optional.of(firstPage)) .forEach(action::test, executor) 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 525c0c0c..d90023cf 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 @@ -1055,11 +1055,7 @@ private 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( - private val value: JsonField, - ) : Enum { + class Model @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. @@ -1509,7 +1505,7 @@ private constructor( override fun serialize( value: BatchSize, generator: JsonGenerator, - provider: SerializerProvider + provider: SerializerProvider, ) { when { value.auto != null -> generator.writeObject(value.auto) @@ -1663,7 +1659,7 @@ private constructor( override fun serialize( value: LearningRateMultiplier, generator: JsonGenerator, - provider: SerializerProvider + provider: SerializerProvider, ) { when { value.auto != null -> generator.writeObject(value.auto) @@ -1815,7 +1811,7 @@ private constructor( override fun serialize( value: NEpochs, generator: JsonGenerator, - provider: SerializerProvider + provider: SerializerProvider, ) { when { value.auto != null -> generator.writeObject(value.auto) @@ -1962,11 +1958,7 @@ private constructor( } fun build(): Integration = - Integration( - type, - checkRequired("wandb", wandb), - additionalProperties.toImmutable(), - ) + Integration(type, checkRequired("wandb", wandb), additionalProperties.toImmutable()) } /** @@ -2343,13 +2335,7 @@ private constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): Method = - Method( - dpo, - supervised, - type, - additionalProperties.toImmutable(), - ) + fun build(): Method = Method(dpo, supervised, type, additionalProperties.toImmutable()) } /** Configuration for the DPO fine-tuning method. */ @@ -2842,7 +2828,7 @@ private constructor( override fun serialize( value: BatchSize, generator: JsonGenerator, - provider: SerializerProvider + provider: SerializerProvider, ) { when { value.auto != null -> generator.writeObject(value.auto) @@ -2994,7 +2980,7 @@ private constructor( override fun serialize( value: Beta, generator: JsonGenerator, - provider: SerializerProvider + provider: SerializerProvider, ) { when { value.auto != null -> generator.writeObject(value.auto) @@ -3155,7 +3141,7 @@ private constructor( override fun serialize( value: LearningRateMultiplier, generator: JsonGenerator, - provider: SerializerProvider + provider: SerializerProvider, ) { when { value.auto != null -> generator.writeObject(value.auto) @@ -3308,7 +3294,7 @@ private constructor( override fun serialize( value: NEpochs, generator: JsonGenerator, - provider: SerializerProvider + provider: SerializerProvider, ) { when { value.auto != null -> generator.writeObject(value.auto) @@ -3804,7 +3790,7 @@ private constructor( override fun serialize( value: BatchSize, generator: JsonGenerator, - provider: SerializerProvider + provider: SerializerProvider, ) { when { value.auto != null -> generator.writeObject(value.auto) @@ -3965,7 +3951,7 @@ private constructor( override fun serialize( value: LearningRateMultiplier, generator: JsonGenerator, - provider: SerializerProvider + provider: SerializerProvider, ) { when { value.auto != null -> generator.writeObject(value.auto) @@ -4118,7 +4104,7 @@ private constructor( override fun serialize( value: NEpochs, generator: JsonGenerator, - provider: SerializerProvider + provider: SerializerProvider, ) { when { value.auto != null -> generator.writeObject(value.auto) @@ -4167,11 +4153,7 @@ private constructor( } /** The type of method. Is either `supervised` or `dpo`. */ - class Type - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Type @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. 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 a36b0877..dec027d5 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 @@ -198,11 +198,7 @@ private constructor( } /** The log level of the event. */ - class Level - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Level @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. @@ -297,11 +293,7 @@ private constructor( } /** The type of event. */ - class Type - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Type @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. 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 579cafcf..0f96f648 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 @@ -70,11 +70,7 @@ private constructor( @JvmStatic fun of(jobsService: JobService, params: FineTuningJobListEventsParams, response: Response) = - FineTuningJobListEventsPage( - jobsService, - params, - response, - ) + FineTuningJobListEventsPage(jobsService, params, response) } @NoAutoDetect @@ -159,18 +155,12 @@ private constructor( this.additionalProperties.put(key, value) } - fun build() = - Response( - data, - hasMore, - additionalProperties.toImmutable(), - ) + fun build() = Response(data, hasMore, additionalProperties.toImmutable()) } } - class AutoPager( - private val firstPage: FineTuningJobListEventsPage, - ) : Iterable { + class AutoPager(private val firstPage: FineTuningJobListEventsPage) : + Iterable { override fun iterator(): Iterator = iterator { var page = firstPage 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 2aa588a2..0e638b51 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 @@ -75,13 +75,8 @@ private constructor( fun of( jobsService: JobServiceAsync, params: FineTuningJobListEventsParams, - response: Response - ) = - FineTuningJobListEventsPageAsync( - jobsService, - params, - response, - ) + response: Response, + ) = FineTuningJobListEventsPageAsync(jobsService, params, response) } @NoAutoDetect @@ -166,26 +161,19 @@ private constructor( this.additionalProperties.put(key, value) } - fun build() = - Response( - data, - hasMore, - additionalProperties.toImmutable(), - ) + fun build() = Response(data, hasMore, additionalProperties.toImmutable()) } } - class AutoPager( - private val firstPage: FineTuningJobListEventsPageAsync, - ) { + class AutoPager(private val firstPage: FineTuningJobListEventsPageAsync) { fun forEach( action: Predicate, - executor: Executor + executor: Executor, ): CompletableFuture { fun CompletableFuture>.forEach( action: (FineTuningJobEvent) -> Boolean, - executor: Executor + executor: Executor, ): CompletableFuture = thenComposeAsync( { page -> @@ -194,7 +182,7 @@ private constructor( .map { it.getNextPage().forEach(action, executor) } .orElseGet { CompletableFuture.completedFuture(null) } }, - executor + executor, ) return CompletableFuture.completedFuture(Optional.of(firstPage)) .forEach(action::test, executor) 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 900b92b3..6b603cb4 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 @@ -70,11 +70,7 @@ private constructor( @JvmStatic fun of(jobsService: JobService, params: FineTuningJobListParams, response: Response) = - FineTuningJobListPage( - jobsService, - params, - response, - ) + FineTuningJobListPage(jobsService, params, response) } @NoAutoDetect @@ -158,18 +154,11 @@ private constructor( this.additionalProperties.put(key, value) } - fun build() = - Response( - data, - hasMore, - additionalProperties.toImmutable(), - ) + fun build() = Response(data, hasMore, additionalProperties.toImmutable()) } } - class AutoPager( - private val firstPage: FineTuningJobListPage, - ) : Iterable { + class AutoPager(private val firstPage: FineTuningJobListPage) : Iterable { override fun iterator(): Iterator = iterator { var page = firstPage 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 72f65457..22432b88 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 @@ -73,11 +73,7 @@ private constructor( @JvmStatic fun of(jobsService: JobServiceAsync, params: FineTuningJobListParams, response: Response) = - FineTuningJobListPageAsync( - jobsService, - params, - response, - ) + FineTuningJobListPageAsync(jobsService, params, response) } @NoAutoDetect @@ -161,23 +157,16 @@ private constructor( this.additionalProperties.put(key, value) } - fun build() = - Response( - data, - hasMore, - additionalProperties.toImmutable(), - ) + fun build() = Response(data, hasMore, additionalProperties.toImmutable()) } } - class AutoPager( - private val firstPage: FineTuningJobListPageAsync, - ) { + class AutoPager(private val firstPage: FineTuningJobListPageAsync) { fun forEach(action: Predicate, executor: Executor): CompletableFuture { fun CompletableFuture>.forEach( action: (FineTuningJob) -> Boolean, - executor: Executor + executor: Executor, ): CompletableFuture = thenComposeAsync( { page -> @@ -186,7 +175,7 @@ private constructor( .map { it.getNextPage().forEach(action, executor) } .orElseGet { CompletableFuture.completedFuture(null) } }, - executor + executor, ) return CompletableFuture.completedFuture(Optional.of(firstPage)) .forEach(action::test, executor) diff --git a/openai-java-core/src/main/kotlin/com/openai/models/FunctionParameters.kt b/openai-java-core/src/main/kotlin/com/openai/models/FunctionParameters.kt index fe8032a4..ed2423ae 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/FunctionParameters.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/FunctionParameters.kt @@ -24,7 +24,7 @@ import java.util.Objects class FunctionParameters @JsonCreator private constructor( - @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), + @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap() ) { @JsonAnyGetter 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 9141e887..f0f0cdf5 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 @@ -286,12 +286,7 @@ private constructor( } fun build(): Function = - Function( - arguments, - name, - output, - additionalProperties.toImmutable(), - ) + Function(arguments, name, output, additionalProperties.toImmutable()) } override fun equals(other: Any?): Boolean { diff --git a/openai-java-core/src/main/kotlin/com/openai/models/Image.kt b/openai-java-core/src/main/kotlin/com/openai/models/Image.kt index 3d3a3906..8cc58403 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/Image.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/Image.kt @@ -135,13 +135,7 @@ private constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): Image = - Image( - b64Json, - revisedPrompt, - url, - additionalProperties.toImmutable(), - ) + fun build(): Image = Image(b64Json, revisedPrompt, url, additionalProperties.toImmutable()) } override fun equals(other: Any?): Boolean { 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 f41a0e4c..9841fb79 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 @@ -141,22 +141,14 @@ private constructor( } fun build(): ImageFile = - ImageFile( - checkRequired("fileId", fileId), - detail, - additionalProperties.toImmutable(), - ) + ImageFile(checkRequired("fileId", fileId), detail, additionalProperties.toImmutable()) } /** * 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( - private val value: JsonField, - ) : Enum { + class Detail @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. 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 0f8db809..8e9fb92d 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 @@ -140,22 +140,14 @@ private constructor( } fun build(): ImageFileDelta = - ImageFileDelta( - detail, - fileId, - additionalProperties.toImmutable(), - ) + ImageFileDelta(detail, fileId, additionalProperties.toImmutable()) } /** * 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( - private val value: JsonField, - ) : Enum { + class Detail @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. 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 c657fe5d..99d75d7e 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 @@ -811,11 +811,7 @@ private 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( - private val value: JsonField, - ) : Enum { + class Quality @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. @@ -907,11 +903,8 @@ private constructor( * 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( - private val value: JsonField, - ) : Enum { + class ResponseFormat @JsonCreator private constructor(private val value: JsonField) : + Enum { /** * Returns this class instance's raw value. @@ -1006,11 +999,7 @@ private constructor( * 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( - private val value: JsonField, - ) : Enum { + class Size @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. @@ -1122,11 +1111,7 @@ private constructor( * produce more natural, less hyper-real looking images. This param is only supported for * `dall-e-3`. */ - class Style - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Style @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ImageModel.kt b/openai-java-core/src/main/kotlin/com/openai/models/ImageModel.kt index dc786374..2be77966 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ImageModel.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ImageModel.kt @@ -7,11 +7,7 @@ import com.openai.core.Enum import com.openai.core.JsonField import com.openai.errors.OpenAIInvalidDataException -class ImageModel -@JsonCreator -private constructor( - private val value: JsonField, -) : Enum { +class ImageModel @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. 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 9adc97cf..9f4439f7 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 @@ -133,22 +133,14 @@ private constructor( } fun build(): ImageUrl = - ImageUrl( - checkRequired("url", url), - detail, - additionalProperties.toImmutable(), - ) + ImageUrl(checkRequired("url", url), detail, additionalProperties.toImmutable()) } /** * 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( - private val value: JsonField, - ) : Enum { + class Detail @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. 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 3e199c14..79f9bfd6 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 @@ -121,23 +121,14 @@ private constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): ImageUrlDelta = - ImageUrlDelta( - detail, - url, - additionalProperties.toImmutable(), - ) + fun build(): ImageUrlDelta = ImageUrlDelta(detail, url, additionalProperties.toImmutable()) } /** * 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( - private val value: JsonField, - ) : Enum { + class Detail @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. 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 5365a6d9..b6e9f78d 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 @@ -850,7 +850,7 @@ private constructor( override fun serialize( value: Tool, generator: JsonGenerator, - provider: SerializerProvider + provider: SerializerProvider, ) { when { value.codeInterpreter != null -> @@ -962,16 +962,12 @@ private constructor( fun build(): IncompleteDetails = IncompleteDetails( checkRequired("reason", reason), - additionalProperties.toImmutable() + additionalProperties.toImmutable(), ) } /** The reason the message is incomplete. */ - class Reason - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Reason @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. @@ -1098,11 +1094,7 @@ private constructor( } /** The entity that produced the message. One of `user` or `assistant`. */ - class Role - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Role @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. @@ -1193,11 +1185,7 @@ private constructor( /** * The status of the message, which can be either `in_progress`, `incomplete`, or `completed`. */ - class Status - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Status @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. 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 853c7fcd..76d5dfa7 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 @@ -229,7 +229,7 @@ private constructor( override fun serialize( value: MessageContent, generator: JsonGenerator, - provider: SerializerProvider + provider: SerializerProvider, ) { when { value.imageFile != null -> generator.writeObject(value.imageFile) 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 8dacbcb4..73428db2 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 @@ -232,7 +232,7 @@ private constructor( override fun serialize( value: MessageContentDelta, generator: JsonGenerator, - provider: SerializerProvider + provider: SerializerProvider, ) { when { value.imageFile != null -> generator.writeObject(value.imageFile) 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 60d54e82..d1d90580 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 @@ -207,7 +207,7 @@ private constructor( override fun serialize( value: MessageContentPartParam, generator: JsonGenerator, - provider: SerializerProvider + provider: SerializerProvider, ) { when { value.imageFile != null -> generator.writeObject(value.imageFile) 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 99d2d7e6..6ba45053 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 @@ -195,7 +195,7 @@ private constructor( fun build(): MessageCreation = MessageCreation( checkRequired("messageId", messageId), - additionalProperties.toImmutable() + additionalProperties.toImmutable(), ) } 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 df8ce5e0..eec1b98b 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 @@ -174,11 +174,7 @@ private constructor( } /** The entity that produced the message. One of `user` or `assistant`. */ - class Role - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Role @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. 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 f2da4f16..98a22256 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 @@ -353,7 +353,7 @@ private constructor( override fun serialize( value: MessageStreamEvent, generator: JsonGenerator, - provider: SerializerProvider + provider: SerializerProvider, ) { when { value.threadMessageCreated != null -> diff --git a/openai-java-core/src/main/kotlin/com/openai/models/Metadata.kt b/openai-java-core/src/main/kotlin/com/openai/models/Metadata.kt index b60aecdf..17e326d6 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/Metadata.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/Metadata.kt @@ -24,7 +24,7 @@ import java.util.Objects class Metadata @JsonCreator private constructor( - @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), + @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap() ) { @JsonAnyGetter 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 7d284d30..0cdb73e3 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 @@ -67,11 +67,7 @@ private constructor( @JvmStatic fun of(modelsService: ModelService, params: ModelListParams, response: Response) = - ModelListPage( - modelsService, - params, - response, - ) + ModelListPage(modelsService, params, response) } @NoAutoDetect @@ -155,18 +151,11 @@ private constructor( this.additionalProperties.put(key, value) } - fun build() = - Response( - data, - object_, - additionalProperties.toImmutable(), - ) + fun build() = Response(data, object_, additionalProperties.toImmutable()) } } - class AutoPager( - private val firstPage: ModelListPage, - ) : Iterable { + class AutoPager(private val firstPage: ModelListPage) : Iterable { override fun iterator(): Iterator = iterator { var page = firstPage 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 0973052f..db42be93 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 @@ -70,11 +70,7 @@ private constructor( @JvmStatic fun of(modelsService: ModelServiceAsync, params: ModelListParams, response: Response) = - ModelListPageAsync( - modelsService, - params, - response, - ) + ModelListPageAsync(modelsService, params, response) } @NoAutoDetect @@ -158,23 +154,16 @@ private constructor( this.additionalProperties.put(key, value) } - fun build() = - Response( - data, - object_, - additionalProperties.toImmutable(), - ) + fun build() = Response(data, object_, additionalProperties.toImmutable()) } } - class AutoPager( - private val firstPage: ModelListPageAsync, - ) { + class AutoPager(private val firstPage: ModelListPageAsync) { fun forEach(action: Predicate, executor: Executor): CompletableFuture { fun CompletableFuture>.forEach( action: (Model) -> Boolean, - executor: Executor + executor: Executor, ): CompletableFuture = thenComposeAsync( { page -> @@ -183,7 +172,7 @@ private constructor( .map { it.getNextPage().forEach(action, executor) } .orElseGet { CompletableFuture.completedFuture(null) } }, - executor + executor, ) return CompletableFuture.completedFuture(Optional.of(firstPage)) .forEach(action::test, executor) diff --git a/openai-java-core/src/main/kotlin/com/openai/models/Moderation.kt b/openai-java-core/src/main/kotlin/com/openai/models/Moderation.kt index bbfc8d28..f44485c2 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/Moderation.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/Moderation.kt @@ -1255,11 +1255,8 @@ private constructor( ) } - class Harassment - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Harassment @JsonCreator private constructor(private val value: JsonField) : + Enum { /** * Returns this class instance's raw value. @@ -1280,7 +1277,7 @@ private constructor( /** An enum containing [Harassment]'s known values. */ enum class Known { - TEXT, + TEXT } /** @@ -1346,9 +1343,7 @@ private constructor( class HarassmentThreatening @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. @@ -1369,7 +1364,7 @@ private constructor( /** An enum containing [HarassmentThreatening]'s known values. */ enum class Known { - TEXT, + TEXT } /** @@ -1436,11 +1431,7 @@ private constructor( override fun toString() = value.toString() } - class Hate - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Hate @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. @@ -1461,7 +1452,7 @@ private constructor( /** An enum containing [Hate]'s known values. */ enum class Known { - TEXT, + TEXT } /** @@ -1524,9 +1515,7 @@ private constructor( class HateThreatening @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. @@ -1547,7 +1536,7 @@ private constructor( /** An enum containing [HateThreatening]'s known values. */ enum class Known { - TEXT, + TEXT } /** @@ -1611,11 +1600,8 @@ private constructor( override fun toString() = value.toString() } - class Illicit - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Illicit @JsonCreator private constructor(private val value: JsonField) : + Enum { /** * Returns this class instance's raw value. @@ -1636,7 +1622,7 @@ private constructor( /** An enum containing [Illicit]'s known values. */ enum class Known { - TEXT, + TEXT } /** @@ -1701,9 +1687,7 @@ private constructor( class IllicitViolent @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. @@ -1724,7 +1708,7 @@ private constructor( /** An enum containing [IllicitViolent]'s known values. */ enum class Known { - TEXT, + TEXT } /** @@ -1788,11 +1772,8 @@ private constructor( override fun toString() = value.toString() } - class SelfHarm - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class SelfHarm @JsonCreator private constructor(private val value: JsonField) : + Enum { /** * Returns this class instance's raw value. @@ -1884,9 +1865,7 @@ private constructor( class SelfHarmInstruction @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. @@ -1981,9 +1960,7 @@ private constructor( class SelfHarmIntent @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. @@ -2074,11 +2051,7 @@ private constructor( override fun toString() = value.toString() } - class Sexual - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Sexual @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. @@ -2168,11 +2141,8 @@ private constructor( override fun toString() = value.toString() } - class SexualMinor - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class SexualMinor @JsonCreator private constructor(private val value: JsonField) : + Enum { /** * Returns this class instance's raw value. @@ -2193,7 +2163,7 @@ private constructor( /** An enum containing [SexualMinor]'s known values. */ enum class Known { - TEXT, + TEXT } /** @@ -2257,11 +2227,8 @@ private constructor( override fun toString() = value.toString() } - class Violence - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Violence @JsonCreator private constructor(private val value: JsonField) : + Enum { /** * Returns this class instance's raw value. @@ -2353,9 +2320,7 @@ private constructor( class ViolenceGraphic @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. 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 b62a7078..d2a5b156 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 @@ -603,7 +603,7 @@ private constructor( override fun serialize( value: Input, generator: JsonGenerator, - provider: SerializerProvider + provider: SerializerProvider, ) { when { value.string != null -> generator.writeObject(value.string) diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ModerationModel.kt b/openai-java-core/src/main/kotlin/com/openai/models/ModerationModel.kt index cd3ea08b..e23cd8a8 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ModerationModel.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ModerationModel.kt @@ -7,11 +7,8 @@ import com.openai.core.Enum import com.openai.core.JsonField import com.openai.errors.OpenAIInvalidDataException -class ModerationModel -@JsonCreator -private constructor( - private val value: JsonField, -) : Enum { +class ModerationModel @JsonCreator private constructor(private val value: JsonField) : + Enum { /** * Returns this class instance's raw value. 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 581663de..2819b0ee 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 @@ -165,7 +165,7 @@ private constructor( override fun serialize( value: ModerationMultiModalInput, generator: JsonGenerator, - provider: SerializerProvider + provider: SerializerProvider, ) { when { value.imageUrl != null -> generator.writeObject(value.imageUrl) 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 a215cee9..bc935348 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 @@ -325,7 +325,7 @@ private constructor( @JsonCreator private constructor( @JsonAnySetter - private val additionalProperties: Map = immutableEmptyMap(), + private val additionalProperties: Map = immutableEmptyMap() ) { @JsonAnyGetter 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 564b6d42..fccd260f 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 @@ -1301,11 +1301,7 @@ private constructor( * 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( - private val value: JsonField, - ) : Enum { + class Reason @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. @@ -1515,11 +1511,7 @@ private constructor( } /** One of `server_error`, `rate_limit_exceeded`, or `invalid_prompt`. */ - class Code - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Code @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. @@ -1843,7 +1835,7 @@ private constructor( fun build(): SubmitToolOutputs = SubmitToolOutputs( checkRequired("toolCalls", toolCalls).map { it.toImmutable() }, - additionalProperties.toImmutable() + additionalProperties.toImmutable(), ) } @@ -2044,11 +2036,7 @@ private constructor( * 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( - private val value: JsonField, - ) : Enum { + class Type @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. 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 f9c9740d..5e48651c 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 @@ -11,11 +11,7 @@ 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( - private val value: JsonField, -) : Enum { +class RunStatus @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. 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 8e99457b..6d0e4dc5 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 @@ -667,11 +667,7 @@ private constructor( } /** One of `server_error` or `rate_limit_exceeded`. */ - class Code - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Code @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. @@ -781,11 +777,7 @@ private constructor( * The status of the run step, which can be either `in_progress`, `cancelled`, `failed`, * `completed`, or `expired`. */ - class Status - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Status @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. @@ -1041,7 +1033,7 @@ private constructor( override fun serialize( value: StepDetails, generator: JsonGenerator, - provider: SerializerProvider + provider: SerializerProvider, ) { when { value.messageCreation != null -> generator.writeObject(value.messageCreation) @@ -1054,11 +1046,7 @@ private constructor( } /** The type of run step, which can be either `message_creation` or `tool_calls`. */ - class Type - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Type @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. 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 21eb0d17..cecb05c5 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 @@ -270,7 +270,7 @@ private constructor( override fun serialize( value: StepDetails, generator: JsonGenerator, - provider: SerializerProvider + provider: SerializerProvider, ) { when { value.messageCreation != null -> generator.writeObject(value.messageCreation) 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 770cf812..613b30d0 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 @@ -110,11 +110,7 @@ private constructor( } fun build(): RunStepDeltaMessageDelta = - RunStepDeltaMessageDelta( - type, - messageCreation, - additionalProperties.toImmutable(), - ) + RunStepDeltaMessageDelta(type, messageCreation, additionalProperties.toImmutable()) } @NoAutoDetect diff --git a/openai-java-core/src/main/kotlin/com/openai/models/RunStepInclude.kt b/openai-java-core/src/main/kotlin/com/openai/models/RunStepInclude.kt index 6f4cb9e4..535b7eb1 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/RunStepInclude.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/RunStepInclude.kt @@ -7,11 +7,7 @@ import com.openai.core.Enum import com.openai.core.JsonField import com.openai.errors.OpenAIInvalidDataException -class RunStepInclude -@JsonCreator -private constructor( - private val value: JsonField, -) : Enum { +class RunStepInclude @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. @@ -33,7 +29,7 @@ private constructor( /** An enum containing [RunStepInclude]'s known values. */ enum class Known { - STEP_DETAILS_TOOL_CALLS_FILE_SEARCH_RESULTS_CONTENT, + STEP_DETAILS_TOOL_CALLS_FILE_SEARCH_RESULTS_CONTENT } /** 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 3c7522e5..8bd9b8cd 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 @@ -455,7 +455,7 @@ private constructor( override fun serialize( value: RunStepStreamEvent, generator: JsonGenerator, - provider: SerializerProvider + provider: SerializerProvider, ) { when { value.threadRunStepCreated != null -> 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 a5292384..cfb6cd2d 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 @@ -526,7 +526,7 @@ private constructor( override fun serialize( value: RunStreamEvent, generator: JsonGenerator, - provider: SerializerProvider + provider: SerializerProvider, ) { when { value.threadRunCreated != null -> generator.writeObject(value.threadRunCreated) 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 6a876aff..e106505b 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 @@ -102,11 +102,7 @@ private constructor( } fun build(): TextContentBlock = - TextContentBlock( - checkRequired("text", text), - type, - additionalProperties.toImmutable(), - ) + TextContentBlock(checkRequired("text", text), type, additionalProperties.toImmutable()) } override fun equals(other: Any?): Boolean { 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 dd94a142..200662bc 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 @@ -348,11 +348,7 @@ private constructor( } fun build(): ToolResources = - ToolResources( - codeInterpreter, - fileSearch, - additionalProperties.toImmutable(), - ) + ToolResources(codeInterpreter, fileSearch, additionalProperties.toImmutable()) } @NoAutoDetect @@ -476,7 +472,7 @@ private constructor( fun build(): CodeInterpreter = CodeInterpreter( (fileIds ?: JsonMissing.of()).map { it.toImmutable() }, - additionalProperties.toImmutable() + additionalProperties.toImmutable(), ) } @@ -625,7 +621,7 @@ private constructor( fun build(): FileSearch = FileSearch( (vectorStoreIds ?: JsonMissing.of()).map { it.toImmutable() }, - additionalProperties.toImmutable() + additionalProperties.toImmutable(), ) } 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 91e104f5..fe2671f9 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 @@ -179,7 +179,7 @@ private constructor( override fun serialize( value: ToolCall, generator: JsonGenerator, - provider: SerializerProvider + provider: SerializerProvider, ) { when { value.codeInterpreter != null -> generator.writeObject(value.codeInterpreter) 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 565533e5..635db809 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 @@ -187,7 +187,7 @@ private constructor( override fun serialize( value: ToolCallDelta, generator: JsonGenerator, - provider: SerializerProvider + provider: SerializerProvider, ) { when { value.codeInterpreter != null -> generator.writeObject(value.codeInterpreter) 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 ba53b587..573386b2 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 @@ -266,11 +266,7 @@ private constructor( } /** The status of the Upload. */ - class Status - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Status @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. 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 485126fd..cc58d84a 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 @@ -536,11 +536,7 @@ private constructor( * 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( - private val value: JsonField, - ) : Enum { + class Status @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. 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 6bbaf694..ac5a4f15 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 @@ -418,11 +418,7 @@ private constructor( } /** One of `server_error` or `rate_limit_exceeded`. */ - class Code - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Code @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. @@ -539,11 +535,7 @@ private constructor( * `cancelled`, or `failed`. The status `completed` indicates that the vector store file is * ready for use. */ - class Status - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Status @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. 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 2564ad07..2c7fa926 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 @@ -401,11 +401,7 @@ private constructor( * The status of the vector store files batch, which can be either `in_progress`, `completed`, * `cancelled` or `failed`. */ - class Status - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Status @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. diff --git a/openai-java-core/src/main/kotlin/com/openai/services/async/BatchServiceAsync.kt b/openai-java-core/src/main/kotlin/com/openai/services/async/BatchServiceAsync.kt index ca255f6c..f66ddb0e 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/async/BatchServiceAsync.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/async/BatchServiceAsync.kt @@ -19,21 +19,21 @@ interface BatchServiceAsync { @JvmOverloads fun create( params: BatchCreateParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture /** Retrieves a batch. */ @JvmOverloads fun retrieve( params: BatchRetrieveParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture /** List your organization's batches. */ @JvmOverloads fun list( params: BatchListParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture /** @@ -44,6 +44,6 @@ interface BatchServiceAsync { @JvmOverloads fun cancel( params: BatchCancelParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture } diff --git a/openai-java-core/src/main/kotlin/com/openai/services/async/BatchServiceAsyncImpl.kt b/openai-java-core/src/main/kotlin/com/openai/services/async/BatchServiceAsyncImpl.kt index 048bef50..c54ba677 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/async/BatchServiceAsyncImpl.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/async/BatchServiceAsyncImpl.kt @@ -21,10 +21,8 @@ import com.openai.models.BatchListParams import com.openai.models.BatchRetrieveParams import java.util.concurrent.CompletableFuture -class BatchServiceAsyncImpl -internal constructor( - private val clientOptions: ClientOptions, -) : BatchServiceAsync { +class BatchServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : + BatchServiceAsync { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) @@ -34,7 +32,7 @@ internal constructor( /** Creates and executes a batch from an uploaded file of requests */ override fun create( params: BatchCreateParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() @@ -62,7 +60,7 @@ internal constructor( /** Retrieves a batch. */ override fun retrieve( params: BatchRetrieveParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() @@ -90,7 +88,7 @@ internal constructor( /** List your organization's batches. */ override fun list( params: BatchListParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() @@ -122,7 +120,7 @@ internal constructor( */ override fun cancel( params: BatchCancelParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() diff --git a/openai-java-core/src/main/kotlin/com/openai/services/async/BetaServiceAsyncImpl.kt b/openai-java-core/src/main/kotlin/com/openai/services/async/BetaServiceAsyncImpl.kt index 767ea7f6..53ce7d8a 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/async/BetaServiceAsyncImpl.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/async/BetaServiceAsyncImpl.kt @@ -11,10 +11,8 @@ import com.openai.services.async.beta.ThreadServiceAsyncImpl import com.openai.services.async.beta.VectorStoreServiceAsync import com.openai.services.async.beta.VectorStoreServiceAsyncImpl -class BetaServiceAsyncImpl -internal constructor( - private val clientOptions: ClientOptions, -) : BetaServiceAsync { +class BetaServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : + BetaServiceAsync { companion object { diff --git a/openai-java-core/src/main/kotlin/com/openai/services/async/ChatServiceAsyncImpl.kt b/openai-java-core/src/main/kotlin/com/openai/services/async/ChatServiceAsyncImpl.kt index f56fc535..e8b7de07 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/async/ChatServiceAsyncImpl.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/async/ChatServiceAsyncImpl.kt @@ -6,10 +6,8 @@ import com.openai.core.ClientOptions import com.openai.services.async.chat.CompletionServiceAsync import com.openai.services.async.chat.CompletionServiceAsyncImpl -class ChatServiceAsyncImpl -internal constructor( - private val clientOptions: ClientOptions, -) : ChatServiceAsync { +class ChatServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : + ChatServiceAsync { private val completions: CompletionServiceAsync by lazy { CompletionServiceAsyncImpl(clientOptions) diff --git a/openai-java-core/src/main/kotlin/com/openai/services/async/CompletionServiceAsync.kt b/openai-java-core/src/main/kotlin/com/openai/services/async/CompletionServiceAsync.kt index ce272a94..7248bcd9 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/async/CompletionServiceAsync.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/async/CompletionServiceAsync.kt @@ -16,13 +16,13 @@ interface CompletionServiceAsync { @JvmOverloads fun create( params: CompletionCreateParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture /** Creates a completion for the provided prompt and parameters. */ @JvmOverloads fun createStreaming( params: CompletionCreateParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): AsyncStreamResponse } diff --git a/openai-java-core/src/main/kotlin/com/openai/services/async/CompletionServiceAsyncImpl.kt b/openai-java-core/src/main/kotlin/com/openai/services/async/CompletionServiceAsyncImpl.kt index 22e266ad..401d1fad 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/async/CompletionServiceAsyncImpl.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/async/CompletionServiceAsyncImpl.kt @@ -24,10 +24,8 @@ import com.openai.models.Completion import com.openai.models.CompletionCreateParams import java.util.concurrent.CompletableFuture -class CompletionServiceAsyncImpl -internal constructor( - private val clientOptions: ClientOptions, -) : CompletionServiceAsync { +class CompletionServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : + CompletionServiceAsync { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) @@ -37,7 +35,7 @@ internal constructor( /** Creates a completion for the provided prompt and parameters. */ override fun create( params: CompletionCreateParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() @@ -65,7 +63,7 @@ internal constructor( /** Creates a completion for the provided prompt and parameters. */ override fun createStreaming( params: CompletionCreateParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): AsyncStreamResponse { val request = HttpRequest.builder() @@ -78,7 +76,7 @@ internal constructor( ._body() .toBuilder() .putAdditionalProperty("stream", JsonValue.from(true)) - .build() + .build(), ) ) .build() diff --git a/openai-java-core/src/main/kotlin/com/openai/services/async/EmbeddingServiceAsync.kt b/openai-java-core/src/main/kotlin/com/openai/services/async/EmbeddingServiceAsync.kt index 4e86c969..c21a831a 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/async/EmbeddingServiceAsync.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/async/EmbeddingServiceAsync.kt @@ -15,6 +15,6 @@ interface EmbeddingServiceAsync { @JvmOverloads fun create( params: EmbeddingCreateParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture } diff --git a/openai-java-core/src/main/kotlin/com/openai/services/async/EmbeddingServiceAsyncImpl.kt b/openai-java-core/src/main/kotlin/com/openai/services/async/EmbeddingServiceAsyncImpl.kt index d3b23903..85126122 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/async/EmbeddingServiceAsyncImpl.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/async/EmbeddingServiceAsyncImpl.kt @@ -17,10 +17,8 @@ import com.openai.models.CreateEmbeddingResponse import com.openai.models.EmbeddingCreateParams import java.util.concurrent.CompletableFuture -class EmbeddingServiceAsyncImpl -internal constructor( - private val clientOptions: ClientOptions, -) : EmbeddingServiceAsync { +class EmbeddingServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : + EmbeddingServiceAsync { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) @@ -31,7 +29,7 @@ internal constructor( /** Creates an embedding vector representing the input text. */ override fun create( params: EmbeddingCreateParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() diff --git a/openai-java-core/src/main/kotlin/com/openai/services/async/FileServiceAsync.kt b/openai-java-core/src/main/kotlin/com/openai/services/async/FileServiceAsync.kt index f3eb996d..f33e3122 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/async/FileServiceAsync.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/async/FileServiceAsync.kt @@ -22,21 +22,21 @@ interface FileServiceAsync { @JvmOverloads fun retrieve( params: FileRetrieveParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture /** Returns a list of files. */ @JvmOverloads fun list( params: FileListParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture /** Delete a file. */ @JvmOverloads fun delete( params: FileDeleteParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture /** Returns the contents of the specified file. */ @@ -44,6 +44,6 @@ interface FileServiceAsync { @MustBeClosed fun content( params: FileContentParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture } diff --git a/openai-java-core/src/main/kotlin/com/openai/services/async/FileServiceAsyncImpl.kt b/openai-java-core/src/main/kotlin/com/openai/services/async/FileServiceAsyncImpl.kt index c6f39654..77e3f44f 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/async/FileServiceAsyncImpl.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/async/FileServiceAsyncImpl.kt @@ -23,10 +23,8 @@ import com.openai.models.FileObject import com.openai.models.FileRetrieveParams import java.util.concurrent.CompletableFuture -class FileServiceAsyncImpl -internal constructor( - private val clientOptions: ClientOptions, -) : FileServiceAsync { +class FileServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : + FileServiceAsync { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) @@ -36,7 +34,7 @@ internal constructor( /** Returns information about a specific file. */ override fun retrieve( params: FileRetrieveParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() @@ -64,7 +62,7 @@ internal constructor( /** Returns a list of files. */ override fun list( params: FileListParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() @@ -92,7 +90,7 @@ internal constructor( /** Delete a file. */ override fun delete( params: FileDeleteParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() @@ -117,7 +115,7 @@ internal constructor( /** Returns the contents of the specified file. */ override fun content( params: FileContentParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() diff --git a/openai-java-core/src/main/kotlin/com/openai/services/async/FineTuningServiceAsyncImpl.kt b/openai-java-core/src/main/kotlin/com/openai/services/async/FineTuningServiceAsyncImpl.kt index 7cd3a3f5..62bb532e 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/async/FineTuningServiceAsyncImpl.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/async/FineTuningServiceAsyncImpl.kt @@ -6,10 +6,8 @@ import com.openai.core.ClientOptions import com.openai.services.async.fineTuning.JobServiceAsync import com.openai.services.async.fineTuning.JobServiceAsyncImpl -class FineTuningServiceAsyncImpl -internal constructor( - private val clientOptions: ClientOptions, -) : FineTuningServiceAsync { +class FineTuningServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : + FineTuningServiceAsync { private val jobs: JobServiceAsync by lazy { JobServiceAsyncImpl(clientOptions) } diff --git a/openai-java-core/src/main/kotlin/com/openai/services/async/ImageServiceAsync.kt b/openai-java-core/src/main/kotlin/com/openai/services/async/ImageServiceAsync.kt index bf33b742..0f13635d 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/async/ImageServiceAsync.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/async/ImageServiceAsync.kt @@ -15,6 +15,6 @@ interface ImageServiceAsync { @JvmOverloads fun generate( params: ImageGenerateParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture } diff --git a/openai-java-core/src/main/kotlin/com/openai/services/async/ImageServiceAsyncImpl.kt b/openai-java-core/src/main/kotlin/com/openai/services/async/ImageServiceAsyncImpl.kt index 9cab5447..16bcbce9 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/async/ImageServiceAsyncImpl.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/async/ImageServiceAsyncImpl.kt @@ -17,10 +17,8 @@ import com.openai.models.ImageGenerateParams import com.openai.models.ImagesResponse import java.util.concurrent.CompletableFuture -class ImageServiceAsyncImpl -internal constructor( - private val clientOptions: ClientOptions, -) : ImageServiceAsync { +class ImageServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : + ImageServiceAsync { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) @@ -30,7 +28,7 @@ internal constructor( /** Creates an image given a prompt. */ override fun generate( params: ImageGenerateParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() diff --git a/openai-java-core/src/main/kotlin/com/openai/services/async/ModelServiceAsync.kt b/openai-java-core/src/main/kotlin/com/openai/services/async/ModelServiceAsync.kt index b134548b..8650cf2d 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/async/ModelServiceAsync.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/async/ModelServiceAsync.kt @@ -22,7 +22,7 @@ interface ModelServiceAsync { @JvmOverloads fun retrieve( params: ModelRetrieveParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture /** @@ -32,7 +32,7 @@ interface ModelServiceAsync { @JvmOverloads fun list( params: ModelListParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture /** @@ -42,6 +42,6 @@ interface ModelServiceAsync { @JvmOverloads fun delete( params: ModelDeleteParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture } diff --git a/openai-java-core/src/main/kotlin/com/openai/services/async/ModelServiceAsyncImpl.kt b/openai-java-core/src/main/kotlin/com/openai/services/async/ModelServiceAsyncImpl.kt index 0a6414e5..cf108aa7 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/async/ModelServiceAsyncImpl.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/async/ModelServiceAsyncImpl.kt @@ -21,10 +21,8 @@ import com.openai.models.ModelListParams import com.openai.models.ModelRetrieveParams import java.util.concurrent.CompletableFuture -class ModelServiceAsyncImpl -internal constructor( - private val clientOptions: ClientOptions, -) : ModelServiceAsync { +class ModelServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : + ModelServiceAsync { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) @@ -37,7 +35,7 @@ internal constructor( */ override fun retrieve( params: ModelRetrieveParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() @@ -68,7 +66,7 @@ internal constructor( */ override fun list( params: ModelListParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() @@ -99,7 +97,7 @@ internal constructor( */ override fun delete( params: ModelDeleteParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() diff --git a/openai-java-core/src/main/kotlin/com/openai/services/async/ModerationServiceAsync.kt b/openai-java-core/src/main/kotlin/com/openai/services/async/ModerationServiceAsync.kt index ba595972..0359f8c8 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/async/ModerationServiceAsync.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/async/ModerationServiceAsync.kt @@ -18,6 +18,6 @@ interface ModerationServiceAsync { @JvmOverloads fun create( params: ModerationCreateParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture } diff --git a/openai-java-core/src/main/kotlin/com/openai/services/async/ModerationServiceAsyncImpl.kt b/openai-java-core/src/main/kotlin/com/openai/services/async/ModerationServiceAsyncImpl.kt index eae5eb56..53854535 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/async/ModerationServiceAsyncImpl.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/async/ModerationServiceAsyncImpl.kt @@ -17,10 +17,8 @@ import com.openai.models.ModerationCreateParams import com.openai.models.ModerationCreateResponse import java.util.concurrent.CompletableFuture -class ModerationServiceAsyncImpl -internal constructor( - private val clientOptions: ClientOptions, -) : ModerationServiceAsync { +class ModerationServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : + ModerationServiceAsync { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) @@ -34,7 +32,7 @@ internal constructor( */ override fun create( params: ModerationCreateParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() @@ -45,7 +43,7 @@ internal constructor( .prepareAsync( clientOptions, params, - params.model().map { it.toString() }.orElse(null) + params.model().map { it.toString() }.orElse(null), ) return request .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } diff --git a/openai-java-core/src/main/kotlin/com/openai/services/async/UploadServiceAsync.kt b/openai-java-core/src/main/kotlin/com/openai/services/async/UploadServiceAsync.kt index 0fda05fb..5c8a437f 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/async/UploadServiceAsync.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/async/UploadServiceAsync.kt @@ -39,14 +39,14 @@ interface UploadServiceAsync { @JvmOverloads fun create( params: UploadCreateParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture /** Cancels the Upload. No Parts may be added after an Upload is cancelled. */ @JvmOverloads fun cancel( params: UploadCancelParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture /** @@ -65,6 +65,6 @@ interface UploadServiceAsync { @JvmOverloads fun complete( params: UploadCompleteParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture } diff --git a/openai-java-core/src/main/kotlin/com/openai/services/async/UploadServiceAsyncImpl.kt b/openai-java-core/src/main/kotlin/com/openai/services/async/UploadServiceAsyncImpl.kt index 7a45bb47..8df8d8f3 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/async/UploadServiceAsyncImpl.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/async/UploadServiceAsyncImpl.kt @@ -21,10 +21,8 @@ import com.openai.services.async.uploads.PartServiceAsync import com.openai.services.async.uploads.PartServiceAsyncImpl import java.util.concurrent.CompletableFuture -class UploadServiceAsyncImpl -internal constructor( - private val clientOptions: ClientOptions, -) : UploadServiceAsync { +class UploadServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : + UploadServiceAsync { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) @@ -57,7 +55,7 @@ internal constructor( */ override fun create( params: UploadCreateParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() @@ -85,7 +83,7 @@ internal constructor( /** Cancels the Upload. No Parts may be added after an Upload is cancelled. */ override fun cancel( params: UploadCancelParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() @@ -125,7 +123,7 @@ internal constructor( */ override fun complete( params: UploadCompleteParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() diff --git a/openai-java-core/src/main/kotlin/com/openai/services/async/beta/AssistantServiceAsync.kt b/openai-java-core/src/main/kotlin/com/openai/services/async/beta/AssistantServiceAsync.kt index 50008960..98051e25 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/async/beta/AssistantServiceAsync.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/async/beta/AssistantServiceAsync.kt @@ -21,34 +21,34 @@ interface AssistantServiceAsync { @JvmOverloads fun create( params: BetaAssistantCreateParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture /** Retrieves an assistant. */ @JvmOverloads fun retrieve( params: BetaAssistantRetrieveParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture /** Modifies an assistant. */ @JvmOverloads fun update( params: BetaAssistantUpdateParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture /** Returns a list of assistants. */ @JvmOverloads fun list( params: BetaAssistantListParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture /** Delete an assistant. */ @JvmOverloads fun delete( params: BetaAssistantDeleteParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture } diff --git a/openai-java-core/src/main/kotlin/com/openai/services/async/beta/AssistantServiceAsyncImpl.kt b/openai-java-core/src/main/kotlin/com/openai/services/async/beta/AssistantServiceAsyncImpl.kt index 7a00e4ee..1c02b0a3 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/async/beta/AssistantServiceAsyncImpl.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/async/beta/AssistantServiceAsyncImpl.kt @@ -24,10 +24,8 @@ import com.openai.models.BetaAssistantRetrieveParams import com.openai.models.BetaAssistantUpdateParams import java.util.concurrent.CompletableFuture -class AssistantServiceAsyncImpl -internal constructor( - private val clientOptions: ClientOptions, -) : AssistantServiceAsync { +class AssistantServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : + AssistantServiceAsync { companion object { @@ -42,7 +40,7 @@ internal constructor( /** Create an assistant with a model and instructions. */ override fun create( params: BetaAssistantCreateParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() @@ -71,7 +69,7 @@ internal constructor( /** Retrieves an assistant. */ override fun retrieve( params: BetaAssistantRetrieveParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() @@ -99,7 +97,7 @@ internal constructor( /** Modifies an assistant. */ override fun update( params: BetaAssistantUpdateParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() @@ -111,7 +109,7 @@ internal constructor( .prepareAsync( clientOptions, params, - params.model().map { it.toString() }.orElse(null) + params.model().map { it.toString() }.orElse(null), ) return request .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } @@ -133,7 +131,7 @@ internal constructor( /** Returns a list of assistants. */ override fun list( params: BetaAssistantListParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() @@ -162,7 +160,7 @@ internal constructor( /** Delete an assistant. */ override fun delete( params: BetaAssistantDeleteParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() diff --git a/openai-java-core/src/main/kotlin/com/openai/services/async/beta/ThreadServiceAsync.kt b/openai-java-core/src/main/kotlin/com/openai/services/async/beta/ThreadServiceAsync.kt index ecded1f6..c589fa9b 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/async/beta/ThreadServiceAsync.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/async/beta/ThreadServiceAsync.kt @@ -29,41 +29,41 @@ interface ThreadServiceAsync { @JvmOverloads fun create( params: BetaThreadCreateParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture /** Retrieves a thread. */ @JvmOverloads fun retrieve( params: BetaThreadRetrieveParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture /** Modifies a thread. */ @JvmOverloads fun update( params: BetaThreadUpdateParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture /** Delete a thread. */ @JvmOverloads fun delete( params: BetaThreadDeleteParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture /** Create a thread and run it in one request. */ @JvmOverloads fun createAndRun( params: BetaThreadCreateAndRunParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture /** Create a thread and run it in one request. */ @JvmOverloads fun createAndRunStreaming( params: BetaThreadCreateAndRunParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): AsyncStreamResponse } diff --git a/openai-java-core/src/main/kotlin/com/openai/services/async/beta/ThreadServiceAsyncImpl.kt b/openai-java-core/src/main/kotlin/com/openai/services/async/beta/ThreadServiceAsyncImpl.kt index 26eeafae..5298e095 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/async/beta/ThreadServiceAsyncImpl.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/async/beta/ThreadServiceAsyncImpl.kt @@ -36,10 +36,8 @@ import com.openai.services.async.beta.threads.RunServiceAsync import com.openai.services.async.beta.threads.RunServiceAsyncImpl import java.util.concurrent.CompletableFuture -class ThreadServiceAsyncImpl -internal constructor( - private val clientOptions: ClientOptions, -) : ThreadServiceAsync { +class ThreadServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : + ThreadServiceAsync { companion object { @@ -62,7 +60,7 @@ internal constructor( /** Create a thread. */ override fun create( params: BetaThreadCreateParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() @@ -91,7 +89,7 @@ internal constructor( /** Retrieves a thread. */ override fun retrieve( params: BetaThreadRetrieveParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() @@ -119,7 +117,7 @@ internal constructor( /** Modifies a thread. */ override fun update( params: BetaThreadUpdateParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() @@ -148,7 +146,7 @@ internal constructor( /** Delete a thread. */ override fun delete( params: BetaThreadDeleteParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() @@ -177,7 +175,7 @@ internal constructor( /** Create a thread and run it in one request. */ override fun createAndRun( params: BetaThreadCreateAndRunParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() @@ -189,7 +187,7 @@ internal constructor( .prepareAsync( clientOptions, params, - params.model().map { it.toString() }.orElse(null) + params.model().map { it.toString() }.orElse(null), ) return request .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } @@ -212,7 +210,7 @@ internal constructor( /** Create a thread and run it in one request. */ override fun createAndRunStreaming( params: BetaThreadCreateAndRunParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): AsyncStreamResponse { val request = HttpRequest.builder() @@ -226,14 +224,14 @@ internal constructor( ._body() .toBuilder() .putAdditionalProperty("stream", JsonValue.from(true)) - .build() + .build(), ) ) .build() .prepareAsync( clientOptions, params, - params.model().map { it.toString() }.orElse(null) + params.model().map { it.toString() }.orElse(null), ) return request .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } diff --git a/openai-java-core/src/main/kotlin/com/openai/services/async/beta/VectorStoreServiceAsync.kt b/openai-java-core/src/main/kotlin/com/openai/services/async/beta/VectorStoreServiceAsync.kt index a761338c..259448f7 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/async/beta/VectorStoreServiceAsync.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/async/beta/VectorStoreServiceAsync.kt @@ -27,34 +27,34 @@ interface VectorStoreServiceAsync { @JvmOverloads fun create( params: BetaVectorStoreCreateParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture /** Retrieves a vector store. */ @JvmOverloads fun retrieve( params: BetaVectorStoreRetrieveParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture /** Modifies a vector store. */ @JvmOverloads fun update( params: BetaVectorStoreUpdateParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture /** Returns a list of vector stores. */ @JvmOverloads fun list( params: BetaVectorStoreListParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture /** Delete a vector store. */ @JvmOverloads fun delete( params: BetaVectorStoreDeleteParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture } diff --git a/openai-java-core/src/main/kotlin/com/openai/services/async/beta/VectorStoreServiceAsyncImpl.kt b/openai-java-core/src/main/kotlin/com/openai/services/async/beta/VectorStoreServiceAsyncImpl.kt index fe02977e..fdd0c8c6 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/async/beta/VectorStoreServiceAsyncImpl.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/async/beta/VectorStoreServiceAsyncImpl.kt @@ -28,10 +28,8 @@ import com.openai.services.async.beta.vectorStores.FileServiceAsync import com.openai.services.async.beta.vectorStores.FileServiceAsyncImpl import java.util.concurrent.CompletableFuture -class VectorStoreServiceAsyncImpl -internal constructor( - private val clientOptions: ClientOptions, -) : VectorStoreServiceAsync { +class VectorStoreServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : + VectorStoreServiceAsync { companion object { @@ -56,7 +54,7 @@ internal constructor( /** Create a vector store. */ override fun create( params: BetaVectorStoreCreateParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() @@ -85,7 +83,7 @@ internal constructor( /** Retrieves a vector store. */ override fun retrieve( params: BetaVectorStoreRetrieveParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() @@ -113,7 +111,7 @@ internal constructor( /** Modifies a vector store. */ override fun update( params: BetaVectorStoreUpdateParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() @@ -143,7 +141,7 @@ internal constructor( /** Returns a list of vector stores. */ override fun list( params: BetaVectorStoreListParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() @@ -172,7 +170,7 @@ internal constructor( /** Delete a vector store. */ override fun delete( params: BetaVectorStoreDeleteParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() diff --git a/openai-java-core/src/main/kotlin/com/openai/services/async/beta/threads/MessageServiceAsync.kt b/openai-java-core/src/main/kotlin/com/openai/services/async/beta/threads/MessageServiceAsync.kt index 51e857f3..77b8f2ae 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/async/beta/threads/MessageServiceAsync.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/async/beta/threads/MessageServiceAsync.kt @@ -21,34 +21,34 @@ interface MessageServiceAsync { @JvmOverloads fun create( params: BetaThreadMessageCreateParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture /** Retrieve a message. */ @JvmOverloads fun retrieve( params: BetaThreadMessageRetrieveParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture /** Modifies a message. */ @JvmOverloads fun update( params: BetaThreadMessageUpdateParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture /** Returns a list of messages for a given thread. */ @JvmOverloads fun list( params: BetaThreadMessageListParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture /** Deletes a message. */ @JvmOverloads fun delete( params: BetaThreadMessageDeleteParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture } diff --git a/openai-java-core/src/main/kotlin/com/openai/services/async/beta/threads/MessageServiceAsyncImpl.kt b/openai-java-core/src/main/kotlin/com/openai/services/async/beta/threads/MessageServiceAsyncImpl.kt index 48d35d3f..0d56382b 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/async/beta/threads/MessageServiceAsyncImpl.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/async/beta/threads/MessageServiceAsyncImpl.kt @@ -24,10 +24,8 @@ import com.openai.models.Message import com.openai.models.MessageDeleted import java.util.concurrent.CompletableFuture -class MessageServiceAsyncImpl -internal constructor( - private val clientOptions: ClientOptions, -) : MessageServiceAsync { +class MessageServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : + MessageServiceAsync { companion object { @@ -42,7 +40,7 @@ internal constructor( /** Create a message. */ override fun create( params: BetaThreadMessageCreateParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() @@ -71,7 +69,7 @@ internal constructor( /** Retrieve a message. */ override fun retrieve( params: BetaThreadMessageRetrieveParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() @@ -80,7 +78,7 @@ internal constructor( "threads", params.getPathParam(0), "messages", - params.getPathParam(1) + params.getPathParam(1), ) .putAllHeaders(DEFAULT_HEADERS) .build() @@ -104,7 +102,7 @@ internal constructor( /** Modifies a message. */ override fun update( params: BetaThreadMessageUpdateParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() @@ -113,7 +111,7 @@ internal constructor( "threads", params.getPathParam(0), "messages", - params.getPathParam(1) + params.getPathParam(1), ) .putAllHeaders(DEFAULT_HEADERS) .body(json(clientOptions.jsonMapper, params._body())) @@ -139,7 +137,7 @@ internal constructor( /** Returns a list of messages for a given thread. */ override fun list( params: BetaThreadMessageListParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() @@ -168,7 +166,7 @@ internal constructor( /** Deletes a message. */ override fun delete( params: BetaThreadMessageDeleteParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() @@ -177,7 +175,7 @@ internal constructor( "threads", params.getPathParam(0), "messages", - params.getPathParam(1) + params.getPathParam(1), ) .putAllHeaders(DEFAULT_HEADERS) .apply { params._body().ifPresent { body(json(clientOptions.jsonMapper, it)) } } diff --git a/openai-java-core/src/main/kotlin/com/openai/services/async/beta/threads/RunServiceAsync.kt b/openai-java-core/src/main/kotlin/com/openai/services/async/beta/threads/RunServiceAsync.kt index c29cd803..1edafe7b 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/async/beta/threads/RunServiceAsync.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/async/beta/threads/RunServiceAsync.kt @@ -26,42 +26,42 @@ interface RunServiceAsync { @JvmOverloads fun create( params: BetaThreadRunCreateParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture /** Create a run. */ @JvmOverloads fun createStreaming( params: BetaThreadRunCreateParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): AsyncStreamResponse /** Retrieves a run. */ @JvmOverloads fun retrieve( params: BetaThreadRunRetrieveParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture /** Modifies a run. */ @JvmOverloads fun update( params: BetaThreadRunUpdateParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture /** Returns a list of runs belonging to a thread. */ @JvmOverloads fun list( params: BetaThreadRunListParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture /** Cancels a run that is `in_progress`. */ @JvmOverloads fun cancel( params: BetaThreadRunCancelParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture /** @@ -72,7 +72,7 @@ interface RunServiceAsync { @JvmOverloads fun submitToolOutputs( params: BetaThreadRunSubmitToolOutputsParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture /** @@ -83,6 +83,6 @@ interface RunServiceAsync { @JvmOverloads fun submitToolOutputsStreaming( params: BetaThreadRunSubmitToolOutputsParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): AsyncStreamResponse } diff --git a/openai-java-core/src/main/kotlin/com/openai/services/async/beta/threads/RunServiceAsyncImpl.kt b/openai-java-core/src/main/kotlin/com/openai/services/async/beta/threads/RunServiceAsyncImpl.kt index ea516ded..23d204c1 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/async/beta/threads/RunServiceAsyncImpl.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/async/beta/threads/RunServiceAsyncImpl.kt @@ -34,10 +34,8 @@ import com.openai.services.async.beta.threads.runs.StepServiceAsync import com.openai.services.async.beta.threads.runs.StepServiceAsyncImpl import java.util.concurrent.CompletableFuture -class RunServiceAsyncImpl -internal constructor( - private val clientOptions: ClientOptions, -) : RunServiceAsync { +class RunServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : + RunServiceAsync { companion object { @@ -56,7 +54,7 @@ internal constructor( /** Create a run. */ override fun create( params: BetaThreadRunCreateParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() @@ -68,7 +66,7 @@ internal constructor( .prepareAsync( clientOptions, params, - params.model().map { it.toString() }.orElse(null) + params.model().map { it.toString() }.orElse(null), ) return request .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } @@ -91,7 +89,7 @@ internal constructor( /** Create a run. */ override fun createStreaming( params: BetaThreadRunCreateParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): AsyncStreamResponse { val request = HttpRequest.builder() @@ -105,14 +103,14 @@ internal constructor( ._body() .toBuilder() .putAdditionalProperty("stream", JsonValue.from(true)) - .build() + .build(), ) ) .build() .prepareAsync( clientOptions, params, - params.model().map { it.toString() }.orElse(null) + params.model().map { it.toString() }.orElse(null), ) return request .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } @@ -136,7 +134,7 @@ internal constructor( /** Retrieves a run. */ override fun retrieve( params: BetaThreadRunRetrieveParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() @@ -164,7 +162,7 @@ internal constructor( /** Modifies a run. */ override fun update( params: BetaThreadRunUpdateParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() @@ -194,7 +192,7 @@ internal constructor( /** Returns a list of runs belonging to a thread. */ override fun list( params: BetaThreadRunListParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() @@ -223,7 +221,7 @@ internal constructor( /** Cancels a run that is `in_progress`. */ override fun cancel( params: BetaThreadRunCancelParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() @@ -233,7 +231,7 @@ internal constructor( params.getPathParam(0), "runs", params.getPathParam(1), - "cancel" + "cancel", ) .putAllHeaders(DEFAULT_HEADERS) .apply { params._body().ifPresent { body(json(clientOptions.jsonMapper, it)) } } @@ -262,7 +260,7 @@ internal constructor( */ override fun submitToolOutputs( params: BetaThreadRunSubmitToolOutputsParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() @@ -272,7 +270,7 @@ internal constructor( params.getPathParam(0), "runs", params.getPathParam(1), - "submit_tool_outputs" + "submit_tool_outputs", ) .putAllHeaders(DEFAULT_HEADERS) .body(json(clientOptions.jsonMapper, params._body())) @@ -303,7 +301,7 @@ internal constructor( */ override fun submitToolOutputsStreaming( params: BetaThreadRunSubmitToolOutputsParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): AsyncStreamResponse { val request = HttpRequest.builder() @@ -313,7 +311,7 @@ internal constructor( params.getPathParam(0), "runs", params.getPathParam(1), - "submit_tool_outputs" + "submit_tool_outputs", ) .putAllHeaders(DEFAULT_HEADERS) .body( @@ -323,7 +321,7 @@ internal constructor( ._body() .toBuilder() .putAdditionalProperty("stream", JsonValue.from(true)) - .build() + .build(), ) ) .build() diff --git a/openai-java-core/src/main/kotlin/com/openai/services/async/beta/threads/runs/StepServiceAsync.kt b/openai-java-core/src/main/kotlin/com/openai/services/async/beta/threads/runs/StepServiceAsync.kt index 4f062e51..82eac83c 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/async/beta/threads/runs/StepServiceAsync.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/async/beta/threads/runs/StepServiceAsync.kt @@ -17,13 +17,13 @@ interface StepServiceAsync { @JvmOverloads fun retrieve( params: BetaThreadRunStepRetrieveParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture /** Returns a list of run steps belonging to a run. */ @JvmOverloads fun list( params: BetaThreadRunStepListParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture } diff --git a/openai-java-core/src/main/kotlin/com/openai/services/async/beta/threads/runs/StepServiceAsyncImpl.kt b/openai-java-core/src/main/kotlin/com/openai/services/async/beta/threads/runs/StepServiceAsyncImpl.kt index 5156e0cc..31f9e62f 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/async/beta/threads/runs/StepServiceAsyncImpl.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/async/beta/threads/runs/StepServiceAsyncImpl.kt @@ -19,10 +19,8 @@ import com.openai.models.BetaThreadRunStepRetrieveParams import com.openai.models.RunStep import java.util.concurrent.CompletableFuture -class StepServiceAsyncImpl -internal constructor( - private val clientOptions: ClientOptions, -) : StepServiceAsync { +class StepServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : + StepServiceAsync { companion object { @@ -37,7 +35,7 @@ internal constructor( /** Retrieves a run step. */ override fun retrieve( params: BetaThreadRunStepRetrieveParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() @@ -48,7 +46,7 @@ internal constructor( "runs", params.getPathParam(1), "steps", - params.getPathParam(2) + params.getPathParam(2), ) .putAllHeaders(DEFAULT_HEADERS) .build() @@ -73,7 +71,7 @@ internal constructor( /** Returns a list of run steps belonging to a run. */ override fun list( params: BetaThreadRunStepListParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() @@ -83,7 +81,7 @@ internal constructor( params.getPathParam(0), "runs", params.getPathParam(1), - "steps" + "steps", ) .putAllHeaders(DEFAULT_HEADERS) .build() diff --git a/openai-java-core/src/main/kotlin/com/openai/services/async/beta/vectorStores/FileBatchServiceAsync.kt b/openai-java-core/src/main/kotlin/com/openai/services/async/beta/vectorStores/FileBatchServiceAsync.kt index 40f2cd74..5359ddd1 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/async/beta/vectorStores/FileBatchServiceAsync.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/async/beta/vectorStores/FileBatchServiceAsync.kt @@ -19,14 +19,14 @@ interface FileBatchServiceAsync { @JvmOverloads fun create( params: BetaVectorStoreFileBatchCreateParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture /** Retrieves a vector store file batch. */ @JvmOverloads fun retrieve( params: BetaVectorStoreFileBatchRetrieveParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture /** @@ -36,13 +36,13 @@ interface FileBatchServiceAsync { @JvmOverloads fun cancel( params: BetaVectorStoreFileBatchCancelParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture /** Returns a list of vector store files in a batch. */ @JvmOverloads fun listFiles( params: BetaVectorStoreFileBatchListFilesParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture } diff --git a/openai-java-core/src/main/kotlin/com/openai/services/async/beta/vectorStores/FileBatchServiceAsyncImpl.kt b/openai-java-core/src/main/kotlin/com/openai/services/async/beta/vectorStores/FileBatchServiceAsyncImpl.kt index b804dbed..80d0187a 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/async/beta/vectorStores/FileBatchServiceAsyncImpl.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/async/beta/vectorStores/FileBatchServiceAsyncImpl.kt @@ -22,10 +22,8 @@ import com.openai.models.BetaVectorStoreFileBatchRetrieveParams import com.openai.models.VectorStoreFileBatch import java.util.concurrent.CompletableFuture -class FileBatchServiceAsyncImpl -internal constructor( - private val clientOptions: ClientOptions, -) : FileBatchServiceAsync { +class FileBatchServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : + FileBatchServiceAsync { companion object { @@ -40,7 +38,7 @@ internal constructor( /** Create a vector store file batch. */ override fun create( params: BetaVectorStoreFileBatchCreateParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() @@ -69,7 +67,7 @@ internal constructor( /** Retrieves a vector store file batch. */ override fun retrieve( params: BetaVectorStoreFileBatchRetrieveParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() @@ -78,7 +76,7 @@ internal constructor( "vector_stores", params.getPathParam(0), "file_batches", - params.getPathParam(1) + params.getPathParam(1), ) .putAllHeaders(DEFAULT_HEADERS) .build() @@ -105,7 +103,7 @@ internal constructor( */ override fun cancel( params: BetaVectorStoreFileBatchCancelParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() @@ -115,7 +113,7 @@ internal constructor( params.getPathParam(0), "file_batches", params.getPathParam(1), - "cancel" + "cancel", ) .putAllHeaders(DEFAULT_HEADERS) .apply { params._body().ifPresent { body(json(clientOptions.jsonMapper, it)) } } @@ -141,7 +139,7 @@ internal constructor( /** Returns a list of vector store files in a batch. */ override fun listFiles( params: BetaVectorStoreFileBatchListFilesParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() @@ -151,7 +149,7 @@ internal constructor( params.getPathParam(0), "file_batches", params.getPathParam(1), - "files" + "files", ) .putAllHeaders(DEFAULT_HEADERS) .build() diff --git a/openai-java-core/src/main/kotlin/com/openai/services/async/beta/vectorStores/FileServiceAsync.kt b/openai-java-core/src/main/kotlin/com/openai/services/async/beta/vectorStores/FileServiceAsync.kt index 3060ce27..e1b090b4 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/async/beta/vectorStores/FileServiceAsync.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/async/beta/vectorStores/FileServiceAsync.kt @@ -24,21 +24,21 @@ interface FileServiceAsync { @JvmOverloads fun create( params: BetaVectorStoreFileCreateParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture /** Retrieves a vector store file. */ @JvmOverloads fun retrieve( params: BetaVectorStoreFileRetrieveParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture /** Returns a list of vector store files. */ @JvmOverloads fun list( params: BetaVectorStoreFileListParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture /** @@ -49,6 +49,6 @@ interface FileServiceAsync { @JvmOverloads fun delete( params: BetaVectorStoreFileDeleteParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture } diff --git a/openai-java-core/src/main/kotlin/com/openai/services/async/beta/vectorStores/FileServiceAsyncImpl.kt b/openai-java-core/src/main/kotlin/com/openai/services/async/beta/vectorStores/FileServiceAsyncImpl.kt index 900f4a56..06f20838 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/async/beta/vectorStores/FileServiceAsyncImpl.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/async/beta/vectorStores/FileServiceAsyncImpl.kt @@ -23,10 +23,8 @@ import com.openai.models.VectorStoreFile import com.openai.models.VectorStoreFileDeleted import java.util.concurrent.CompletableFuture -class FileServiceAsyncImpl -internal constructor( - private val clientOptions: ClientOptions, -) : FileServiceAsync { +class FileServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : + FileServiceAsync { companion object { @@ -45,7 +43,7 @@ internal constructor( */ override fun create( params: BetaVectorStoreFileCreateParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() @@ -74,7 +72,7 @@ internal constructor( /** Retrieves a vector store file. */ override fun retrieve( params: BetaVectorStoreFileRetrieveParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() @@ -83,7 +81,7 @@ internal constructor( "vector_stores", params.getPathParam(0), "files", - params.getPathParam(1) + params.getPathParam(1), ) .putAllHeaders(DEFAULT_HEADERS) .build() @@ -108,7 +106,7 @@ internal constructor( /** Returns a list of vector store files. */ override fun list( params: BetaVectorStoreFileListParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() @@ -141,7 +139,7 @@ internal constructor( */ override fun delete( params: BetaVectorStoreFileDeleteParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() @@ -150,7 +148,7 @@ internal constructor( "vector_stores", params.getPathParam(0), "files", - params.getPathParam(1) + params.getPathParam(1), ) .putAllHeaders(DEFAULT_HEADERS) .apply { params._body().ifPresent { body(json(clientOptions.jsonMapper, it)) } } diff --git a/openai-java-core/src/main/kotlin/com/openai/services/async/chat/CompletionServiceAsync.kt b/openai-java-core/src/main/kotlin/com/openai/services/async/chat/CompletionServiceAsync.kt index d8f6b0d9..0d499a9a 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/async/chat/CompletionServiceAsync.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/async/chat/CompletionServiceAsync.kt @@ -34,7 +34,7 @@ interface CompletionServiceAsync { @JvmOverloads fun create( params: ChatCompletionCreateParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture /** @@ -51,7 +51,7 @@ interface CompletionServiceAsync { @JvmOverloads fun createStreaming( params: ChatCompletionCreateParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): AsyncStreamResponse /** @@ -61,7 +61,7 @@ interface CompletionServiceAsync { @JvmOverloads fun retrieve( params: ChatCompletionRetrieveParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture /** @@ -72,7 +72,7 @@ interface CompletionServiceAsync { @JvmOverloads fun update( params: ChatCompletionUpdateParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture /** @@ -82,6 +82,6 @@ interface CompletionServiceAsync { @JvmOverloads fun delete( params: ChatCompletionDeleteParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture } diff --git a/openai-java-core/src/main/kotlin/com/openai/services/async/chat/CompletionServiceAsyncImpl.kt b/openai-java-core/src/main/kotlin/com/openai/services/async/chat/CompletionServiceAsyncImpl.kt index d8149c36..b5e0b0e3 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/async/chat/CompletionServiceAsyncImpl.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/async/chat/CompletionServiceAsyncImpl.kt @@ -31,10 +31,8 @@ import com.openai.services.async.chat.completions.MessageServiceAsync import com.openai.services.async.chat.completions.MessageServiceAsyncImpl import java.util.concurrent.CompletableFuture -class CompletionServiceAsyncImpl -internal constructor( - private val clientOptions: ClientOptions, -) : CompletionServiceAsync { +class CompletionServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : + CompletionServiceAsync { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) @@ -58,7 +56,7 @@ internal constructor( */ override fun create( params: ChatCompletionCreateParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() @@ -98,7 +96,7 @@ internal constructor( */ override fun createStreaming( params: ChatCompletionCreateParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): AsyncStreamResponse { val request = HttpRequest.builder() @@ -111,7 +109,7 @@ internal constructor( ._body() .toBuilder() .putAdditionalProperty("stream", JsonValue.from(true)) - .build() + .build(), ) ) .build() @@ -141,7 +139,7 @@ internal constructor( */ override fun retrieve( params: ChatCompletionRetrieveParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() @@ -172,7 +170,7 @@ internal constructor( */ override fun update( params: ChatCompletionUpdateParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() @@ -203,7 +201,7 @@ internal constructor( */ override fun delete( params: ChatCompletionDeleteParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() diff --git a/openai-java-core/src/main/kotlin/com/openai/services/async/chat/completions/MessageServiceAsync.kt b/openai-java-core/src/main/kotlin/com/openai/services/async/chat/completions/MessageServiceAsync.kt index be816fab..b3f803ed 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/async/chat/completions/MessageServiceAsync.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/async/chat/completions/MessageServiceAsync.kt @@ -18,6 +18,6 @@ interface MessageServiceAsync { @JvmOverloads fun list( params: ChatCompletionMessageListParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture } diff --git a/openai-java-core/src/main/kotlin/com/openai/services/async/chat/completions/MessageServiceAsyncImpl.kt b/openai-java-core/src/main/kotlin/com/openai/services/async/chat/completions/MessageServiceAsyncImpl.kt index 92299256..21fb1d64 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/async/chat/completions/MessageServiceAsyncImpl.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/async/chat/completions/MessageServiceAsyncImpl.kt @@ -16,10 +16,8 @@ import com.openai.models.ChatCompletionMessageListPageAsync import com.openai.models.ChatCompletionMessageListParams import java.util.concurrent.CompletableFuture -class MessageServiceAsyncImpl -internal constructor( - private val clientOptions: ClientOptions, -) : MessageServiceAsync { +class MessageServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : + MessageServiceAsync { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) @@ -33,7 +31,7 @@ internal constructor( */ override fun list( params: ChatCompletionMessageListParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() diff --git a/openai-java-core/src/main/kotlin/com/openai/services/async/fineTuning/JobServiceAsync.kt b/openai-java-core/src/main/kotlin/com/openai/services/async/fineTuning/JobServiceAsync.kt index 24bf4c65..eed0c8a9 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/async/fineTuning/JobServiceAsync.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/async/fineTuning/JobServiceAsync.kt @@ -32,7 +32,7 @@ interface JobServiceAsync { @JvmOverloads fun create( params: FineTuningJobCreateParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture /** @@ -43,27 +43,27 @@ interface JobServiceAsync { @JvmOverloads fun retrieve( params: FineTuningJobRetrieveParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture /** List your organization's fine-tuning jobs */ @JvmOverloads fun list( params: FineTuningJobListParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture /** Immediately cancel a fine-tune job. */ @JvmOverloads fun cancel( params: FineTuningJobCancelParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture /** Get status updates for a fine-tuning job. */ @JvmOverloads fun listEvents( params: FineTuningJobListEventsParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture } diff --git a/openai-java-core/src/main/kotlin/com/openai/services/async/fineTuning/JobServiceAsyncImpl.kt b/openai-java-core/src/main/kotlin/com/openai/services/async/fineTuning/JobServiceAsyncImpl.kt index afc15724..2347d03f 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/async/fineTuning/JobServiceAsyncImpl.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/async/fineTuning/JobServiceAsyncImpl.kt @@ -25,10 +25,8 @@ import com.openai.services.async.fineTuning.jobs.CheckpointServiceAsync import com.openai.services.async.fineTuning.jobs.CheckpointServiceAsyncImpl import java.util.concurrent.CompletableFuture -class JobServiceAsyncImpl -internal constructor( - private val clientOptions: ClientOptions, -) : JobServiceAsync { +class JobServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : + JobServiceAsync { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) @@ -52,7 +50,7 @@ internal constructor( */ override fun create( params: FineTuningJobCreateParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() @@ -84,7 +82,7 @@ internal constructor( */ override fun retrieve( params: FineTuningJobRetrieveParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() @@ -112,7 +110,7 @@ internal constructor( /** List your organization's fine-tuning jobs */ override fun list( params: FineTuningJobListParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() @@ -140,7 +138,7 @@ internal constructor( /** Immediately cancel a fine-tune job. */ override fun cancel( params: FineTuningJobCancelParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() @@ -169,7 +167,7 @@ internal constructor( /** Get status updates for a fine-tuning job. */ override fun listEvents( params: FineTuningJobListEventsParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() diff --git a/openai-java-core/src/main/kotlin/com/openai/services/async/fineTuning/jobs/CheckpointServiceAsync.kt b/openai-java-core/src/main/kotlin/com/openai/services/async/fineTuning/jobs/CheckpointServiceAsync.kt index 0d179cf3..5d08d232 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/async/fineTuning/jobs/CheckpointServiceAsync.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/async/fineTuning/jobs/CheckpointServiceAsync.kt @@ -15,6 +15,6 @@ interface CheckpointServiceAsync { @JvmOverloads fun list( params: FineTuningJobCheckpointListParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture } diff --git a/openai-java-core/src/main/kotlin/com/openai/services/async/fineTuning/jobs/CheckpointServiceAsyncImpl.kt b/openai-java-core/src/main/kotlin/com/openai/services/async/fineTuning/jobs/CheckpointServiceAsyncImpl.kt index ce5fb27b..a59bae18 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/async/fineTuning/jobs/CheckpointServiceAsyncImpl.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/async/fineTuning/jobs/CheckpointServiceAsyncImpl.kt @@ -16,10 +16,8 @@ import com.openai.models.FineTuningJobCheckpointListPageAsync import com.openai.models.FineTuningJobCheckpointListParams import java.util.concurrent.CompletableFuture -class CheckpointServiceAsyncImpl -internal constructor( - private val clientOptions: ClientOptions, -) : CheckpointServiceAsync { +class CheckpointServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : + CheckpointServiceAsync { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) @@ -30,7 +28,7 @@ internal constructor( /** List checkpoints for a fine-tuning job. */ override fun list( params: FineTuningJobCheckpointListParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() diff --git a/openai-java-core/src/main/kotlin/com/openai/services/async/uploads/PartServiceAsyncImpl.kt b/openai-java-core/src/main/kotlin/com/openai/services/async/uploads/PartServiceAsyncImpl.kt index c1c1a6e5..b786c937 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/async/uploads/PartServiceAsyncImpl.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/async/uploads/PartServiceAsyncImpl.kt @@ -4,7 +4,5 @@ package com.openai.services.async.uploads import com.openai.core.ClientOptions -class PartServiceAsyncImpl -internal constructor( - private val clientOptions: ClientOptions, -) : PartServiceAsync +class PartServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : + PartServiceAsync diff --git a/openai-java-core/src/main/kotlin/com/openai/services/blocking/BatchService.kt b/openai-java-core/src/main/kotlin/com/openai/services/blocking/BatchService.kt index cf206f13..207d7e15 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/blocking/BatchService.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/blocking/BatchService.kt @@ -18,21 +18,21 @@ interface BatchService { @JvmOverloads fun create( params: BatchCreateParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): Batch /** Retrieves a batch. */ @JvmOverloads fun retrieve( params: BatchRetrieveParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): Batch /** List your organization's batches. */ @JvmOverloads fun list( params: BatchListParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): BatchListPage /** @@ -43,6 +43,6 @@ interface BatchService { @JvmOverloads fun cancel( params: BatchCancelParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): Batch } diff --git a/openai-java-core/src/main/kotlin/com/openai/services/blocking/BatchServiceImpl.kt b/openai-java-core/src/main/kotlin/com/openai/services/blocking/BatchServiceImpl.kt index f493c583..3bee0335 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/blocking/BatchServiceImpl.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/blocking/BatchServiceImpl.kt @@ -20,10 +20,8 @@ import com.openai.models.BatchListPage import com.openai.models.BatchListParams import com.openai.models.BatchRetrieveParams -class BatchServiceImpl -internal constructor( - private val clientOptions: ClientOptions, -) : BatchService { +class BatchServiceImpl internal constructor(private val clientOptions: ClientOptions) : + BatchService { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) diff --git a/openai-java-core/src/main/kotlin/com/openai/services/blocking/BetaServiceImpl.kt b/openai-java-core/src/main/kotlin/com/openai/services/blocking/BetaServiceImpl.kt index d3652849..e5796873 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/blocking/BetaServiceImpl.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/blocking/BetaServiceImpl.kt @@ -11,10 +11,7 @@ import com.openai.services.blocking.beta.ThreadServiceImpl import com.openai.services.blocking.beta.VectorStoreService import com.openai.services.blocking.beta.VectorStoreServiceImpl -class BetaServiceImpl -internal constructor( - private val clientOptions: ClientOptions, -) : BetaService { +class BetaServiceImpl internal constructor(private val clientOptions: ClientOptions) : BetaService { companion object { diff --git a/openai-java-core/src/main/kotlin/com/openai/services/blocking/ChatServiceImpl.kt b/openai-java-core/src/main/kotlin/com/openai/services/blocking/ChatServiceImpl.kt index 6be85fe6..2857898b 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/blocking/ChatServiceImpl.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/blocking/ChatServiceImpl.kt @@ -6,10 +6,7 @@ import com.openai.core.ClientOptions import com.openai.services.blocking.chat.CompletionService import com.openai.services.blocking.chat.CompletionServiceImpl -class ChatServiceImpl -internal constructor( - private val clientOptions: ClientOptions, -) : ChatService { +class ChatServiceImpl internal constructor(private val clientOptions: ClientOptions) : ChatService { private val completions: CompletionService by lazy { CompletionServiceImpl(clientOptions) } diff --git a/openai-java-core/src/main/kotlin/com/openai/services/blocking/CompletionService.kt b/openai-java-core/src/main/kotlin/com/openai/services/blocking/CompletionService.kt index da2f7318..3ed7d4a5 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/blocking/CompletionService.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/blocking/CompletionService.kt @@ -16,7 +16,7 @@ interface CompletionService { @JvmOverloads fun create( params: CompletionCreateParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): Completion /** Creates a completion for the provided prompt and parameters. */ @@ -24,6 +24,6 @@ interface CompletionService { @MustBeClosed fun createStreaming( params: CompletionCreateParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): StreamResponse } diff --git a/openai-java-core/src/main/kotlin/com/openai/services/blocking/CompletionServiceImpl.kt b/openai-java-core/src/main/kotlin/com/openai/services/blocking/CompletionServiceImpl.kt index cbfa8e37..d019cbc4 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/blocking/CompletionServiceImpl.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/blocking/CompletionServiceImpl.kt @@ -21,10 +21,8 @@ import com.openai.errors.OpenAIError import com.openai.models.Completion import com.openai.models.CompletionCreateParams -class CompletionServiceImpl -internal constructor( - private val clientOptions: ClientOptions, -) : CompletionService { +class CompletionServiceImpl internal constructor(private val clientOptions: ClientOptions) : + CompletionService { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) @@ -34,7 +32,7 @@ internal constructor( /** Creates a completion for the provided prompt and parameters. */ override fun create( params: CompletionCreateParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): Completion { val request = HttpRequest.builder() @@ -59,7 +57,7 @@ internal constructor( /** Creates a completion for the provided prompt and parameters. */ override fun createStreaming( params: CompletionCreateParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): StreamResponse { val request = HttpRequest.builder() @@ -72,7 +70,7 @@ internal constructor( ._body() .toBuilder() .putAdditionalProperty("stream", JsonValue.from(true)) - .build() + .build(), ) ) .build() diff --git a/openai-java-core/src/main/kotlin/com/openai/services/blocking/EmbeddingService.kt b/openai-java-core/src/main/kotlin/com/openai/services/blocking/EmbeddingService.kt index 1cda8fd5..3941f8c0 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/blocking/EmbeddingService.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/blocking/EmbeddingService.kt @@ -14,6 +14,6 @@ interface EmbeddingService { @JvmOverloads fun create( params: EmbeddingCreateParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CreateEmbeddingResponse } diff --git a/openai-java-core/src/main/kotlin/com/openai/services/blocking/EmbeddingServiceImpl.kt b/openai-java-core/src/main/kotlin/com/openai/services/blocking/EmbeddingServiceImpl.kt index 08be01e1..29171a7c 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/blocking/EmbeddingServiceImpl.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/blocking/EmbeddingServiceImpl.kt @@ -16,10 +16,8 @@ import com.openai.errors.OpenAIError import com.openai.models.CreateEmbeddingResponse import com.openai.models.EmbeddingCreateParams -class EmbeddingServiceImpl -internal constructor( - private val clientOptions: ClientOptions, -) : EmbeddingService { +class EmbeddingServiceImpl internal constructor(private val clientOptions: ClientOptions) : + EmbeddingService { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) @@ -30,7 +28,7 @@ internal constructor( /** Creates an embedding vector representing the input text. */ override fun create( params: EmbeddingCreateParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CreateEmbeddingResponse { val request = HttpRequest.builder() diff --git a/openai-java-core/src/main/kotlin/com/openai/services/blocking/FileService.kt b/openai-java-core/src/main/kotlin/com/openai/services/blocking/FileService.kt index 691d0eeb..ba212931 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/blocking/FileService.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/blocking/FileService.kt @@ -21,21 +21,21 @@ interface FileService { @JvmOverloads fun retrieve( params: FileRetrieveParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): FileObject /** Returns a list of files. */ @JvmOverloads fun list( params: FileListParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): FileListPage /** Delete a file. */ @JvmOverloads fun delete( params: FileDeleteParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): FileDeleted /** Returns the contents of the specified file. */ @@ -43,6 +43,6 @@ interface FileService { @MustBeClosed fun content( params: FileContentParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): HttpResponse } diff --git a/openai-java-core/src/main/kotlin/com/openai/services/blocking/FileServiceImpl.kt b/openai-java-core/src/main/kotlin/com/openai/services/blocking/FileServiceImpl.kt index 6e9df206..c0983adf 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/blocking/FileServiceImpl.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/blocking/FileServiceImpl.kt @@ -22,10 +22,7 @@ import com.openai.models.FileListParams import com.openai.models.FileObject import com.openai.models.FileRetrieveParams -class FileServiceImpl -internal constructor( - private val clientOptions: ClientOptions, -) : FileService { +class FileServiceImpl internal constructor(private val clientOptions: ClientOptions) : FileService { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) diff --git a/openai-java-core/src/main/kotlin/com/openai/services/blocking/FineTuningServiceImpl.kt b/openai-java-core/src/main/kotlin/com/openai/services/blocking/FineTuningServiceImpl.kt index 7af2ba5f..34433c95 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/blocking/FineTuningServiceImpl.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/blocking/FineTuningServiceImpl.kt @@ -6,10 +6,8 @@ import com.openai.core.ClientOptions import com.openai.services.blocking.fineTuning.JobService import com.openai.services.blocking.fineTuning.JobServiceImpl -class FineTuningServiceImpl -internal constructor( - private val clientOptions: ClientOptions, -) : FineTuningService { +class FineTuningServiceImpl internal constructor(private val clientOptions: ClientOptions) : + FineTuningService { private val jobs: JobService by lazy { JobServiceImpl(clientOptions) } diff --git a/openai-java-core/src/main/kotlin/com/openai/services/blocking/ImageService.kt b/openai-java-core/src/main/kotlin/com/openai/services/blocking/ImageService.kt index 7781fccc..e066013e 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/blocking/ImageService.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/blocking/ImageService.kt @@ -14,6 +14,6 @@ interface ImageService { @JvmOverloads fun generate( params: ImageGenerateParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): ImagesResponse } diff --git a/openai-java-core/src/main/kotlin/com/openai/services/blocking/ImageServiceImpl.kt b/openai-java-core/src/main/kotlin/com/openai/services/blocking/ImageServiceImpl.kt index 6eb260c6..f9c3dcaa 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/blocking/ImageServiceImpl.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/blocking/ImageServiceImpl.kt @@ -16,10 +16,8 @@ import com.openai.errors.OpenAIError import com.openai.models.ImageGenerateParams import com.openai.models.ImagesResponse -class ImageServiceImpl -internal constructor( - private val clientOptions: ClientOptions, -) : ImageService { +class ImageServiceImpl internal constructor(private val clientOptions: ClientOptions) : + ImageService { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) @@ -29,7 +27,7 @@ internal constructor( /** Creates an image given a prompt. */ override fun generate( params: ImageGenerateParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): ImagesResponse { val request = HttpRequest.builder() diff --git a/openai-java-core/src/main/kotlin/com/openai/services/blocking/ModelService.kt b/openai-java-core/src/main/kotlin/com/openai/services/blocking/ModelService.kt index b3f72e2f..eef74f7f 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/blocking/ModelService.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/blocking/ModelService.kt @@ -21,7 +21,7 @@ interface ModelService { @JvmOverloads fun retrieve( params: ModelRetrieveParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): Model /** @@ -31,7 +31,7 @@ interface ModelService { @JvmOverloads fun list( params: ModelListParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): ModelListPage /** @@ -41,6 +41,6 @@ interface ModelService { @JvmOverloads fun delete( params: ModelDeleteParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): ModelDeleted } diff --git a/openai-java-core/src/main/kotlin/com/openai/services/blocking/ModelServiceImpl.kt b/openai-java-core/src/main/kotlin/com/openai/services/blocking/ModelServiceImpl.kt index 95f9f8bc..4f984a54 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/blocking/ModelServiceImpl.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/blocking/ModelServiceImpl.kt @@ -20,10 +20,8 @@ import com.openai.models.ModelListPage import com.openai.models.ModelListParams import com.openai.models.ModelRetrieveParams -class ModelServiceImpl -internal constructor( - private val clientOptions: ClientOptions, -) : ModelService { +class ModelServiceImpl internal constructor(private val clientOptions: ClientOptions) : + ModelService { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) diff --git a/openai-java-core/src/main/kotlin/com/openai/services/blocking/ModerationService.kt b/openai-java-core/src/main/kotlin/com/openai/services/blocking/ModerationService.kt index 654fb511..b46755f0 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/blocking/ModerationService.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/blocking/ModerationService.kt @@ -17,6 +17,6 @@ interface ModerationService { @JvmOverloads fun create( params: ModerationCreateParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): ModerationCreateResponse } diff --git a/openai-java-core/src/main/kotlin/com/openai/services/blocking/ModerationServiceImpl.kt b/openai-java-core/src/main/kotlin/com/openai/services/blocking/ModerationServiceImpl.kt index 276e0da4..34b73160 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/blocking/ModerationServiceImpl.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/blocking/ModerationServiceImpl.kt @@ -16,10 +16,8 @@ import com.openai.errors.OpenAIError import com.openai.models.ModerationCreateParams import com.openai.models.ModerationCreateResponse -class ModerationServiceImpl -internal constructor( - private val clientOptions: ClientOptions, -) : ModerationService { +class ModerationServiceImpl internal constructor(private val clientOptions: ClientOptions) : + ModerationService { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) @@ -33,7 +31,7 @@ internal constructor( */ override fun create( params: ModerationCreateParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): ModerationCreateResponse { val request = HttpRequest.builder() diff --git a/openai-java-core/src/main/kotlin/com/openai/services/blocking/UploadService.kt b/openai-java-core/src/main/kotlin/com/openai/services/blocking/UploadService.kt index cdbf2d51..96061582 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/blocking/UploadService.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/blocking/UploadService.kt @@ -38,14 +38,14 @@ interface UploadService { @JvmOverloads fun create( params: UploadCreateParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): Upload /** Cancels the Upload. No Parts may be added after an Upload is cancelled. */ @JvmOverloads fun cancel( params: UploadCancelParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): Upload /** @@ -64,6 +64,6 @@ interface UploadService { @JvmOverloads fun complete( params: UploadCompleteParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): Upload } diff --git a/openai-java-core/src/main/kotlin/com/openai/services/blocking/UploadServiceImpl.kt b/openai-java-core/src/main/kotlin/com/openai/services/blocking/UploadServiceImpl.kt index 23c02ea8..3a327cae 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/blocking/UploadServiceImpl.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/blocking/UploadServiceImpl.kt @@ -20,10 +20,8 @@ import com.openai.models.UploadCreateParams import com.openai.services.blocking.uploads.PartService import com.openai.services.blocking.uploads.PartServiceImpl -class UploadServiceImpl -internal constructor( - private val clientOptions: ClientOptions, -) : UploadService { +class UploadServiceImpl internal constructor(private val clientOptions: ClientOptions) : + UploadService { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) diff --git a/openai-java-core/src/main/kotlin/com/openai/services/blocking/beta/AssistantService.kt b/openai-java-core/src/main/kotlin/com/openai/services/blocking/beta/AssistantService.kt index cdbae68b..1151eafb 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/blocking/beta/AssistantService.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/blocking/beta/AssistantService.kt @@ -20,34 +20,34 @@ interface AssistantService { @JvmOverloads fun create( params: BetaAssistantCreateParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): Assistant /** Retrieves an assistant. */ @JvmOverloads fun retrieve( params: BetaAssistantRetrieveParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): Assistant /** Modifies an assistant. */ @JvmOverloads fun update( params: BetaAssistantUpdateParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): Assistant /** Returns a list of assistants. */ @JvmOverloads fun list( params: BetaAssistantListParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): BetaAssistantListPage /** Delete an assistant. */ @JvmOverloads fun delete( params: BetaAssistantDeleteParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): AssistantDeleted } diff --git a/openai-java-core/src/main/kotlin/com/openai/services/blocking/beta/AssistantServiceImpl.kt b/openai-java-core/src/main/kotlin/com/openai/services/blocking/beta/AssistantServiceImpl.kt index ab14a017..538cb370 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/blocking/beta/AssistantServiceImpl.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/blocking/beta/AssistantServiceImpl.kt @@ -23,10 +23,8 @@ import com.openai.models.BetaAssistantListParams import com.openai.models.BetaAssistantRetrieveParams import com.openai.models.BetaAssistantUpdateParams -class AssistantServiceImpl -internal constructor( - private val clientOptions: ClientOptions, -) : AssistantService { +class AssistantServiceImpl internal constructor(private val clientOptions: ClientOptions) : + AssistantService { companion object { @@ -41,7 +39,7 @@ internal constructor( /** Create an assistant with a model and instructions. */ override fun create( params: BetaAssistantCreateParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): Assistant { val request = HttpRequest.builder() @@ -67,7 +65,7 @@ internal constructor( /** Retrieves an assistant. */ override fun retrieve( params: BetaAssistantRetrieveParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): Assistant { val request = HttpRequest.builder() @@ -92,7 +90,7 @@ internal constructor( /** Modifies an assistant. */ override fun update( params: BetaAssistantUpdateParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): Assistant { val request = HttpRequest.builder() @@ -119,7 +117,7 @@ internal constructor( /** Returns a list of assistants. */ override fun list( params: BetaAssistantListParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): BetaAssistantListPage { val request = HttpRequest.builder() @@ -145,7 +143,7 @@ internal constructor( /** Delete an assistant. */ override fun delete( params: BetaAssistantDeleteParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): AssistantDeleted { val request = HttpRequest.builder() diff --git a/openai-java-core/src/main/kotlin/com/openai/services/blocking/beta/ThreadService.kt b/openai-java-core/src/main/kotlin/com/openai/services/blocking/beta/ThreadService.kt index 9b0a42b1..e5a1c105 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/blocking/beta/ThreadService.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/blocking/beta/ThreadService.kt @@ -29,35 +29,35 @@ interface ThreadService { @JvmOverloads fun create( params: BetaThreadCreateParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): Thread /** Retrieves a thread. */ @JvmOverloads fun retrieve( params: BetaThreadRetrieveParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): Thread /** Modifies a thread. */ @JvmOverloads fun update( params: BetaThreadUpdateParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): Thread /** Delete a thread. */ @JvmOverloads fun delete( params: BetaThreadDeleteParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): ThreadDeleted /** Create a thread and run it in one request. */ @JvmOverloads fun createAndRun( params: BetaThreadCreateAndRunParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): Run /** Create a thread and run it in one request. */ @@ -65,6 +65,6 @@ interface ThreadService { @MustBeClosed fun createAndRunStreaming( params: BetaThreadCreateAndRunParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): StreamResponse } diff --git a/openai-java-core/src/main/kotlin/com/openai/services/blocking/beta/ThreadServiceImpl.kt b/openai-java-core/src/main/kotlin/com/openai/services/blocking/beta/ThreadServiceImpl.kt index 4cd75fb0..632615a7 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/blocking/beta/ThreadServiceImpl.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/blocking/beta/ThreadServiceImpl.kt @@ -33,10 +33,8 @@ import com.openai.services.blocking.beta.threads.MessageServiceImpl import com.openai.services.blocking.beta.threads.RunService import com.openai.services.blocking.beta.threads.RunServiceImpl -class ThreadServiceImpl -internal constructor( - private val clientOptions: ClientOptions, -) : ThreadService { +class ThreadServiceImpl internal constructor(private val clientOptions: ClientOptions) : + ThreadService { companion object { @@ -82,7 +80,7 @@ internal constructor( /** Retrieves a thread. */ override fun retrieve( params: BetaThreadRetrieveParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): Thread { val request = HttpRequest.builder() @@ -130,7 +128,7 @@ internal constructor( /** Delete a thread. */ override fun delete( params: BetaThreadDeleteParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): ThreadDeleted { val request = HttpRequest.builder() @@ -156,7 +154,7 @@ internal constructor( /** Create a thread and run it in one request. */ override fun createAndRun( params: BetaThreadCreateAndRunParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): Run { val request = HttpRequest.builder() @@ -184,7 +182,7 @@ internal constructor( /** Create a thread and run it in one request. */ override fun createAndRunStreaming( params: BetaThreadCreateAndRunParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): StreamResponse { val request = HttpRequest.builder() @@ -198,7 +196,7 @@ internal constructor( ._body() .toBuilder() .putAdditionalProperty("stream", JsonValue.from(true)) - .build() + .build(), ) ) .build() diff --git a/openai-java-core/src/main/kotlin/com/openai/services/blocking/beta/VectorStoreService.kt b/openai-java-core/src/main/kotlin/com/openai/services/blocking/beta/VectorStoreService.kt index b516d242..acbe03b8 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/blocking/beta/VectorStoreService.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/blocking/beta/VectorStoreService.kt @@ -26,34 +26,34 @@ interface VectorStoreService { @JvmOverloads fun create( params: BetaVectorStoreCreateParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): VectorStore /** Retrieves a vector store. */ @JvmOverloads fun retrieve( params: BetaVectorStoreRetrieveParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): VectorStore /** Modifies a vector store. */ @JvmOverloads fun update( params: BetaVectorStoreUpdateParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): VectorStore /** Returns a list of vector stores. */ @JvmOverloads fun list( params: BetaVectorStoreListParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): BetaVectorStoreListPage /** Delete a vector store. */ @JvmOverloads fun delete( params: BetaVectorStoreDeleteParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): VectorStoreDeleted } diff --git a/openai-java-core/src/main/kotlin/com/openai/services/blocking/beta/VectorStoreServiceImpl.kt b/openai-java-core/src/main/kotlin/com/openai/services/blocking/beta/VectorStoreServiceImpl.kt index 44be9bab..8ec171db 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/blocking/beta/VectorStoreServiceImpl.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/blocking/beta/VectorStoreServiceImpl.kt @@ -27,10 +27,8 @@ import com.openai.services.blocking.beta.vectorStores.FileBatchServiceImpl import com.openai.services.blocking.beta.vectorStores.FileService import com.openai.services.blocking.beta.vectorStores.FileServiceImpl -class VectorStoreServiceImpl -internal constructor( - private val clientOptions: ClientOptions, -) : VectorStoreService { +class VectorStoreServiceImpl internal constructor(private val clientOptions: ClientOptions) : + VectorStoreService { companion object { @@ -53,7 +51,7 @@ internal constructor( /** Create a vector store. */ override fun create( params: BetaVectorStoreCreateParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): VectorStore { val request = HttpRequest.builder() @@ -79,7 +77,7 @@ internal constructor( /** Retrieves a vector store. */ override fun retrieve( params: BetaVectorStoreRetrieveParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): VectorStore { val request = HttpRequest.builder() @@ -104,7 +102,7 @@ internal constructor( /** Modifies a vector store. */ override fun update( params: BetaVectorStoreUpdateParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): VectorStore { val request = HttpRequest.builder() @@ -131,7 +129,7 @@ internal constructor( /** Returns a list of vector stores. */ override fun list( params: BetaVectorStoreListParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): BetaVectorStoreListPage { val request = HttpRequest.builder() @@ -157,7 +155,7 @@ internal constructor( /** Delete a vector store. */ override fun delete( params: BetaVectorStoreDeleteParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): VectorStoreDeleted { val request = HttpRequest.builder() diff --git a/openai-java-core/src/main/kotlin/com/openai/services/blocking/beta/threads/MessageService.kt b/openai-java-core/src/main/kotlin/com/openai/services/blocking/beta/threads/MessageService.kt index e6b7878e..5ab6766d 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/blocking/beta/threads/MessageService.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/blocking/beta/threads/MessageService.kt @@ -20,34 +20,34 @@ interface MessageService { @JvmOverloads fun create( params: BetaThreadMessageCreateParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): Message /** Retrieve a message. */ @JvmOverloads fun retrieve( params: BetaThreadMessageRetrieveParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): Message /** Modifies a message. */ @JvmOverloads fun update( params: BetaThreadMessageUpdateParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): Message /** Returns a list of messages for a given thread. */ @JvmOverloads fun list( params: BetaThreadMessageListParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): BetaThreadMessageListPage /** Deletes a message. */ @JvmOverloads fun delete( params: BetaThreadMessageDeleteParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): MessageDeleted } diff --git a/openai-java-core/src/main/kotlin/com/openai/services/blocking/beta/threads/MessageServiceImpl.kt b/openai-java-core/src/main/kotlin/com/openai/services/blocking/beta/threads/MessageServiceImpl.kt index 3050e803..a6690dcf 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/blocking/beta/threads/MessageServiceImpl.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/blocking/beta/threads/MessageServiceImpl.kt @@ -23,10 +23,8 @@ import com.openai.models.BetaThreadMessageUpdateParams import com.openai.models.Message import com.openai.models.MessageDeleted -class MessageServiceImpl -internal constructor( - private val clientOptions: ClientOptions, -) : MessageService { +class MessageServiceImpl internal constructor(private val clientOptions: ClientOptions) : + MessageService { companion object { @@ -41,7 +39,7 @@ internal constructor( /** Create a message. */ override fun create( params: BetaThreadMessageCreateParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): Message { val request = HttpRequest.builder() @@ -67,7 +65,7 @@ internal constructor( /** Retrieve a message. */ override fun retrieve( params: BetaThreadMessageRetrieveParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): Message { val request = HttpRequest.builder() @@ -76,7 +74,7 @@ internal constructor( "threads", params.getPathParam(0), "messages", - params.getPathParam(1) + params.getPathParam(1), ) .putAllHeaders(DEFAULT_HEADERS) .build() @@ -97,7 +95,7 @@ internal constructor( /** Modifies a message. */ override fun update( params: BetaThreadMessageUpdateParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): Message { val request = HttpRequest.builder() @@ -106,7 +104,7 @@ internal constructor( "threads", params.getPathParam(0), "messages", - params.getPathParam(1) + params.getPathParam(1), ) .putAllHeaders(DEFAULT_HEADERS) .body(json(clientOptions.jsonMapper, params._body())) @@ -129,7 +127,7 @@ internal constructor( /** Returns a list of messages for a given thread. */ override fun list( params: BetaThreadMessageListParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): BetaThreadMessageListPage { val request = HttpRequest.builder() @@ -155,7 +153,7 @@ internal constructor( /** Deletes a message. */ override fun delete( params: BetaThreadMessageDeleteParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): MessageDeleted { val request = HttpRequest.builder() @@ -164,7 +162,7 @@ internal constructor( "threads", params.getPathParam(0), "messages", - params.getPathParam(1) + params.getPathParam(1), ) .putAllHeaders(DEFAULT_HEADERS) .apply { params._body().ifPresent { body(json(clientOptions.jsonMapper, it)) } } diff --git a/openai-java-core/src/main/kotlin/com/openai/services/blocking/beta/threads/RunService.kt b/openai-java-core/src/main/kotlin/com/openai/services/blocking/beta/threads/RunService.kt index 9c35dfff..36854a6f 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/blocking/beta/threads/RunService.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/blocking/beta/threads/RunService.kt @@ -26,7 +26,7 @@ interface RunService { @JvmOverloads fun create( params: BetaThreadRunCreateParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): Run /** Create a run. */ @@ -34,35 +34,35 @@ interface RunService { @MustBeClosed fun createStreaming( params: BetaThreadRunCreateParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): StreamResponse /** Retrieves a run. */ @JvmOverloads fun retrieve( params: BetaThreadRunRetrieveParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): Run /** Modifies a run. */ @JvmOverloads fun update( params: BetaThreadRunUpdateParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): Run /** Returns a list of runs belonging to a thread. */ @JvmOverloads fun list( params: BetaThreadRunListParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): BetaThreadRunListPage /** Cancels a run that is `in_progress`. */ @JvmOverloads fun cancel( params: BetaThreadRunCancelParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): Run /** @@ -73,7 +73,7 @@ interface RunService { @JvmOverloads fun submitToolOutputs( params: BetaThreadRunSubmitToolOutputsParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): Run /** @@ -85,6 +85,6 @@ interface RunService { @MustBeClosed fun submitToolOutputsStreaming( params: BetaThreadRunSubmitToolOutputsParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): StreamResponse } diff --git a/openai-java-core/src/main/kotlin/com/openai/services/blocking/beta/threads/RunServiceImpl.kt b/openai-java-core/src/main/kotlin/com/openai/services/blocking/beta/threads/RunServiceImpl.kt index 8431a35a..90091116 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/blocking/beta/threads/RunServiceImpl.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/blocking/beta/threads/RunServiceImpl.kt @@ -31,10 +31,7 @@ import com.openai.models.Run import com.openai.services.blocking.beta.threads.runs.StepService import com.openai.services.blocking.beta.threads.runs.StepServiceImpl -class RunServiceImpl -internal constructor( - private val clientOptions: ClientOptions, -) : RunService { +class RunServiceImpl internal constructor(private val clientOptions: ClientOptions) : RunService { companion object { @@ -78,7 +75,7 @@ internal constructor( /** Create a run. */ override fun createStreaming( params: BetaThreadRunCreateParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): StreamResponse { val request = HttpRequest.builder() @@ -92,7 +89,7 @@ internal constructor( ._body() .toBuilder() .putAdditionalProperty("stream", JsonValue.from(true)) - .build() + .build(), ) ) .build() @@ -115,7 +112,7 @@ internal constructor( /** Retrieves a run. */ override fun retrieve( params: BetaThreadRunRetrieveParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): Run { val request = HttpRequest.builder() @@ -164,7 +161,7 @@ internal constructor( /** Returns a list of runs belonging to a thread. */ override fun list( params: BetaThreadRunListParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): BetaThreadRunListPage { val request = HttpRequest.builder() @@ -197,7 +194,7 @@ internal constructor( params.getPathParam(0), "runs", params.getPathParam(1), - "cancel" + "cancel", ) .putAllHeaders(DEFAULT_HEADERS) .apply { params._body().ifPresent { body(json(clientOptions.jsonMapper, it)) } } @@ -223,7 +220,7 @@ internal constructor( */ override fun submitToolOutputs( params: BetaThreadRunSubmitToolOutputsParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): Run { val request = HttpRequest.builder() @@ -233,7 +230,7 @@ internal constructor( params.getPathParam(0), "runs", params.getPathParam(1), - "submit_tool_outputs" + "submit_tool_outputs", ) .putAllHeaders(DEFAULT_HEADERS) .body(json(clientOptions.jsonMapper, params._body())) @@ -261,7 +258,7 @@ internal constructor( */ override fun submitToolOutputsStreaming( params: BetaThreadRunSubmitToolOutputsParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): StreamResponse { val request = HttpRequest.builder() @@ -271,7 +268,7 @@ internal constructor( params.getPathParam(0), "runs", params.getPathParam(1), - "submit_tool_outputs" + "submit_tool_outputs", ) .putAllHeaders(DEFAULT_HEADERS) .body( @@ -281,7 +278,7 @@ internal constructor( ._body() .toBuilder() .putAdditionalProperty("stream", JsonValue.from(true)) - .build() + .build(), ) ) .build() diff --git a/openai-java-core/src/main/kotlin/com/openai/services/blocking/beta/threads/runs/StepService.kt b/openai-java-core/src/main/kotlin/com/openai/services/blocking/beta/threads/runs/StepService.kt index 9993c793..a61bb90c 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/blocking/beta/threads/runs/StepService.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/blocking/beta/threads/runs/StepService.kt @@ -16,13 +16,13 @@ interface StepService { @JvmOverloads fun retrieve( params: BetaThreadRunStepRetrieveParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): RunStep /** Returns a list of run steps belonging to a run. */ @JvmOverloads fun list( params: BetaThreadRunStepListParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): BetaThreadRunStepListPage } diff --git a/openai-java-core/src/main/kotlin/com/openai/services/blocking/beta/threads/runs/StepServiceImpl.kt b/openai-java-core/src/main/kotlin/com/openai/services/blocking/beta/threads/runs/StepServiceImpl.kt index da59fd2d..f3c73c31 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/blocking/beta/threads/runs/StepServiceImpl.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/blocking/beta/threads/runs/StepServiceImpl.kt @@ -18,10 +18,7 @@ import com.openai.models.BetaThreadRunStepListParams import com.openai.models.BetaThreadRunStepRetrieveParams import com.openai.models.RunStep -class StepServiceImpl -internal constructor( - private val clientOptions: ClientOptions, -) : StepService { +class StepServiceImpl internal constructor(private val clientOptions: ClientOptions) : StepService { companion object { @@ -36,7 +33,7 @@ internal constructor( /** Retrieves a run step. */ override fun retrieve( params: BetaThreadRunStepRetrieveParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): RunStep { val request = HttpRequest.builder() @@ -47,7 +44,7 @@ internal constructor( "runs", params.getPathParam(1), "steps", - params.getPathParam(2) + params.getPathParam(2), ) .putAllHeaders(DEFAULT_HEADERS) .build() @@ -69,7 +66,7 @@ internal constructor( /** Returns a list of run steps belonging to a run. */ override fun list( params: BetaThreadRunStepListParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): BetaThreadRunStepListPage { val request = HttpRequest.builder() @@ -79,7 +76,7 @@ internal constructor( params.getPathParam(0), "runs", params.getPathParam(1), - "steps" + "steps", ) .putAllHeaders(DEFAULT_HEADERS) .build() diff --git a/openai-java-core/src/main/kotlin/com/openai/services/blocking/beta/vectorStores/FileBatchService.kt b/openai-java-core/src/main/kotlin/com/openai/services/blocking/beta/vectorStores/FileBatchService.kt index 6c0cb81e..4690bb6c 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/blocking/beta/vectorStores/FileBatchService.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/blocking/beta/vectorStores/FileBatchService.kt @@ -18,14 +18,14 @@ interface FileBatchService { @JvmOverloads fun create( params: BetaVectorStoreFileBatchCreateParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): VectorStoreFileBatch /** Retrieves a vector store file batch. */ @JvmOverloads fun retrieve( params: BetaVectorStoreFileBatchRetrieveParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): VectorStoreFileBatch /** @@ -35,13 +35,13 @@ interface FileBatchService { @JvmOverloads fun cancel( params: BetaVectorStoreFileBatchCancelParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): VectorStoreFileBatch /** Returns a list of vector store files in a batch. */ @JvmOverloads fun listFiles( params: BetaVectorStoreFileBatchListFilesParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): BetaVectorStoreFileBatchListFilesPage } diff --git a/openai-java-core/src/main/kotlin/com/openai/services/blocking/beta/vectorStores/FileBatchServiceImpl.kt b/openai-java-core/src/main/kotlin/com/openai/services/blocking/beta/vectorStores/FileBatchServiceImpl.kt index d1142615..0ff7b231 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/blocking/beta/vectorStores/FileBatchServiceImpl.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/blocking/beta/vectorStores/FileBatchServiceImpl.kt @@ -21,10 +21,8 @@ import com.openai.models.BetaVectorStoreFileBatchListFilesParams import com.openai.models.BetaVectorStoreFileBatchRetrieveParams import com.openai.models.VectorStoreFileBatch -class FileBatchServiceImpl -internal constructor( - private val clientOptions: ClientOptions, -) : FileBatchService { +class FileBatchServiceImpl internal constructor(private val clientOptions: ClientOptions) : + FileBatchService { companion object { @@ -39,7 +37,7 @@ internal constructor( /** Create a vector store file batch. */ override fun create( params: BetaVectorStoreFileBatchCreateParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): VectorStoreFileBatch { val request = HttpRequest.builder() @@ -65,7 +63,7 @@ internal constructor( /** Retrieves a vector store file batch. */ override fun retrieve( params: BetaVectorStoreFileBatchRetrieveParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): VectorStoreFileBatch { val request = HttpRequest.builder() @@ -74,7 +72,7 @@ internal constructor( "vector_stores", params.getPathParam(0), "file_batches", - params.getPathParam(1) + params.getPathParam(1), ) .putAllHeaders(DEFAULT_HEADERS) .build() @@ -98,7 +96,7 @@ internal constructor( */ override fun cancel( params: BetaVectorStoreFileBatchCancelParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): VectorStoreFileBatch { val request = HttpRequest.builder() @@ -108,7 +106,7 @@ internal constructor( params.getPathParam(0), "file_batches", params.getPathParam(1), - "cancel" + "cancel", ) .putAllHeaders(DEFAULT_HEADERS) .apply { params._body().ifPresent { body(json(clientOptions.jsonMapper, it)) } } @@ -131,7 +129,7 @@ internal constructor( /** Returns a list of vector store files in a batch. */ override fun listFiles( params: BetaVectorStoreFileBatchListFilesParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): BetaVectorStoreFileBatchListFilesPage { val request = HttpRequest.builder() @@ -141,7 +139,7 @@ internal constructor( params.getPathParam(0), "file_batches", params.getPathParam(1), - "files" + "files", ) .putAllHeaders(DEFAULT_HEADERS) .build() diff --git a/openai-java-core/src/main/kotlin/com/openai/services/blocking/beta/vectorStores/FileService.kt b/openai-java-core/src/main/kotlin/com/openai/services/blocking/beta/vectorStores/FileService.kt index 6ef81257..99c8c4ad 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/blocking/beta/vectorStores/FileService.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/blocking/beta/vectorStores/FileService.kt @@ -23,21 +23,21 @@ interface FileService { @JvmOverloads fun create( params: BetaVectorStoreFileCreateParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): VectorStoreFile /** Retrieves a vector store file. */ @JvmOverloads fun retrieve( params: BetaVectorStoreFileRetrieveParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): VectorStoreFile /** Returns a list of vector store files. */ @JvmOverloads fun list( params: BetaVectorStoreFileListParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): BetaVectorStoreFileListPage /** @@ -48,6 +48,6 @@ interface FileService { @JvmOverloads fun delete( params: BetaVectorStoreFileDeleteParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): VectorStoreFileDeleted } diff --git a/openai-java-core/src/main/kotlin/com/openai/services/blocking/beta/vectorStores/FileServiceImpl.kt b/openai-java-core/src/main/kotlin/com/openai/services/blocking/beta/vectorStores/FileServiceImpl.kt index 64ace0f0..54fae9f2 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/blocking/beta/vectorStores/FileServiceImpl.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/blocking/beta/vectorStores/FileServiceImpl.kt @@ -22,10 +22,7 @@ import com.openai.models.BetaVectorStoreFileRetrieveParams import com.openai.models.VectorStoreFile import com.openai.models.VectorStoreFileDeleted -class FileServiceImpl -internal constructor( - private val clientOptions: ClientOptions, -) : FileService { +class FileServiceImpl internal constructor(private val clientOptions: ClientOptions) : FileService { companion object { @@ -44,7 +41,7 @@ internal constructor( */ override fun create( params: BetaVectorStoreFileCreateParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): VectorStoreFile { val request = HttpRequest.builder() @@ -70,7 +67,7 @@ internal constructor( /** Retrieves a vector store file. */ override fun retrieve( params: BetaVectorStoreFileRetrieveParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): VectorStoreFile { val request = HttpRequest.builder() @@ -79,7 +76,7 @@ internal constructor( "vector_stores", params.getPathParam(0), "files", - params.getPathParam(1) + params.getPathParam(1), ) .putAllHeaders(DEFAULT_HEADERS) .build() @@ -101,7 +98,7 @@ internal constructor( /** Returns a list of vector store files. */ override fun list( params: BetaVectorStoreFileListParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): BetaVectorStoreFileListPage { val request = HttpRequest.builder() @@ -131,7 +128,7 @@ internal constructor( */ override fun delete( params: BetaVectorStoreFileDeleteParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): VectorStoreFileDeleted { val request = HttpRequest.builder() @@ -140,7 +137,7 @@ internal constructor( "vector_stores", params.getPathParam(0), "files", - params.getPathParam(1) + params.getPathParam(1), ) .putAllHeaders(DEFAULT_HEADERS) .apply { params._body().ifPresent { body(json(clientOptions.jsonMapper, it)) } } diff --git a/openai-java-core/src/main/kotlin/com/openai/services/blocking/chat/CompletionService.kt b/openai-java-core/src/main/kotlin/com/openai/services/blocking/chat/CompletionService.kt index 96e11687..49230e27 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/blocking/chat/CompletionService.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/blocking/chat/CompletionService.kt @@ -34,7 +34,7 @@ interface CompletionService { @JvmOverloads fun create( params: ChatCompletionCreateParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): ChatCompletion /** @@ -52,7 +52,7 @@ interface CompletionService { @MustBeClosed fun createStreaming( params: ChatCompletionCreateParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): StreamResponse /** @@ -62,7 +62,7 @@ interface CompletionService { @JvmOverloads fun retrieve( params: ChatCompletionRetrieveParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): ChatCompletion /** @@ -73,7 +73,7 @@ interface CompletionService { @JvmOverloads fun update( params: ChatCompletionUpdateParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): ChatCompletion /** @@ -83,6 +83,6 @@ interface CompletionService { @JvmOverloads fun delete( params: ChatCompletionDeleteParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): ChatCompletionDeleted } diff --git a/openai-java-core/src/main/kotlin/com/openai/services/blocking/chat/CompletionServiceImpl.kt b/openai-java-core/src/main/kotlin/com/openai/services/blocking/chat/CompletionServiceImpl.kt index 5d3809aa..8246ceff 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/blocking/chat/CompletionServiceImpl.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/blocking/chat/CompletionServiceImpl.kt @@ -28,10 +28,8 @@ import com.openai.models.ChatCompletionUpdateParams import com.openai.services.blocking.chat.completions.MessageService import com.openai.services.blocking.chat.completions.MessageServiceImpl -class CompletionServiceImpl -internal constructor( - private val clientOptions: ClientOptions, -) : CompletionService { +class CompletionServiceImpl internal constructor(private val clientOptions: ClientOptions) : + CompletionService { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) @@ -55,7 +53,7 @@ internal constructor( */ override fun create( params: ChatCompletionCreateParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): ChatCompletion { val request = HttpRequest.builder() @@ -92,7 +90,7 @@ internal constructor( */ override fun createStreaming( params: ChatCompletionCreateParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): StreamResponse { val request = HttpRequest.builder() @@ -105,7 +103,7 @@ internal constructor( ._body() .toBuilder() .putAdditionalProperty("stream", JsonValue.from(true)) - .build() + .build(), ) ) .build() @@ -131,7 +129,7 @@ internal constructor( */ override fun retrieve( params: ChatCompletionRetrieveParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): ChatCompletion { val request = HttpRequest.builder() @@ -159,7 +157,7 @@ internal constructor( */ override fun update( params: ChatCompletionUpdateParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): ChatCompletion { val request = HttpRequest.builder() @@ -187,7 +185,7 @@ internal constructor( */ override fun delete( params: ChatCompletionDeleteParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): ChatCompletionDeleted { val request = HttpRequest.builder() diff --git a/openai-java-core/src/main/kotlin/com/openai/services/blocking/chat/completions/MessageService.kt b/openai-java-core/src/main/kotlin/com/openai/services/blocking/chat/completions/MessageService.kt index 4a42b298..562e6da9 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/blocking/chat/completions/MessageService.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/blocking/chat/completions/MessageService.kt @@ -17,6 +17,6 @@ interface MessageService { @JvmOverloads fun list( params: ChatCompletionMessageListParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): ChatCompletionMessageListPage } diff --git a/openai-java-core/src/main/kotlin/com/openai/services/blocking/chat/completions/MessageServiceImpl.kt b/openai-java-core/src/main/kotlin/com/openai/services/blocking/chat/completions/MessageServiceImpl.kt index 6dc906d0..870f5126 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/blocking/chat/completions/MessageServiceImpl.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/blocking/chat/completions/MessageServiceImpl.kt @@ -15,10 +15,8 @@ import com.openai.errors.OpenAIError import com.openai.models.ChatCompletionMessageListPage import com.openai.models.ChatCompletionMessageListParams -class MessageServiceImpl -internal constructor( - private val clientOptions: ClientOptions, -) : MessageService { +class MessageServiceImpl internal constructor(private val clientOptions: ClientOptions) : + MessageService { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) @@ -32,7 +30,7 @@ internal constructor( */ override fun list( params: ChatCompletionMessageListParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): ChatCompletionMessageListPage { val request = HttpRequest.builder() diff --git a/openai-java-core/src/main/kotlin/com/openai/services/blocking/fineTuning/JobService.kt b/openai-java-core/src/main/kotlin/com/openai/services/blocking/fineTuning/JobService.kt index 4d085f07..0a570945 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/blocking/fineTuning/JobService.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/blocking/fineTuning/JobService.kt @@ -31,7 +31,7 @@ interface JobService { @JvmOverloads fun create( params: FineTuningJobCreateParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): FineTuningJob /** @@ -42,27 +42,27 @@ interface JobService { @JvmOverloads fun retrieve( params: FineTuningJobRetrieveParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): FineTuningJob /** List your organization's fine-tuning jobs */ @JvmOverloads fun list( params: FineTuningJobListParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): FineTuningJobListPage /** Immediately cancel a fine-tune job. */ @JvmOverloads fun cancel( params: FineTuningJobCancelParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): FineTuningJob /** Get status updates for a fine-tuning job. */ @JvmOverloads fun listEvents( params: FineTuningJobListEventsParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): FineTuningJobListEventsPage } diff --git a/openai-java-core/src/main/kotlin/com/openai/services/blocking/fineTuning/JobServiceImpl.kt b/openai-java-core/src/main/kotlin/com/openai/services/blocking/fineTuning/JobServiceImpl.kt index 5f5527ef..6bc123cf 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/blocking/fineTuning/JobServiceImpl.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/blocking/fineTuning/JobServiceImpl.kt @@ -24,10 +24,7 @@ import com.openai.models.FineTuningJobRetrieveParams import com.openai.services.blocking.fineTuning.jobs.CheckpointService import com.openai.services.blocking.fineTuning.jobs.CheckpointServiceImpl -class JobServiceImpl -internal constructor( - private val clientOptions: ClientOptions, -) : JobService { +class JobServiceImpl internal constructor(private val clientOptions: ClientOptions) : JobService { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) @@ -49,7 +46,7 @@ internal constructor( */ override fun create( params: FineTuningJobCreateParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): FineTuningJob { val request = HttpRequest.builder() @@ -78,7 +75,7 @@ internal constructor( */ override fun retrieve( params: FineTuningJobRetrieveParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): FineTuningJob { val request = HttpRequest.builder() @@ -103,7 +100,7 @@ internal constructor( /** List your organization's fine-tuning jobs */ override fun list( params: FineTuningJobListParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): FineTuningJobListPage { val request = HttpRequest.builder() @@ -128,7 +125,7 @@ internal constructor( /** Immediately cancel a fine-tune job. */ override fun cancel( params: FineTuningJobCancelParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): FineTuningJob { val request = HttpRequest.builder() @@ -154,7 +151,7 @@ internal constructor( /** Get status updates for a fine-tuning job. */ override fun listEvents( params: FineTuningJobListEventsParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): FineTuningJobListEventsPage { val request = HttpRequest.builder() diff --git a/openai-java-core/src/main/kotlin/com/openai/services/blocking/fineTuning/jobs/CheckpointService.kt b/openai-java-core/src/main/kotlin/com/openai/services/blocking/fineTuning/jobs/CheckpointService.kt index ac552161..ebc01058 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/blocking/fineTuning/jobs/CheckpointService.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/blocking/fineTuning/jobs/CheckpointService.kt @@ -14,6 +14,6 @@ interface CheckpointService { @JvmOverloads fun list( params: FineTuningJobCheckpointListParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): FineTuningJobCheckpointListPage } diff --git a/openai-java-core/src/main/kotlin/com/openai/services/blocking/fineTuning/jobs/CheckpointServiceImpl.kt b/openai-java-core/src/main/kotlin/com/openai/services/blocking/fineTuning/jobs/CheckpointServiceImpl.kt index d00f2d6c..c62b2499 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/blocking/fineTuning/jobs/CheckpointServiceImpl.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/blocking/fineTuning/jobs/CheckpointServiceImpl.kt @@ -15,10 +15,8 @@ import com.openai.errors.OpenAIError import com.openai.models.FineTuningJobCheckpointListPage import com.openai.models.FineTuningJobCheckpointListParams -class CheckpointServiceImpl -internal constructor( - private val clientOptions: ClientOptions, -) : CheckpointService { +class CheckpointServiceImpl internal constructor(private val clientOptions: ClientOptions) : + CheckpointService { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) @@ -29,7 +27,7 @@ internal constructor( /** List checkpoints for a fine-tuning job. */ override fun list( params: FineTuningJobCheckpointListParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): FineTuningJobCheckpointListPage { val request = HttpRequest.builder() diff --git a/openai-java-core/src/main/kotlin/com/openai/services/blocking/uploads/PartServiceImpl.kt b/openai-java-core/src/main/kotlin/com/openai/services/blocking/uploads/PartServiceImpl.kt index 8a0838d9..f49dc37e 100644 --- a/openai-java-core/src/main/kotlin/com/openai/services/blocking/uploads/PartServiceImpl.kt +++ b/openai-java-core/src/main/kotlin/com/openai/services/blocking/uploads/PartServiceImpl.kt @@ -4,7 +4,4 @@ package com.openai.services.blocking.uploads import com.openai.core.ClientOptions -class PartServiceImpl -internal constructor( - private val clientOptions: ClientOptions, -) : PartService +class PartServiceImpl internal constructor(private val clientOptions: ClientOptions) : PartService diff --git a/openai-java-core/src/test/kotlin/com/openai/TestServerExtension.kt b/openai-java-core/src/test/kotlin/com/openai/TestServerExtension.kt index 88e7d1f4..7dfdef2b 100644 --- a/openai-java-core/src/test/kotlin/com/openai/TestServerExtension.kt +++ b/openai-java-core/src/test/kotlin/com/openai/TestServerExtension.kt @@ -36,7 +36,7 @@ class TestServerExtension : BeforeAllCallback, ExecutionCondition { $ prism mock path/to/your.openapi.yml """ .trimIndent(), - e + e, ) } } diff --git a/openai-java-core/src/test/kotlin/com/openai/core/PhantomReachableTest.kt b/openai-java-core/src/test/kotlin/com/openai/core/PhantomReachableTest.kt index c9b0e05e..12142553 100644 --- a/openai-java-core/src/test/kotlin/com/openai/core/PhantomReachableTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/core/PhantomReachableTest.kt @@ -14,7 +14,7 @@ internal class PhantomReachableTest { // Pass an inline object for the object to observe so that it becomes immediately // unreachable. Any(), - closeable + closeable, ) assertThat(closed).isFalse() diff --git a/openai-java-core/src/test/kotlin/com/openai/core/handlers/SseHandlerTest.kt b/openai-java-core/src/test/kotlin/com/openai/core/handlers/SseHandlerTest.kt index dd805890..680afaa5 100644 --- a/openai-java-core/src/test/kotlin/com/openai/core/handlers/SseHandlerTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/core/handlers/SseHandlerTest.kt @@ -20,14 +20,14 @@ class SseHandlerTest { enum class TestCase( internal val body: String, internal val expectedMessages: List? = null, - internal val expectedException: Exception? = null + internal val expectedException: Exception? = null, ) { DATA_MISSING_EVENT( buildString { append("data: {\"foo\":true}\n") append("\n") }, - listOf(sseMessageBuilder().data("{\"foo\":true}").build()) + listOf(sseMessageBuilder().data("{\"foo\":true}").build()), ), MULTIPLE_DATA_MISSING_EVENT( buildString { @@ -38,8 +38,8 @@ class SseHandlerTest { }, listOf( sseMessageBuilder().data("{\"foo\":true}").build(), - sseMessageBuilder().data("{\"bar\":false}").build() - ) + sseMessageBuilder().data("{\"bar\":false}").build(), + ), ), DATA_JSON_ESCAPED_DOUBLE_NEW_LINE( buildString { @@ -48,7 +48,7 @@ class SseHandlerTest { append("data: true}\n") append("\n\n") }, - listOf(sseMessageBuilder().data("{\n\"foo\":\ntrue}").build()) + listOf(sseMessageBuilder().data("{\n\"foo\":\ntrue}").build()), ), MULTIPLE_DATA_LINES( buildString { @@ -57,7 +57,7 @@ class SseHandlerTest { append("data: true}\n") append("\n\n") }, - listOf(sseMessageBuilder().data("{\n\"foo\":\ntrue}").build()) + listOf(sseMessageBuilder().data("{\n\"foo\":\ntrue}").build()), ), SPECIAL_NEW_LINE_CHARACTER( buildString { @@ -71,37 +71,37 @@ class SseHandlerTest { listOf( sseMessageBuilder().data("{\"content\":\" culpa\"}").build(), sseMessageBuilder().data("{\"content\":\" \u2028\"}").build(), - sseMessageBuilder().data("{\"content\":\"foo\"}").build() - ) + sseMessageBuilder().data("{\"content\":\"foo\"}").build(), + ), ), MULTI_BYTE_CHARACTER( buildString { append("data: {\"content\":\"\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u0438\"}\n") append("\n") }, - listOf(sseMessageBuilder().data("{\"content\":\"известни\"}").build()) + listOf(sseMessageBuilder().data("{\"content\":\"известни\"}").build()), ), STRING_ERROR_PROPERTY( buildString { append("data: {\"error\":\"ERROR!\"}\n") append("\n") }, - expectedException = OpenAIException("ERROR!") + expectedException = OpenAIException("ERROR!"), ), ERROR_PROPERTY_WITH_MESSAGE( buildString { append("data: {\"error\":{\"message\":\"ERROR!\"}}\n") append("\n") }, - expectedException = OpenAIException("ERROR!") + expectedException = OpenAIException("ERROR!"), ), ERROR_PROPERTY_MALFORMED( buildString { append("data: {\"error\":42}\n") append("\n") }, - expectedException = OpenAIException("An error occurred during streaming") - ) + expectedException = OpenAIException("An error occurred during streaming"), + ), } @ParameterizedTest diff --git a/openai-java-core/src/test/kotlin/com/openai/core/http/ClientOptionsTest.kt b/openai-java-core/src/test/kotlin/com/openai/core/http/ClientOptionsTest.kt index fb16d83e..7bba0f65 100644 --- a/openai-java-core/src/test/kotlin/com/openai/core/http/ClientOptionsTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/core/http/ClientOptionsTest.kt @@ -26,7 +26,7 @@ internal class ClientOptionsTest { return Stream.of( "https://api.openai.com/v1", "https://example.openai.azure.com", - "https://example.azure-api.net" + "https://example.azure-api.net", ) } } diff --git a/openai-java-core/src/test/kotlin/com/openai/core/http/HeadersTest.kt b/openai-java-core/src/test/kotlin/com/openai/core/http/HeadersTest.kt index 4c594edd..c1d7fe08 100644 --- a/openai-java-core/src/test/kotlin/com/openai/core/http/HeadersTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/core/http/HeadersTest.kt @@ -11,28 +11,28 @@ internal class HeadersTest { enum class TestCase( val headers: Headers, val expectedMap: Map>, - val expectedSize: Int + val expectedSize: Int, ) { EMPTY(Headers.builder().build(), expectedMap = mapOf(), expectedSize = 0), PUT_ONE( Headers.builder().put("name", "value").build(), expectedMap = mapOf("name" to listOf("value")), - expectedSize = 1 + expectedSize = 1, ), PUT_MULTIPLE( Headers.builder().put("name", listOf("value1", "value2")).build(), expectedMap = mapOf("name" to listOf("value1", "value2")), - expectedSize = 2 + expectedSize = 2, ), MULTIPLE_PUT( Headers.builder().put("name1", "value").put("name2", "value").build(), expectedMap = mapOf("name1" to listOf("value"), "name2" to listOf("value")), - expectedSize = 2 + expectedSize = 2, ), MULTIPLE_PUT_SAME_NAME( Headers.builder().put("name", "value1").put("name", "value2").build(), expectedMap = mapOf("name" to listOf("value1", "value2")), - expectedSize = 2 + expectedSize = 2, ), MULTIPLE_PUT_MULTIPLE( Headers.builder() @@ -40,7 +40,7 @@ internal class HeadersTest { .put("name", listOf("value1", "value2")) .build(), expectedMap = mapOf("name" to listOf("value1", "value2", "value1", "value2")), - expectedSize = 4 + expectedSize = 4, ), PUT_CASE_INSENSITIVE( Headers.builder() @@ -49,25 +49,25 @@ internal class HeadersTest { .put("nAmE", "value3") .build(), expectedMap = mapOf("name" to listOf("value1", "value2", "value3")), - expectedSize = 3 + expectedSize = 3, ), PUT_ALL_MAP( Headers.builder() .putAll( mapOf( "name1" to listOf("value1", "value2"), - "name2" to listOf("value1", "value2") + "name2" to listOf("value1", "value2"), ) ) .build(), expectedMap = mapOf("name1" to listOf("value1", "value2"), "name2" to listOf("value1", "value2")), - expectedSize = 4 + expectedSize = 4, ), PUT_ALL_HEADERS( Headers.builder().putAll(Headers.builder().put("name", "value").build()).build(), expectedMap = mapOf("name" to listOf("value")), - expectedSize = 1 + expectedSize = 1, ), PUT_ALL_CASE_INSENSITIVE( Headers.builder() @@ -75,32 +75,32 @@ internal class HeadersTest { mapOf( "name" to listOf("value1"), "NAME" to listOf("value2"), - "nAmE" to listOf("value3") + "nAmE" to listOf("value3"), ) ) .build(), expectedMap = mapOf("name" to listOf("value1", "value2", "value3")), - expectedSize = 3 + expectedSize = 3, ), REMOVE_ABSENT( Headers.builder().remove("name").build(), expectedMap = mapOf(), - expectedSize = 0 + expectedSize = 0, ), REMOVE_PRESENT_ONE( Headers.builder().put("name", "value").remove("name").build(), expectedMap = mapOf(), - expectedSize = 0 + expectedSize = 0, ), REMOVE_PRESENT_MULTIPLE( Headers.builder().put("name", listOf("value1", "value2")).remove("name").build(), expectedMap = mapOf(), - expectedSize = 0 + expectedSize = 0, ), REMOVE_CASE_INSENSITIVE( Headers.builder().put("name", listOf("value1", "value2")).remove("NAME").build(), expectedMap = mapOf(), - expectedSize = 0 + expectedSize = 0, ), REMOVE_ALL( Headers.builder() @@ -109,7 +109,7 @@ internal class HeadersTest { .removeAll(setOf("name1", "name2", "name3")) .build(), expectedMap = mapOf(), - expectedSize = 0 + expectedSize = 0, ), REMOVE_ALL_CASE_INSENSITIVE( Headers.builder() @@ -118,22 +118,22 @@ internal class HeadersTest { .removeAll(setOf("NAME1", "nAmE3")) .build(), expectedMap = mapOf(), - expectedSize = 0 + expectedSize = 0, ), CLEAR( Headers.builder().put("name1", "value").put("name2", "value").clear().build(), expectedMap = mapOf(), - expectedSize = 0 + expectedSize = 0, ), REPLACE_ONE_ABSENT( Headers.builder().replace("name", "value").build(), expectedMap = mapOf("name" to listOf("value")), - expectedSize = 1 + expectedSize = 1, ), REPLACE_ONE_PRESENT_ONE( Headers.builder().put("name", "value1").replace("name", "value2").build(), expectedMap = mapOf("name" to listOf("value2")), - expectedSize = 1 + expectedSize = 1, ), REPLACE_ONE_PRESENT_MULTIPLE( Headers.builder() @@ -141,12 +141,12 @@ internal class HeadersTest { .replace("name", "value3") .build(), expectedMap = mapOf("name" to listOf("value3")), - expectedSize = 1 + expectedSize = 1, ), REPLACE_MULTIPLE_ABSENT( Headers.builder().replace("name", listOf("value1", "value2")).build(), expectedMap = mapOf("name" to listOf("value1", "value2")), - expectedSize = 2 + expectedSize = 2, ), REPLACE_MULTIPLE_PRESENT_ONE( Headers.builder() @@ -154,7 +154,7 @@ internal class HeadersTest { .replace("name", listOf("value2", "value3")) .build(), expectedMap = mapOf("name" to listOf("value2", "value3")), - expectedSize = 2 + expectedSize = 2, ), REPLACE_MULTIPLE_PRESENT_MULTIPLE( Headers.builder() @@ -162,7 +162,7 @@ internal class HeadersTest { .replace("name", listOf("value3", "value4")) .build(), expectedMap = mapOf("name" to listOf("value3", "value4")), - expectedSize = 2 + expectedSize = 2, ), REPLACE_CASE_INSENSITIVE( Headers.builder() @@ -170,7 +170,7 @@ internal class HeadersTest { .replace("NAME", listOf("value2", "value3")) .build(), expectedMap = mapOf("NAME" to listOf("value2", "value3")), - expectedSize = 2 + expectedSize = 2, ), REPLACE_ALL_MAP( Headers.builder() @@ -183,9 +183,9 @@ internal class HeadersTest { mapOf( "name1" to listOf("value2"), "name2" to listOf("value1"), - "name3" to listOf("value2") + "name3" to listOf("value2"), ), - expectedSize = 3 + expectedSize = 3, ), REPLACE_ALL_HEADERS( Headers.builder() @@ -198,9 +198,9 @@ internal class HeadersTest { mapOf( "name1" to listOf("value2"), "name2" to listOf("value1"), - "name3" to listOf("value2") + "name3" to listOf("value2"), ), - expectedSize = 3 + expectedSize = 3, ), REPLACE_ALL_CASE_INSENSITIVE( Headers.builder() @@ -209,8 +209,8 @@ internal class HeadersTest { .replaceAll(mapOf("NAME1" to listOf("value2"), "nAmE2" to listOf("value2"))) .build(), expectedMap = mapOf("NAME1" to listOf("value2"), "nAmE2" to listOf("value2")), - expectedSize = 2 - ) + expectedSize = 2, + ), } @ParameterizedTest diff --git a/openai-java-core/src/test/kotlin/com/openai/core/http/QueryParamsTest.kt b/openai-java-core/src/test/kotlin/com/openai/core/http/QueryParamsTest.kt index e42fe1d9..a3050847 100644 --- a/openai-java-core/src/test/kotlin/com/openai/core/http/QueryParamsTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/core/http/QueryParamsTest.kt @@ -11,28 +11,28 @@ internal class QueryParamsTest { enum class TestCase( val queryParams: QueryParams, val expectedMap: Map>, - val expectedSize: Int + val expectedSize: Int, ) { EMPTY(QueryParams.builder().build(), expectedMap = mapOf(), expectedSize = 0), PUT_ONE( QueryParams.builder().put("key", "value").build(), expectedMap = mapOf("key" to listOf("value")), - expectedSize = 1 + expectedSize = 1, ), PUT_MULTIPLE( QueryParams.builder().put("key", listOf("value1", "value2")).build(), expectedMap = mapOf("key" to listOf("value1", "value2")), - expectedSize = 2 + expectedSize = 2, ), MULTIPLE_PUT( QueryParams.builder().put("key1", "value").put("key2", "value").build(), expectedMap = mapOf("key1" to listOf("value"), "key2" to listOf("value")), - expectedSize = 2 + expectedSize = 2, ), MULTIPLE_PUT_SAME_NAME( QueryParams.builder().put("key", "value1").put("key", "value2").build(), expectedMap = mapOf("key" to listOf("value1", "value2")), - expectedSize = 2 + expectedSize = 2, ), MULTIPLE_PUT_MULTIPLE( QueryParams.builder() @@ -40,40 +40,40 @@ internal class QueryParamsTest { .put("key", listOf("value1", "value2")) .build(), expectedMap = mapOf("key" to listOf("value1", "value2", "value1", "value2")), - expectedSize = 4 + expectedSize = 4, ), PUT_ALL_MAP( QueryParams.builder() .putAll( mapOf( "key1" to listOf("value1", "value2"), - "key2" to listOf("value1", "value2") + "key2" to listOf("value1", "value2"), ) ) .build(), expectedMap = mapOf("key1" to listOf("value1", "value2"), "key2" to listOf("value1", "value2")), - expectedSize = 4 + expectedSize = 4, ), PUT_ALL_HEADERS( QueryParams.builder().putAll(QueryParams.builder().put("key", "value").build()).build(), expectedMap = mapOf("key" to listOf("value")), - expectedSize = 1 + expectedSize = 1, ), REMOVE_ABSENT( QueryParams.builder().remove("key").build(), expectedMap = mapOf(), - expectedSize = 0 + expectedSize = 0, ), REMOVE_PRESENT_ONE( QueryParams.builder().put("key", "value").remove("key").build(), expectedMap = mapOf(), - expectedSize = 0 + expectedSize = 0, ), REMOVE_PRESENT_MULTIPLE( QueryParams.builder().put("key", listOf("value1", "value2")).remove("key").build(), expectedMap = mapOf(), - expectedSize = 0 + expectedSize = 0, ), REMOVE_ALL( QueryParams.builder() @@ -82,22 +82,22 @@ internal class QueryParamsTest { .removeAll(setOf("key1", "key2", "key3")) .build(), expectedMap = mapOf(), - expectedSize = 0 + expectedSize = 0, ), CLEAR( QueryParams.builder().put("key1", "value").put("key2", "value").clear().build(), expectedMap = mapOf(), - expectedSize = 0 + expectedSize = 0, ), REPLACE_ONE_ABSENT( QueryParams.builder().replace("key", "value").build(), expectedMap = mapOf("key" to listOf("value")), - expectedSize = 1 + expectedSize = 1, ), REPLACE_ONE_PRESENT_ONE( QueryParams.builder().put("key", "value1").replace("key", "value2").build(), expectedMap = mapOf("key" to listOf("value2")), - expectedSize = 1 + expectedSize = 1, ), REPLACE_ONE_PRESENT_MULTIPLE( QueryParams.builder() @@ -105,12 +105,12 @@ internal class QueryParamsTest { .replace("key", "value3") .build(), expectedMap = mapOf("key" to listOf("value3")), - expectedSize = 1 + expectedSize = 1, ), REPLACE_MULTIPLE_ABSENT( QueryParams.builder().replace("key", listOf("value1", "value2")).build(), expectedMap = mapOf("key" to listOf("value1", "value2")), - expectedSize = 2 + expectedSize = 2, ), REPLACE_MULTIPLE_PRESENT_ONE( QueryParams.builder() @@ -118,7 +118,7 @@ internal class QueryParamsTest { .replace("key", listOf("value2", "value3")) .build(), expectedMap = mapOf("key" to listOf("value2", "value3")), - expectedSize = 2 + expectedSize = 2, ), REPLACE_MULTIPLE_PRESENT_MULTIPLE( QueryParams.builder() @@ -126,7 +126,7 @@ internal class QueryParamsTest { .replace("key", listOf("value3", "value4")) .build(), expectedMap = mapOf("key" to listOf("value3", "value4")), - expectedSize = 2 + expectedSize = 2, ), REPLACE_ALL_MAP( QueryParams.builder() @@ -139,9 +139,9 @@ internal class QueryParamsTest { mapOf( "key1" to listOf("value2"), "key2" to listOf("value1"), - "key3" to listOf("value2") + "key3" to listOf("value2"), ), - expectedSize = 3 + expectedSize = 3, ), REPLACE_ALL_HEADERS( QueryParams.builder() @@ -156,10 +156,10 @@ internal class QueryParamsTest { mapOf( "key1" to listOf("value2"), "key2" to listOf("value1"), - "key3" to listOf("value2") + "key3" to listOf("value2"), ), - expectedSize = 3 - ) + expectedSize = 3, + ), } @ParameterizedTest diff --git a/openai-java-core/src/test/kotlin/com/openai/core/http/RetryingHttpClientTest.kt b/openai-java-core/src/test/kotlin/com/openai/core/http/RetryingHttpClientTest.kt index b1c6dd75..87b256b0 100644 --- a/openai-java-core/src/test/kotlin/com/openai/core/http/RetryingHttpClientTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/core/http/RetryingHttpClientTest.kt @@ -26,12 +26,12 @@ internal class RetryingHttpClientTest { object : HttpClient { override fun execute( request: HttpRequest, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): HttpResponse = trackClose(okHttpClient.execute(request, requestOptions)) override fun executeAsync( request: HttpRequest, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture = okHttpClient.executeAsync(request, requestOptions).thenApply { trackClose(it) } @@ -71,7 +71,7 @@ internal class RetryingHttpClientTest { val response = retryingClient.execute( HttpRequest.builder().method(HttpMethod.POST).addPathSegment("something").build(), - async + async, ) assertThat(response.statusCode()).isEqualTo(200) @@ -97,7 +97,7 @@ internal class RetryingHttpClientTest { val response = retryingClient.execute( HttpRequest.builder().method(HttpMethod.POST).addPathSegment("something").build(), - async + async, ) assertThat(response.statusCode()).isEqualTo(200) @@ -140,24 +140,24 @@ internal class RetryingHttpClientTest { val response = retryingClient.execute( HttpRequest.builder().method(HttpMethod.POST).addPathSegment("something").build(), - async + async, ) assertThat(response.statusCode()).isEqualTo(200) verify( 1, postRequestedFor(urlPathEqualTo("/something")) - .withHeader("x-stainless-retry-count", equalTo("0")) + .withHeader("x-stainless-retry-count", equalTo("0")), ) verify( 1, postRequestedFor(urlPathEqualTo("/something")) - .withHeader("x-stainless-retry-count", equalTo("1")) + .withHeader("x-stainless-retry-count", equalTo("1")), ) verify( 1, postRequestedFor(urlPathEqualTo("/something")) - .withHeader("x-stainless-retry-count", equalTo("2")) + .withHeader("x-stainless-retry-count", equalTo("2")), ) assertNoResponseLeaks() } @@ -191,14 +191,14 @@ internal class RetryingHttpClientTest { .addPathSegment("something") .putHeader("x-stainless-retry-count", "42") .build(), - async + async, ) assertThat(response.statusCode()).isEqualTo(200) verify( 2, postRequestedFor(urlPathEqualTo("/something")) - .withHeader("x-stainless-retry-count", equalTo("42")) + .withHeader("x-stainless-retry-count", equalTo("42")), ) assertNoResponseLeaks() } @@ -226,7 +226,7 @@ internal class RetryingHttpClientTest { val response = retryingClient.execute( HttpRequest.builder().method(HttpMethod.POST).addPathSegment("something").build(), - async + async, ) assertThat(response.statusCode()).isEqualTo(200) diff --git a/openai-java-core/src/test/kotlin/com/openai/core/http/SerializerTest.kt b/openai-java-core/src/test/kotlin/com/openai/core/http/SerializerTest.kt index e1279a2e..390f30c0 100644 --- a/openai-java-core/src/test/kotlin/com/openai/core/http/SerializerTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/core/http/SerializerTest.kt @@ -48,11 +48,7 @@ internal class SerializerTest { override fun hashCode(): Int { if (hashCode == 0) { - hashCode = - Objects.hash( - isActive, - additionalProperties, - ) + hashCode = Objects.hash(isActive, additionalProperties) } return hashCode } @@ -91,10 +87,7 @@ internal class SerializerTest { } fun build(): ClassWithBooleanFieldPrefixedWithIs = - ClassWithBooleanFieldPrefixedWithIs( - isActive, - additionalProperties.toImmutable(), - ) + ClassWithBooleanFieldPrefixedWithIs(isActive, additionalProperties.toImmutable()) } } diff --git a/openai-java-core/src/test/kotlin/com/openai/models/BetaAssistantCreateParamsTest.kt b/openai-java-core/src/test/kotlin/com/openai/models/BetaAssistantCreateParamsTest.kt index a02e1470..dc00fd56 100644 --- a/openai-java-core/src/test/kotlin/com/openai/models/BetaAssistantCreateParamsTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/models/BetaAssistantCreateParamsTest.kt @@ -91,7 +91,7 @@ class BetaAssistantCreateParamsTest { Metadata.builder() .putAdditionalProperty( "foo", - JsonValue.from("string") + JsonValue.from("string"), ) .build() ) diff --git a/openai-java-core/src/test/kotlin/com/openai/models/BetaThreadCreateAndRunParamsTest.kt b/openai-java-core/src/test/kotlin/com/openai/models/BetaThreadCreateAndRunParamsTest.kt index 37aecdde..a5aa290a 100644 --- a/openai-java-core/src/test/kotlin/com/openai/models/BetaThreadCreateAndRunParamsTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/models/BetaThreadCreateAndRunParamsTest.kt @@ -70,7 +70,7 @@ class BetaThreadCreateAndRunParamsTest { Metadata.builder() .putAdditionalProperty( "foo", - JsonValue.from("string") + JsonValue.from("string"), ) .build() ) @@ -175,7 +175,7 @@ class BetaThreadCreateAndRunParamsTest { Metadata.builder() .putAdditionalProperty( "foo", - JsonValue.from("string") + JsonValue.from("string"), ) .build() ) @@ -274,7 +274,7 @@ class BetaThreadCreateAndRunParamsTest { Metadata.builder() .putAdditionalProperty( "foo", - JsonValue.from("string") + JsonValue.from("string"), ) .build() ) diff --git a/openai-java-core/src/test/kotlin/com/openai/models/BetaThreadCreateParamsTest.kt b/openai-java-core/src/test/kotlin/com/openai/models/BetaThreadCreateParamsTest.kt index f2f33b90..a10ee8a9 100644 --- a/openai-java-core/src/test/kotlin/com/openai/models/BetaThreadCreateParamsTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/models/BetaThreadCreateParamsTest.kt @@ -109,7 +109,7 @@ class BetaThreadCreateParamsTest { Metadata.builder() .putAdditionalProperty( "foo", - JsonValue.from("string") + JsonValue.from("string"), ) .build() ) diff --git a/openai-java-core/src/test/kotlin/com/openai/models/BetaThreadRunCreateParamsTest.kt b/openai-java-core/src/test/kotlin/com/openai/models/BetaThreadRunCreateParamsTest.kt index 8e1e0d89..070cf1f3 100644 --- a/openai-java-core/src/test/kotlin/com/openai/models/BetaThreadRunCreateParamsTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/models/BetaThreadRunCreateParamsTest.kt @@ -107,7 +107,7 @@ class BetaThreadRunCreateParamsTest { val expected = QueryParams.builder() expected.put( "include[]", - RunStepInclude.STEP_DETAILS_TOOL_CALLS_FILE_SEARCH_RESULTS_CONTENT.toString() + RunStepInclude.STEP_DETAILS_TOOL_CALLS_FILE_SEARCH_RESULTS_CONTENT.toString(), ) assertThat(params._queryParams()).isEqualTo(expected.build()) } diff --git a/openai-java-core/src/test/kotlin/com/openai/models/BetaThreadRunStepListParamsTest.kt b/openai-java-core/src/test/kotlin/com/openai/models/BetaThreadRunStepListParamsTest.kt index 483b50e1..b78d10ef 100644 --- a/openai-java-core/src/test/kotlin/com/openai/models/BetaThreadRunStepListParamsTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/models/BetaThreadRunStepListParamsTest.kt @@ -38,7 +38,7 @@ class BetaThreadRunStepListParamsTest { expected.put("before", "before") expected.put( "include[]", - RunStepInclude.STEP_DETAILS_TOOL_CALLS_FILE_SEARCH_RESULTS_CONTENT.toString() + RunStepInclude.STEP_DETAILS_TOOL_CALLS_FILE_SEARCH_RESULTS_CONTENT.toString(), ) expected.put("limit", "0") expected.put("order", BetaThreadRunStepListParams.Order.ASC.toString()) diff --git a/openai-java-core/src/test/kotlin/com/openai/models/BetaThreadRunStepRetrieveParamsTest.kt b/openai-java-core/src/test/kotlin/com/openai/models/BetaThreadRunStepRetrieveParamsTest.kt index 570ce7d1..5842f316 100644 --- a/openai-java-core/src/test/kotlin/com/openai/models/BetaThreadRunStepRetrieveParamsTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/models/BetaThreadRunStepRetrieveParamsTest.kt @@ -30,7 +30,7 @@ class BetaThreadRunStepRetrieveParamsTest { val expected = QueryParams.builder() expected.put( "include[]", - RunStepInclude.STEP_DETAILS_TOOL_CALLS_FILE_SEARCH_RESULTS_CONTENT.toString() + RunStepInclude.STEP_DETAILS_TOOL_CALLS_FILE_SEARCH_RESULTS_CONTENT.toString(), ) assertThat(params._queryParams()).isEqualTo(expected.build()) } diff --git a/openai-java-core/src/test/kotlin/com/openai/models/BetaVectorStoreFileBatchListFilesParamsTest.kt b/openai-java-core/src/test/kotlin/com/openai/models/BetaVectorStoreFileBatchListFilesParamsTest.kt index 599d56f6..e0c891ec 100644 --- a/openai-java-core/src/test/kotlin/com/openai/models/BetaVectorStoreFileBatchListFilesParamsTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/models/BetaVectorStoreFileBatchListFilesParamsTest.kt @@ -38,7 +38,7 @@ class BetaVectorStoreFileBatchListFilesParamsTest { expected.put("before", "before") expected.put( "filter", - BetaVectorStoreFileBatchListFilesParams.Filter.IN_PROGRESS.toString() + BetaVectorStoreFileBatchListFilesParams.Filter.IN_PROGRESS.toString(), ) expected.put("limit", "0") expected.put("order", BetaVectorStoreFileBatchListFilesParams.Order.ASC.toString()) diff --git a/openai-java-core/src/test/kotlin/com/openai/services/ErrorHandlingTest.kt b/openai-java-core/src/test/kotlin/com/openai/services/ErrorHandlingTest.kt index 83fe168e..0a2d4938 100644 --- a/openai-java-core/src/test/kotlin/com/openai/services/ErrorHandlingTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/services/ErrorHandlingTest.kt @@ -540,7 +540,7 @@ class ErrorHandlingTest { assertUnprocessableEntity( e, Headers.builder().put("Foo", "Bar").build(), - OPENAI_ERROR + OPENAI_ERROR, ) }) } @@ -755,7 +755,7 @@ class ErrorHandlingTest { e, 999, Headers.builder().put("Foo", "Bar").build(), - toJson(OPENAI_ERROR) + toJson(OPENAI_ERROR), ) }) } @@ -904,7 +904,7 @@ class ErrorHandlingTest { throwable: Throwable, statusCode: Int, headers: Headers, - responseBody: ByteArray + responseBody: ByteArray, ) { assertThat(throwable) .asInstanceOf( @@ -962,7 +962,7 @@ class ErrorHandlingTest { private fun assertUnprocessableEntity( throwable: Throwable, headers: Headers, - error: OpenAIError + error: OpenAIError, ) { assertThat(throwable) .asInstanceOf( diff --git a/openai-java-core/src/test/kotlin/com/openai/services/blocking/beta/AssistantServiceTest.kt b/openai-java-core/src/test/kotlin/com/openai/services/blocking/beta/AssistantServiceTest.kt index 08a6b696..28278b88 100644 --- a/openai-java-core/src/test/kotlin/com/openai/services/blocking/beta/AssistantServiceTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/services/blocking/beta/AssistantServiceTest.kt @@ -65,7 +65,7 @@ class AssistantServiceTest { Metadata.builder() .putAdditionalProperty( "foo", - JsonValue.from("string") + JsonValue.from("string"), ) .build() ) diff --git a/openai-java-core/src/test/kotlin/com/openai/services/blocking/beta/ThreadServiceTest.kt b/openai-java-core/src/test/kotlin/com/openai/services/blocking/beta/ThreadServiceTest.kt index 7281ac76..d04ba916 100644 --- a/openai-java-core/src/test/kotlin/com/openai/services/blocking/beta/ThreadServiceTest.kt +++ b/openai-java-core/src/test/kotlin/com/openai/services/blocking/beta/ThreadServiceTest.kt @@ -75,7 +75,7 @@ class ThreadServiceTest { Metadata.builder() .putAdditionalProperty( "foo", - JsonValue.from("string") + JsonValue.from("string"), ) .build() ) @@ -232,7 +232,7 @@ class ThreadServiceTest { Metadata.builder() .putAdditionalProperty( "foo", - JsonValue.from("string") + JsonValue.from("string"), ) .build() ) @@ -350,7 +350,7 @@ class ThreadServiceTest { Metadata.builder() .putAdditionalProperty( "foo", - JsonValue.from("string") + JsonValue.from("string"), ) .build() ) diff --git a/scripts/format b/scripts/format index c6239fab..456a69db 100755 --- a/scripts/format +++ b/scripts/format @@ -5,4 +5,4 @@ set -e cd "$(dirname "$0")/.." echo "==> Running spotlessApply" -./gradlew --build-cache --parallel --no-daemon spotlessApply +./gradlew spotlessApply diff --git a/scripts/lint b/scripts/lint index 58753d0b..e3a5f5e2 100755 --- a/scripts/lint +++ b/scripts/lint @@ -5,4 +5,4 @@ set -e cd "$(dirname "$0")/.." echo "==> Build classes" -./gradlew --build-cache --parallel --no-daemon build testClasses -x test +./gradlew build testClasses -x test diff --git a/scripts/test b/scripts/test index 72ed0333..6b750a74 100755 --- a/scripts/test +++ b/scripts/test @@ -53,4 +53,4 @@ else fi echo "==> Running tests" -./gradlew --build-cache --parallel --no-daemon test +./gradlew test