Skip to content

Commit f2608bb

Browse files
Merge pull request #482 from openai/release-please--branches--main--changes--next
release: 2.2.0
2 parents 75f65c4 + c194405 commit f2608bb

File tree

236 files changed

+40
-94676
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

236 files changed

+40
-94676
lines changed

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "2.1.0"
2+
".": "2.2.0"
33
}

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 109
1+
configured_endpoints: 86
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-fc64d7c2c8f51f750813375356c3f3fdfc7fc1b1b34f19c20a5410279d445d37.yml
33
openapi_spec_hash: 618285fc70199ee32b9ebe4bf72f7e4c
4-
config_hash: c497f6b750cc89c0bf2eefc0bc839c70
4+
config_hash: 535b6e5f26a295d609b259c8cb8f656c

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,23 @@
11
# Changelog
22

3+
## 2.2.0 (2025-05-23)
4+
5+
Full Changelog: [v2.1.0...v2.2.0](https://github.com/openai/openai-java/compare/v2.1.0...v2.2.0)
6+
7+
### Features
8+
9+
* **api:** remove deprecated endpoints from Java client ([7b5acb5](https://github.com/openai/openai-java/commit/7b5acb54d52352521e86e7e0f6f878ca67a7b53e))
10+
11+
12+
### Bug Fixes
13+
14+
* **examples:** remove old examples ([8fe838c](https://github.com/openai/openai-java/commit/8fe838cdade6fb04aba70ae82bab0e81d061ca43))
15+
16+
17+
### Chores
18+
19+
* **internal:** fix release workflows ([c66f725](https://github.com/openai/openai-java/commit/c66f7258d8df4000b1013aa35140bef50de852fe))
20+
321
## 2.1.0 (2025-05-22)
422

523
Full Changelog: [v2.0.0...v2.1.0](https://github.com/openai/openai-java/compare/v2.0.0...v2.1.0)

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22

33
<!-- x-release-please-start-version -->
44

5-
[![Maven Central](https://img.shields.io/maven-central/v/com.openai/openai-java)](https://central.sonatype.com/artifact/com.openai/openai-java/2.1.0)
6-
[![javadoc](https://javadoc.io/badge2/com.openai/openai-java/2.1.0/javadoc.svg)](https://javadoc.io/doc/com.openai/openai-java/2.1.0)
5+
[![Maven Central](https://img.shields.io/maven-central/v/com.openai/openai-java)](https://central.sonatype.com/artifact/com.openai/openai-java/2.2.0)
6+
[![javadoc](https://javadoc.io/badge2/com.openai/openai-java/2.2.0/javadoc.svg)](https://javadoc.io/doc/com.openai/openai-java/2.2.0)
77

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

1010
The OpenAI Java SDK provides convenient access to the [OpenAI REST API](https://platform.openai.com/docs) from applications written in Java.
1111

1212
<!-- x-release-please-start-version -->
1313

14-
The REST API documentation can be found on [platform.openai.com](https://platform.openai.com/docs). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.openai/openai-java/2.1.0).
14+
The REST API documentation can be found on [platform.openai.com](https://platform.openai.com/docs). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.openai/openai-java/2.2.0).
1515

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

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

2424
```kotlin
25-
implementation("com.openai:openai-java:2.1.0")
25+
implementation("com.openai:openai-java:2.2.0")
2626
```
2727

2828
### Maven
@@ -31,7 +31,7 @@ implementation("com.openai:openai-java:2.1.0")
3131
<dependency>
3232
<groupId>com.openai</groupId>
3333
<artifactId>openai-java</artifactId>
34-
<version>2.1.0</version>
34+
<version>2.2.0</version>
3535
</dependency>
3636
```
3737

bin/check-release-environment

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
errors=()
44

5+
if [ -z "${STAINLESS_API_KEY}" ]; then
6+
errors+=("The STAINLESS_API_KEY secret has not been set. Please contact Stainless for an API key & set it in your organization secrets on GitHub.")
7+
fi
8+
59
if [ -z "${SONATYPE_USERNAME}" ]; then
610
errors+=("The OPENAI_SONATYPE_USERNAME secret has not been set. Please set it in either this repository's secrets or your organization secrets")
711
fi

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ repositories {
88

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

1414
subprojects {

openai-java-core/src/main/kotlin/com/openai/core/handlers/SseHandler.kt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,9 @@ private class SseState(
133133
}
134134

135135
@JvmSynthetic
136-
internal inline fun <reified T> Handler<StreamResponse<SseMessage>>.mapJson(
137-
includeEventAndData: Boolean = false
138-
): Handler<StreamResponse<T>> =
136+
internal inline fun <reified T> Handler<StreamResponse<SseMessage>>.mapJson():
137+
Handler<StreamResponse<T>> =
139138
object : Handler<StreamResponse<T>> {
140139
override fun handle(response: HttpResponse): StreamResponse<T> =
141-
this@mapJson.handle(response).map { it.json<T>(includeEventAndData) }
140+
this@mapJson.handle(response).map { it.json<T>() }
142141
}

openai-java-core/src/main/kotlin/com/openai/core/http/SseMessage.kt

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,21 +41,12 @@ private constructor(
4141
fun build(): SseMessage = SseMessage(jsonMapper!!, event, data, id, retry)
4242
}
4343

44-
inline fun <reified T> json(includeEventAndData: Boolean = false): T {
45-
var jsonNode = jsonNode
46-
if (includeEventAndData) {
47-
val newJsonNode = jsonMapper.createObjectNode()
48-
event?.let { newJsonNode.put("event", event) }
49-
newJsonNode.replace("data", jsonNode)
50-
jsonNode = newJsonNode
51-
}
52-
44+
inline fun <reified T> json(): T =
5345
try {
54-
return jsonMapper.readerFor(jacksonTypeRef<T>()).readValue(jsonNode)
46+
jsonMapper.readerFor(jacksonTypeRef<T>()).readValue(jsonNode)
5547
} catch (e: Exception) {
5648
throw OpenAIInvalidDataException("Error reading response", e)
5749
}
58-
}
5950

6051
private val jsonNode by lazy {
6152
try {

0 commit comments

Comments
 (0)