Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release: 0.11.3 #107

Merged
merged 7 commits into from
Jan 14, 2025
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.11.2"
".": "0.11.3"
}
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
# Changelog

## 0.11.3 (2025-01-14)

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

### Bug Fixes

* **streaming:** support assistants ([#106](https://github.com/openai/openai-java/issues/106)) ([bebfa9c](https://github.com/openai/openai-java/commit/bebfa9c39172655e76c7c3fea45757eef705e931))


### Chores

* **internal:** fix up root `build.gradle.kts` formatting ([#109](https://github.com/openai/openai-java/issues/109)) ([54a806f](https://github.com/openai/openai-java/commit/54a806fa6bdd9ff4ef0957324cc36380241c6b82))
* **internal:** remove unused Gradle imports ([#110](https://github.com/openai/openai-java/issues/110)) ([22502eb](https://github.com/openai/openai-java/commit/22502eb53d52a35237ea364d5d8c89bc1ced62bd))
* **internal:** remove unused or unnecessary Gradle imports ([#111](https://github.com/openai/openai-java/issues/111)) ([8d95893](https://github.com/openai/openai-java/commit/8d95893e22b7f55bc65bad3cafcb0bf78569fd83))
* **tests:** add more tests for streaming ([#108](https://github.com/openai/openai-java/issues/108)) ([5dec143](https://github.com/openai/openai-java/commit/5dec143db64f4efd3c1f3f1cd55d1fdee280d695))


### Documentation

* publish dokka javadoc ([#112](https://github.com/openai/openai-java/issues/112)) ([5521ffc](https://github.com/openai/openai-java/commit/5521ffc83b4a2adae49e9a226c5c745e64bbbc56))

## 0.11.2 (2025-01-10)

Full Changelog: [v0.11.1...v0.11.2](https://github.com/openai/openai-java/compare/v0.11.1...v0.11.2)
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<!-- 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.11.2)
[![Maven Central](https://img.shields.io/maven-central/v/com.openai/openai-java)](https://central.sonatype.com/artifact/com.openai/openai-java/0.11.3)

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

Expand All @@ -32,7 +32,7 @@ The REST API documentation can be found on [platform.openai.com](https://platfo
<!-- x-release-please-start-version -->

```kotlin
implementation("com.openai:openai-java:0.11.2")
implementation("com.openai:openai-java:0.11.3")
```

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

Expand Down
12 changes: 10 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
plugins {

id("org.jetbrains.dokka") version "2.0.0"
}

allprojects {
group = "com.openai"
version = "0.11.2" // x-release-please-version
version = "0.11.3" // x-release-please-version
}

subprojects {
apply(plugin = "org.jetbrains.dokka")
}

tasks.register<Jar>("dokkaJavadocJar") {
dependsOn(tasks.dokkaJavadoc)
from(tasks.dokkaJavadoc.flatMap { it.outputDirectory })
archiveClassifier.set("javadoc")
}
4 changes: 0 additions & 4 deletions buildSrc/src/main/kotlin/openai.java.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import com.diffplug.gradle.spotless.SpotlessExtension
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import com.vanniktech.maven.publish.JavaLibrary
import com.vanniktech.maven.publish.JavadocJar
import com.vanniktech.maven.publish.MavenPublishBaseExtension
import com.vanniktech.maven.publish.SonatypeHost

plugins {
`java-library`
Expand Down
1 change: 0 additions & 1 deletion buildSrc/src/main/kotlin/openai.kotlin.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import com.diffplug.gradle.spotless.SpotlessExtension
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import com.vanniktech.maven.publish.*

plugins {
id("openai.java")
Expand Down
15 changes: 8 additions & 7 deletions buildSrc/src/main/kotlin/openai.publish.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
import org.gradle.api.publish.PublishingExtension
import org.gradle.api.publish.maven.MavenPublication
import org.gradle.kotlin.dsl.configure
import org.gradle.kotlin.dsl.register
import org.gradle.kotlin.dsl.get
import com.vanniktech.maven.publish.JavaLibrary
import com.vanniktech.maven.publish.JavadocJar
import com.vanniktech.maven.publish.KotlinJvm
import com.vanniktech.maven.publish.MavenPublishBaseExtension
import com.vanniktech.maven.publish.SonatypeHost

Expand All @@ -25,7 +20,13 @@ configure<MavenPublishBaseExtension> {
signAllPublications()
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL)

this.coordinates(project.group.toString(), project.name, project.version.toString())
coordinates(project.group.toString(), project.name, project.version.toString())
configure(
KotlinJvm(
javadocJar = JavadocJar.Dokka("dokkaJavadoc"),
sourcesJar = true,
)
)

pom {
name.set("OpenAI API")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,27 +39,21 @@ internal fun sseHandler(jsonMapper: JsonMapper): Handler<StreamResponse<SseMessa
continue
}

if (message.event == null) {
val error =
message
.json<JsonValue>()
.asObject()
.getOrNull()
?.get("error")
if (error != null) {
val errorMessage =
error.asString().getOrNull()
?: error
.asObject()
.getOrNull()
?.get("message")
?.asString()
?.getOrNull()
?: "An error occurred during streaming"
throw OpenAIException(errorMessage)
}
yield(message)
val error =
message.json<JsonValue>().asObject().getOrNull()?.get("error")
if (error != null) {
val errorMessage =
error.asString().getOrNull()
?: error
.asObject()
.getOrNull()
?.get("message")
?.asString()
?.getOrNull()
?: "An error occurred during streaming"
throw OpenAIException(errorMessage)
}
yield(message)
}
}
}
Expand Down
Loading