Skip to content

Commit 88c8149

Browse files
release: 0.29.0 (#250)
* feat(client): allow omitting params object when none required (#249) * chore(internal): remove unused variable (#251) * fix(client): add missing `@JvmStatic` (#252) * docs: switch to `.list()` without arguments in examples * release: 0.29.0 --------- Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com> Co-authored-by: Tomer Aberbach <[email protected]>
1 parent 4e73a94 commit 88c8149

35 files changed

+127
-56
lines changed

.release-please-manifest.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.28.0"
2+
".": "0.29.0"
33
}

CHANGELOG.md

+23
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,28 @@
11
# Changelog
22

3+
## 0.29.0 (2025-02-26)
4+
5+
Full Changelog: [v0.28.0...v0.29.0](https://github.com/openai/openai-java/compare/v0.28.0...v0.29.0)
6+
7+
### Features
8+
9+
* **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))
10+
11+
12+
### Bug Fixes
13+
14+
* **client:** add missing `@JvmStatic` ([#252](https://github.com/openai/openai-java/issues/252)) ([06231c2](https://github.com/openai/openai-java/commit/06231c26727f09fd2065f2ebe9670b8149fcee84))
15+
16+
17+
### Chores
18+
19+
* **internal:** remove unused variable ([#251](https://github.com/openai/openai-java/issues/251)) ([b41bc4e](https://github.com/openai/openai-java/commit/b41bc4ebbe38a216e1276e0b15fd3fe54fe37353))
20+
21+
22+
### Documentation
23+
24+
* switch to `.list()` without arguments in examples ([d1480f1](https://github.com/openai/openai-java/commit/d1480f1c85c0e2704c2095298525401b76cec2e5))
25+
326
## 0.28.0 (2025-02-24)
427

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

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
1010
<!-- x-release-please-start-version -->
1111

12-
[![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)
13-
[![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)
12+
[![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)
13+
[![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)
1414

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

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

2727
```kotlin
28-
implementation("com.openai:openai-java:0.28.0")
28+
implementation("com.openai:openai-java:0.29.0")
2929
```
3030

3131
### Maven
@@ -34,7 +34,7 @@ implementation("com.openai:openai-java:0.28.0")
3434
<dependency>
3535
<groupId>com.openai</groupId>
3636
<artifactId>openai-java</artifactId>
37-
<version>0.28.0</version>
37+
<version>0.29.0</version>
3838
</dependency>
3939
```
4040

build.gradle.kts

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ repositories {
88

99
allprojects {
1010
group = "com.openai"
11-
version = "0.28.0" // x-release-please-version
11+
version = "0.29.0" // x-release-please-version
1212
}
1313

1414
subprojects {

openai-java-core/src/main/kotlin/com/openai/models/BatchListParams.kt

+2
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ private constructor(
4949

5050
companion object {
5151

52+
@JvmStatic fun none(): BatchListParams = builder().build()
53+
5254
@JvmStatic fun builder() = Builder()
5355
}
5456

openai-java-core/src/main/kotlin/com/openai/models/BetaAssistantListParams.kt

+2
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ private constructor(
7070

7171
companion object {
7272

73+
@JvmStatic fun none(): BetaAssistantListParams = builder().build()
74+
7375
@JvmStatic fun builder() = Builder()
7476
}
7577

openai-java-core/src/main/kotlin/com/openai/models/BetaThreadCreateParams.kt

+2
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,8 @@ private constructor(
353353

354354
companion object {
355355

356+
@JvmStatic fun none(): BetaThreadCreateParams = builder().build()
357+
356358
@JvmStatic fun builder() = Builder()
357359
}
358360

openai-java-core/src/main/kotlin/com/openai/models/BetaVectorStoreListParams.kt

+2
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ private constructor(
7070

7171
companion object {
7272

73+
@JvmStatic fun none(): BetaVectorStoreListParams = builder().build()
74+
7375
@JvmStatic fun builder() = Builder()
7476
}
7577

openai-java-core/src/main/kotlin/com/openai/models/FileListParams.kt

+2
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ private constructor(
6666

6767
companion object {
6868

69+
@JvmStatic fun none(): FileListParams = builder().build()
70+
6971
@JvmStatic fun builder() = Builder()
7072
}
7173

openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobListParams.kt

+2
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ private constructor(
4242

4343
companion object {
4444

45+
@JvmStatic fun none(): FineTuningJobListParams = builder().build()
46+
4547
@JvmStatic fun builder() = Builder()
4648
}
4749

openai-java-core/src/main/kotlin/com/openai/models/ModelListParams.kt

+2
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ private constructor(
3030

3131
companion object {
3232

33+
@JvmStatic fun none(): ModelListParams = builder().build()
34+
3335
@JvmStatic fun builder() = Builder()
3436
}
3537

openai-java-core/src/main/kotlin/com/openai/services/async/BatchServiceAsync.kt

+5-1
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,14 @@ interface BatchServiceAsync {
3232
/** List your organization's batches. */
3333
@JvmOverloads
3434
fun list(
35-
params: BatchListParams,
35+
params: BatchListParams = BatchListParams.none(),
3636
requestOptions: RequestOptions = RequestOptions.none(),
3737
): CompletableFuture<BatchListPageAsync>
3838

39+
/** List your organization's batches. */
40+
fun list(requestOptions: RequestOptions): CompletableFuture<BatchListPageAsync> =
41+
list(BatchListParams.none(), requestOptions)
42+
3943
/**
4044
* Cancels an in-progress batch. The batch will be in status `cancelling` for up to 10 minutes,
4145
* before changing to `cancelled`, where it will have partial results (if any) available in the

openai-java-core/src/main/kotlin/com/openai/services/async/BetaServiceAsyncImpl.kt

-6
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
package com.openai.services.async
44

55
import com.openai.core.ClientOptions
6-
import com.openai.core.http.Headers
76
import com.openai.services.async.beta.AssistantServiceAsync
87
import com.openai.services.async.beta.AssistantServiceAsyncImpl
98
import com.openai.services.async.beta.ThreadServiceAsync
@@ -14,11 +13,6 @@ import com.openai.services.async.beta.VectorStoreServiceAsyncImpl
1413
class BetaServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) :
1514
BetaServiceAsync {
1615

17-
companion object {
18-
19-
private val DEFAULT_HEADERS = Headers.builder().put("OpenAI-Beta", "assistants=v2").build()
20-
}
21-
2216
private val vectorStores: VectorStoreServiceAsync by lazy {
2317
VectorStoreServiceAsyncImpl(clientOptions)
2418
}

openai-java-core/src/main/kotlin/com/openai/services/async/FileServiceAsync.kt

+5-1
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,14 @@ interface FileServiceAsync {
2828
/** Returns a list of files. */
2929
@JvmOverloads
3030
fun list(
31-
params: FileListParams,
31+
params: FileListParams = FileListParams.none(),
3232
requestOptions: RequestOptions = RequestOptions.none(),
3333
): CompletableFuture<FileListPageAsync>
3434

35+
/** Returns a list of files. */
36+
fun list(requestOptions: RequestOptions): CompletableFuture<FileListPageAsync> =
37+
list(FileListParams.none(), requestOptions)
38+
3539
/** Delete a file. */
3640
@JvmOverloads
3741
fun delete(

openai-java-core/src/main/kotlin/com/openai/services/async/ModelServiceAsync.kt

+8-1
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,17 @@ interface ModelServiceAsync {
3131
*/
3232
@JvmOverloads
3333
fun list(
34-
params: ModelListParams,
34+
params: ModelListParams = ModelListParams.none(),
3535
requestOptions: RequestOptions = RequestOptions.none(),
3636
): CompletableFuture<ModelListPageAsync>
3737

38+
/**
39+
* Lists the currently available models, and provides basic information about each one such as
40+
* the owner and availability.
41+
*/
42+
fun list(requestOptions: RequestOptions): CompletableFuture<ModelListPageAsync> =
43+
list(ModelListParams.none(), requestOptions)
44+
3845
/**
3946
* Delete a fine-tuned model. You must have the Owner role in your organization to delete a
4047
* model.

openai-java-core/src/main/kotlin/com/openai/services/async/beta/AssistantServiceAsync.kt

+5-1
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,14 @@ interface AssistantServiceAsync {
4141
/** Returns a list of assistants. */
4242
@JvmOverloads
4343
fun list(
44-
params: BetaAssistantListParams,
44+
params: BetaAssistantListParams = BetaAssistantListParams.none(),
4545
requestOptions: RequestOptions = RequestOptions.none(),
4646
): CompletableFuture<BetaAssistantListPageAsync>
4747

48+
/** Returns a list of assistants. */
49+
fun list(requestOptions: RequestOptions): CompletableFuture<BetaAssistantListPageAsync> =
50+
list(BetaAssistantListParams.none(), requestOptions)
51+
4852
/** Delete an assistant. */
4953
@JvmOverloads
5054
fun delete(

openai-java-core/src/main/kotlin/com/openai/services/async/beta/ThreadServiceAsync.kt

+5-1
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,14 @@ interface ThreadServiceAsync {
2828
/** Create a thread. */
2929
@JvmOverloads
3030
fun create(
31-
params: BetaThreadCreateParams,
31+
params: BetaThreadCreateParams = BetaThreadCreateParams.none(),
3232
requestOptions: RequestOptions = RequestOptions.none(),
3333
): CompletableFuture<Thread>
3434

35+
/** Create a thread. */
36+
fun create(requestOptions: RequestOptions): CompletableFuture<Thread> =
37+
create(BetaThreadCreateParams.none(), requestOptions)
38+
3539
/** Retrieves a thread. */
3640
@JvmOverloads
3741
fun retrieve(

openai-java-core/src/main/kotlin/com/openai/services/async/beta/VectorStoreServiceAsync.kt

+5-1
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,14 @@ interface VectorStoreServiceAsync {
4747
/** Returns a list of vector stores. */
4848
@JvmOverloads
4949
fun list(
50-
params: BetaVectorStoreListParams,
50+
params: BetaVectorStoreListParams = BetaVectorStoreListParams.none(),
5151
requestOptions: RequestOptions = RequestOptions.none(),
5252
): CompletableFuture<BetaVectorStoreListPageAsync>
5353

54+
/** Returns a list of vector stores. */
55+
fun list(requestOptions: RequestOptions): CompletableFuture<BetaVectorStoreListPageAsync> =
56+
list(BetaVectorStoreListParams.none(), requestOptions)
57+
5458
/** Delete a vector store. */
5559
@JvmOverloads
5660
fun delete(

openai-java-core/src/main/kotlin/com/openai/services/async/fineTuning/JobServiceAsync.kt

+5-1
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,14 @@ interface JobServiceAsync {
4949
/** List your organization's fine-tuning jobs */
5050
@JvmOverloads
5151
fun list(
52-
params: FineTuningJobListParams,
52+
params: FineTuningJobListParams = FineTuningJobListParams.none(),
5353
requestOptions: RequestOptions = RequestOptions.none(),
5454
): CompletableFuture<FineTuningJobListPageAsync>
5555

56+
/** List your organization's fine-tuning jobs */
57+
fun list(requestOptions: RequestOptions): CompletableFuture<FineTuningJobListPageAsync> =
58+
list(FineTuningJobListParams.none(), requestOptions)
59+
5660
/** Immediately cancel a fine-tune job. */
5761
@JvmOverloads
5862
fun cancel(

openai-java-core/src/main/kotlin/com/openai/services/blocking/BatchService.kt

+5-1
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,14 @@ interface BatchService {
3131
/** List your organization's batches. */
3232
@JvmOverloads
3333
fun list(
34-
params: BatchListParams,
34+
params: BatchListParams = BatchListParams.none(),
3535
requestOptions: RequestOptions = RequestOptions.none(),
3636
): BatchListPage
3737

38+
/** List your organization's batches. */
39+
fun list(requestOptions: RequestOptions): BatchListPage =
40+
list(BatchListParams.none(), requestOptions)
41+
3842
/**
3943
* Cancels an in-progress batch. The batch will be in status `cancelling` for up to 10 minutes,
4044
* before changing to `cancelled`, where it will have partial results (if any) available in the

openai-java-core/src/main/kotlin/com/openai/services/blocking/BetaServiceImpl.kt

-6
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
package com.openai.services.blocking
44

55
import com.openai.core.ClientOptions
6-
import com.openai.core.http.Headers
76
import com.openai.services.blocking.beta.AssistantService
87
import com.openai.services.blocking.beta.AssistantServiceImpl
98
import com.openai.services.blocking.beta.ThreadService
@@ -13,11 +12,6 @@ import com.openai.services.blocking.beta.VectorStoreServiceImpl
1312

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

16-
companion object {
17-
18-
private val DEFAULT_HEADERS = Headers.builder().put("OpenAI-Beta", "assistants=v2").build()
19-
}
20-
2115
private val vectorStores: VectorStoreService by lazy { VectorStoreServiceImpl(clientOptions) }
2216

2317
private val assistants: AssistantService by lazy { AssistantServiceImpl(clientOptions) }

openai-java-core/src/main/kotlin/com/openai/services/blocking/FileService.kt

+5-1
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,14 @@ interface FileService {
2727
/** Returns a list of files. */
2828
@JvmOverloads
2929
fun list(
30-
params: FileListParams,
30+
params: FileListParams = FileListParams.none(),
3131
requestOptions: RequestOptions = RequestOptions.none(),
3232
): FileListPage
3333

34+
/** Returns a list of files. */
35+
fun list(requestOptions: RequestOptions): FileListPage =
36+
list(FileListParams.none(), requestOptions)
37+
3438
/** Delete a file. */
3539
@JvmOverloads
3640
fun delete(

openai-java-core/src/main/kotlin/com/openai/services/blocking/ModelService.kt

+8-1
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,17 @@ interface ModelService {
3030
*/
3131
@JvmOverloads
3232
fun list(
33-
params: ModelListParams,
33+
params: ModelListParams = ModelListParams.none(),
3434
requestOptions: RequestOptions = RequestOptions.none(),
3535
): ModelListPage
3636

37+
/**
38+
* Lists the currently available models, and provides basic information about each one such as
39+
* the owner and availability.
40+
*/
41+
fun list(requestOptions: RequestOptions): ModelListPage =
42+
list(ModelListParams.none(), requestOptions)
43+
3744
/**
3845
* Delete a fine-tuned model. You must have the Owner role in your organization to delete a
3946
* model.

openai-java-core/src/main/kotlin/com/openai/services/blocking/beta/AssistantService.kt

+5-1
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,14 @@ interface AssistantService {
4040
/** Returns a list of assistants. */
4141
@JvmOverloads
4242
fun list(
43-
params: BetaAssistantListParams,
43+
params: BetaAssistantListParams = BetaAssistantListParams.none(),
4444
requestOptions: RequestOptions = RequestOptions.none(),
4545
): BetaAssistantListPage
4646

47+
/** Returns a list of assistants. */
48+
fun list(requestOptions: RequestOptions): BetaAssistantListPage =
49+
list(BetaAssistantListParams.none(), requestOptions)
50+
4751
/** Delete an assistant. */
4852
@JvmOverloads
4953
fun delete(

openai-java-core/src/main/kotlin/com/openai/services/blocking/beta/ThreadService.kt

+5-1
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,14 @@ interface ThreadService {
2828
/** Create a thread. */
2929
@JvmOverloads
3030
fun create(
31-
params: BetaThreadCreateParams,
31+
params: BetaThreadCreateParams = BetaThreadCreateParams.none(),
3232
requestOptions: RequestOptions = RequestOptions.none(),
3333
): Thread
3434

35+
/** Create a thread. */
36+
fun create(requestOptions: RequestOptions): Thread =
37+
create(BetaThreadCreateParams.none(), requestOptions)
38+
3539
/** Retrieves a thread. */
3640
@JvmOverloads
3741
fun retrieve(

openai-java-core/src/main/kotlin/com/openai/services/blocking/beta/VectorStoreService.kt

+5-1
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,14 @@ interface VectorStoreService {
4646
/** Returns a list of vector stores. */
4747
@JvmOverloads
4848
fun list(
49-
params: BetaVectorStoreListParams,
49+
params: BetaVectorStoreListParams = BetaVectorStoreListParams.none(),
5050
requestOptions: RequestOptions = RequestOptions.none(),
5151
): BetaVectorStoreListPage
5252

53+
/** Returns a list of vector stores. */
54+
fun list(requestOptions: RequestOptions): BetaVectorStoreListPage =
55+
list(BetaVectorStoreListParams.none(), requestOptions)
56+
5357
/** Delete a vector store. */
5458
@JvmOverloads
5559
fun delete(

0 commit comments

Comments
 (0)