Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.28.0"
".": "0.29.0"
}
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
# Changelog

## 0.29.0 (2025-02-26)

Full Changelog: [v0.28.0...v0.29.0](https://github.com/openai/openai-java/compare/v0.28.0...v0.29.0)

### Features

* **client:** allow omitting params object when none required ([#249](https://github.com/openai/openai-java/issues/249)) ([e77a6c3](https://github.com/openai/openai-java/commit/e77a6c35a1940bd6f1ef37f08a524974b28f17ac))


### Bug Fixes

* **client:** add missing `@JvmStatic` ([#252](https://github.com/openai/openai-java/issues/252)) ([06231c2](https://github.com/openai/openai-java/commit/06231c26727f09fd2065f2ebe9670b8149fcee84))


### Chores

* **internal:** remove unused variable ([#251](https://github.com/openai/openai-java/issues/251)) ([b41bc4e](https://github.com/openai/openai-java/commit/b41bc4ebbe38a216e1276e0b15fd3fe54fe37353))


### Documentation

* switch to `.list()` without arguments in examples ([d1480f1](https://github.com/openai/openai-java/commit/d1480f1c85c0e2704c2095298525401b76cec2e5))

## 0.28.0 (2025-02-24)

Full Changelog: [v0.27.0...v0.28.0](https://github.com/openai/openai-java/compare/v0.27.0...v0.28.0)
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
<!-- x-release-please-start-version -->

[![Maven Central](https://img.shields.io/maven-central/v/com.openai/openai-java)](https://central.sonatype.com/artifact/com.openai/openai-java/0.28.0)
[![javadoc](https://javadoc.io/badge2/com.openai/openai-java/0.28.0/javadoc.svg)](https://javadoc.io/doc/com.openai/openai-java/0.28.0)
[![Maven Central](https://img.shields.io/maven-central/v/com.openai/openai-java)](https://central.sonatype.com/artifact/com.openai/openai-java/0.29.0)
[![javadoc](https://javadoc.io/badge2/com.openai/openai-java/0.29.0/javadoc.svg)](https://javadoc.io/doc/com.openai/openai-java/0.29.0)

<!-- x-release-please-end -->

Expand All @@ -25,7 +25,7 @@ The REST API documentation can be found on [platform.openai.com](https://platfor
### Gradle

```kotlin
implementation("com.openai:openai-java:0.28.0")
implementation("com.openai:openai-java:0.29.0")
```

### Maven
Expand All @@ -34,7 +34,7 @@ implementation("com.openai:openai-java:0.28.0")
<dependency>
<groupId>com.openai</groupId>
<artifactId>openai-java</artifactId>
<version>0.28.0</version>
<version>0.29.0</version>
</dependency>
```

Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ repositories {

allprojects {
group = "com.openai"
version = "0.28.0" // x-release-please-version
version = "0.29.0" // x-release-please-version
}

subprojects {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ private constructor(

companion object {

@JvmStatic fun none(): BatchListParams = builder().build()

@JvmStatic fun builder() = Builder()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ private constructor(

companion object {

@JvmStatic fun none(): BetaAssistantListParams = builder().build()

@JvmStatic fun builder() = Builder()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,8 @@ private constructor(

companion object {

@JvmStatic fun none(): BetaThreadCreateParams = builder().build()

@JvmStatic fun builder() = Builder()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ private constructor(

companion object {

@JvmStatic fun none(): BetaVectorStoreListParams = builder().build()

@JvmStatic fun builder() = Builder()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ private constructor(

companion object {

@JvmStatic fun none(): FileListParams = builder().build()

@JvmStatic fun builder() = Builder()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ private constructor(

companion object {

@JvmStatic fun none(): FineTuningJobListParams = builder().build()

@JvmStatic fun builder() = Builder()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ private constructor(

companion object {

@JvmStatic fun none(): ModelListParams = builder().build()

@JvmStatic fun builder() = Builder()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,14 @@ interface BatchServiceAsync {
/** List your organization's batches. */
@JvmOverloads
fun list(
params: BatchListParams,
params: BatchListParams = BatchListParams.none(),
requestOptions: RequestOptions = RequestOptions.none(),
): CompletableFuture<BatchListPageAsync>

/** List your organization's batches. */
fun list(requestOptions: RequestOptions): CompletableFuture<BatchListPageAsync> =
list(BatchListParams.none(), requestOptions)

/**
* Cancels an in-progress batch. The batch will be in status `cancelling` for up to 10 minutes,
* before changing to `cancelled`, where it will have partial results (if any) available in the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
package com.openai.services.async

import com.openai.core.ClientOptions
import com.openai.core.http.Headers
import com.openai.services.async.beta.AssistantServiceAsync
import com.openai.services.async.beta.AssistantServiceAsyncImpl
import com.openai.services.async.beta.ThreadServiceAsync
Expand All @@ -14,11 +13,6 @@ import com.openai.services.async.beta.VectorStoreServiceAsyncImpl
class BetaServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) :
BetaServiceAsync {

companion object {

private val DEFAULT_HEADERS = Headers.builder().put("OpenAI-Beta", "assistants=v2").build()
}

private val vectorStores: VectorStoreServiceAsync by lazy {
VectorStoreServiceAsyncImpl(clientOptions)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,14 @@ interface FileServiceAsync {
/** Returns a list of files. */
@JvmOverloads
fun list(
params: FileListParams,
params: FileListParams = FileListParams.none(),
requestOptions: RequestOptions = RequestOptions.none(),
): CompletableFuture<FileListPageAsync>

/** Returns a list of files. */
fun list(requestOptions: RequestOptions): CompletableFuture<FileListPageAsync> =
list(FileListParams.none(), requestOptions)

/** Delete a file. */
@JvmOverloads
fun delete(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,17 @@ interface ModelServiceAsync {
*/
@JvmOverloads
fun list(
params: ModelListParams,
params: ModelListParams = ModelListParams.none(),
requestOptions: RequestOptions = RequestOptions.none(),
): CompletableFuture<ModelListPageAsync>

/**
* Lists the currently available models, and provides basic information about each one such as
* the owner and availability.
*/
fun list(requestOptions: RequestOptions): CompletableFuture<ModelListPageAsync> =
list(ModelListParams.none(), requestOptions)

/**
* Delete a fine-tuned model. You must have the Owner role in your organization to delete a
* model.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,14 @@ interface AssistantServiceAsync {
/** Returns a list of assistants. */
@JvmOverloads
fun list(
params: BetaAssistantListParams,
params: BetaAssistantListParams = BetaAssistantListParams.none(),
requestOptions: RequestOptions = RequestOptions.none(),
): CompletableFuture<BetaAssistantListPageAsync>

/** Returns a list of assistants. */
fun list(requestOptions: RequestOptions): CompletableFuture<BetaAssistantListPageAsync> =
list(BetaAssistantListParams.none(), requestOptions)

/** Delete an assistant. */
@JvmOverloads
fun delete(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,14 @@ interface ThreadServiceAsync {
/** Create a thread. */
@JvmOverloads
fun create(
params: BetaThreadCreateParams,
params: BetaThreadCreateParams = BetaThreadCreateParams.none(),
requestOptions: RequestOptions = RequestOptions.none(),
): CompletableFuture<Thread>

/** Create a thread. */
fun create(requestOptions: RequestOptions): CompletableFuture<Thread> =
create(BetaThreadCreateParams.none(), requestOptions)

/** Retrieves a thread. */
@JvmOverloads
fun retrieve(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,14 @@ interface VectorStoreServiceAsync {
/** Returns a list of vector stores. */
@JvmOverloads
fun list(
params: BetaVectorStoreListParams,
params: BetaVectorStoreListParams = BetaVectorStoreListParams.none(),
requestOptions: RequestOptions = RequestOptions.none(),
): CompletableFuture<BetaVectorStoreListPageAsync>

/** Returns a list of vector stores. */
fun list(requestOptions: RequestOptions): CompletableFuture<BetaVectorStoreListPageAsync> =
list(BetaVectorStoreListParams.none(), requestOptions)

/** Delete a vector store. */
@JvmOverloads
fun delete(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,14 @@ interface JobServiceAsync {
/** List your organization's fine-tuning jobs */
@JvmOverloads
fun list(
params: FineTuningJobListParams,
params: FineTuningJobListParams = FineTuningJobListParams.none(),
requestOptions: RequestOptions = RequestOptions.none(),
): CompletableFuture<FineTuningJobListPageAsync>

/** List your organization's fine-tuning jobs */
fun list(requestOptions: RequestOptions): CompletableFuture<FineTuningJobListPageAsync> =
list(FineTuningJobListParams.none(), requestOptions)

/** Immediately cancel a fine-tune job. */
@JvmOverloads
fun cancel(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,14 @@ interface BatchService {
/** List your organization's batches. */
@JvmOverloads
fun list(
params: BatchListParams,
params: BatchListParams = BatchListParams.none(),
requestOptions: RequestOptions = RequestOptions.none(),
): BatchListPage

/** List your organization's batches. */
fun list(requestOptions: RequestOptions): BatchListPage =
list(BatchListParams.none(), requestOptions)

/**
* Cancels an in-progress batch. The batch will be in status `cancelling` for up to 10 minutes,
* before changing to `cancelled`, where it will have partial results (if any) available in the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
package com.openai.services.blocking

import com.openai.core.ClientOptions
import com.openai.core.http.Headers
import com.openai.services.blocking.beta.AssistantService
import com.openai.services.blocking.beta.AssistantServiceImpl
import com.openai.services.blocking.beta.ThreadService
Expand All @@ -13,11 +12,6 @@ import com.openai.services.blocking.beta.VectorStoreServiceImpl

class BetaServiceImpl internal constructor(private val clientOptions: ClientOptions) : BetaService {

companion object {

private val DEFAULT_HEADERS = Headers.builder().put("OpenAI-Beta", "assistants=v2").build()
}

private val vectorStores: VectorStoreService by lazy { VectorStoreServiceImpl(clientOptions) }

private val assistants: AssistantService by lazy { AssistantServiceImpl(clientOptions) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,14 @@ interface FileService {
/** Returns a list of files. */
@JvmOverloads
fun list(
params: FileListParams,
params: FileListParams = FileListParams.none(),
requestOptions: RequestOptions = RequestOptions.none(),
): FileListPage

/** Returns a list of files. */
fun list(requestOptions: RequestOptions): FileListPage =
list(FileListParams.none(), requestOptions)

/** Delete a file. */
@JvmOverloads
fun delete(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,17 @@ interface ModelService {
*/
@JvmOverloads
fun list(
params: ModelListParams,
params: ModelListParams = ModelListParams.none(),
requestOptions: RequestOptions = RequestOptions.none(),
): ModelListPage

/**
* Lists the currently available models, and provides basic information about each one such as
* the owner and availability.
*/
fun list(requestOptions: RequestOptions): ModelListPage =
list(ModelListParams.none(), requestOptions)

/**
* Delete a fine-tuned model. You must have the Owner role in your organization to delete a
* model.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,14 @@ interface AssistantService {
/** Returns a list of assistants. */
@JvmOverloads
fun list(
params: BetaAssistantListParams,
params: BetaAssistantListParams = BetaAssistantListParams.none(),
requestOptions: RequestOptions = RequestOptions.none(),
): BetaAssistantListPage

/** Returns a list of assistants. */
fun list(requestOptions: RequestOptions): BetaAssistantListPage =
list(BetaAssistantListParams.none(), requestOptions)

/** Delete an assistant. */
@JvmOverloads
fun delete(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,14 @@ interface ThreadService {
/** Create a thread. */
@JvmOverloads
fun create(
params: BetaThreadCreateParams,
params: BetaThreadCreateParams = BetaThreadCreateParams.none(),
requestOptions: RequestOptions = RequestOptions.none(),
): Thread

/** Create a thread. */
fun create(requestOptions: RequestOptions): Thread =
create(BetaThreadCreateParams.none(), requestOptions)

/** Retrieves a thread. */
@JvmOverloads
fun retrieve(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,14 @@ interface VectorStoreService {
/** Returns a list of vector stores. */
@JvmOverloads
fun list(
params: BetaVectorStoreListParams,
params: BetaVectorStoreListParams = BetaVectorStoreListParams.none(),
requestOptions: RequestOptions = RequestOptions.none(),
): BetaVectorStoreListPage

/** Returns a list of vector stores. */
fun list(requestOptions: RequestOptions): BetaVectorStoreListPage =
list(BetaVectorStoreListParams.none(), requestOptions)

/** Delete a vector store. */
@JvmOverloads
fun delete(
Expand Down
Loading