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.2.0"
".": "0.3.0"
}
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 24
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-fb9db2d2c1f0d6b39d8ee042db5d5c59acba6ad1daf47c18792c1f5fb24b3401.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-aa9b01fc0c17eb0cbc200533fc20d6a49c5e764ceaf8049e08b294532be6e9ff.yml
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Changelog

## 0.3.0 (2024-11-20)

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

### Features

* **api:** add gpt-4o-2024-11-20 model ([#13](https://github.com/openai/openai-java/issues/13)) ([3263126](https://github.com/openai/openai-java/commit/3263126a59cb63be0b6842fa16b0466feb71d44b))


### Styles

* **internal:** move identity methods to bottom of error class ([#12](https://github.com/openai/openai-java/issues/12)) ([f3ff42a](https://github.com/openai/openai-java/commit/f3ff42a3c4d3821949af7ad43e03dac8b061825b))
* **internal:** reduce verbosity of identity methods ([#10](https://github.com/openai/openai-java/issues/10)) ([9ef03ed](https://github.com/openai/openai-java/commit/9ef03eda541a878b4ef9df0c3845a63e1f9cc44d))

## 0.2.0 (2024-11-20)

Full Changelog: [v0.1.0...v0.2.0](https://github.com/openai/openai-java/compare/v0.1.0...v0.2.0)
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,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.2.0)
[![Maven Central](https://img.shields.io/maven-central/v/com.openai/openai-java)](https://central.sonatype.com/artifact/com.openai/openai-java/0.3.0)

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

Expand All @@ -25,7 +25,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.2.0")
implementation("com.openai:openai-java:0.3.0")
```

#### Maven
Expand All @@ -34,7 +34,7 @@ implementation("com.openai:openai-java:0.2.0")
<dependency>
<groupId>com.openai</groupId>
<artifactId>openai-java</artifactId>
<version>0.2.0</version>
<version>0.3.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 @@ -4,7 +4,7 @@ plugins {

allprojects {
group = "com.openai"
version = "0.2.0" // x-release-please-version
version = "0.3.0" // x-release-please-version
}

nexusPublishing {
Expand Down
26 changes: 12 additions & 14 deletions openai-java-core/src/main/kotlin/com/openai/errors/OpenAIError.kt
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,6 @@ private constructor(
val additionalProperties: Map<String, JsonValue>,
) {

override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}

return /* spotless:off */ other is OpenAIError && this.additionalProperties == other.additionalProperties /* spotless:on */
}

override fun hashCode(): Int {
return /* spotless:off */ Objects.hash(additionalProperties) /* spotless:on */
}

override fun toString() = "OpenAIError{additionalProperties=$additionalProperties}"

fun toBuilder() = Builder().from(this)

companion object {
Expand Down Expand Up @@ -71,4 +57,16 @@ private constructor(

fun build(): OpenAIError = OpenAIError(additionalProperties.toImmutable())
}

override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}

return /* spotless:off */ other is OpenAIError && additionalProperties == other.additionalProperties /* spotless:on */
}

override fun hashCode(): Int = /* spotless:off */ Objects.hash(additionalProperties) /* spotless:on */

override fun toString() = "OpenAIError{additionalProperties=$additionalProperties}"
}
30 changes: 12 additions & 18 deletions openai-java-core/src/main/kotlin/com/openai/models/Batch.kt
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ private constructor(
return true
}

return /* spotless:off */ other is Object && this.value == other.value /* spotless:on */
return /* spotless:off */ other is Object && value == other.value /* spotless:on */
}

override fun hashCode() = value.hashCode()
Expand Down Expand Up @@ -522,7 +522,7 @@ private constructor(
return true
}

return /* spotless:off */ other is Status && this.value == other.value /* spotless:on */
return /* spotless:off */ other is Status && value == other.value /* spotless:on */
}

override fun hashCode() = value.hashCode()
Expand Down Expand Up @@ -696,17 +696,14 @@ private constructor(
return true
}

return /* spotless:off */ other is Errors && this.object_ == other.object_ && this.data == other.data && this.additionalProperties == other.additionalProperties /* spotless:on */
return /* spotless:off */ other is Errors && object_ == other.object_ && data == other.data && additionalProperties == other.additionalProperties /* spotless:on */
}

private var hashCode: Int = 0
/* spotless:off */
private val hashCode: Int by lazy { Objects.hash(object_, data, additionalProperties) }
/* spotless:on */

override fun hashCode(): Int {
if (hashCode == 0) {
hashCode = /* spotless:off */ Objects.hash(object_, data, additionalProperties) /* spotless:on */
}
return hashCode
}
override fun hashCode(): Int = hashCode

override fun toString() =
"Errors{object_=$object_, data=$data, additionalProperties=$additionalProperties}"
Expand All @@ -717,17 +714,14 @@ private constructor(
return true
}

return /* spotless:off */ other is Batch && this.id == other.id && this.object_ == other.object_ && this.endpoint == other.endpoint && this.errors == other.errors && this.inputFileId == other.inputFileId && this.completionWindow == other.completionWindow && this.status == other.status && this.outputFileId == other.outputFileId && this.errorFileId == other.errorFileId && this.createdAt == other.createdAt && this.inProgressAt == other.inProgressAt && this.expiresAt == other.expiresAt && this.finalizingAt == other.finalizingAt && this.completedAt == other.completedAt && this.failedAt == other.failedAt && this.expiredAt == other.expiredAt && this.cancellingAt == other.cancellingAt && this.cancelledAt == other.cancelledAt && this.requestCounts == other.requestCounts && this.metadata == other.metadata && this.additionalProperties == other.additionalProperties /* spotless:on */
return /* spotless:off */ other is Batch && id == other.id && object_ == other.object_ && endpoint == other.endpoint && errors == other.errors && inputFileId == other.inputFileId && completionWindow == other.completionWindow && status == other.status && outputFileId == other.outputFileId && errorFileId == other.errorFileId && createdAt == other.createdAt && inProgressAt == other.inProgressAt && expiresAt == other.expiresAt && finalizingAt == other.finalizingAt && completedAt == other.completedAt && failedAt == other.failedAt && expiredAt == other.expiredAt && cancellingAt == other.cancellingAt && cancelledAt == other.cancelledAt && requestCounts == other.requestCounts && metadata == other.metadata && additionalProperties == other.additionalProperties /* spotless:on */
}

private var hashCode: Int = 0
/* spotless:off */
private val hashCode: Int by lazy { Objects.hash(id, object_, endpoint, errors, inputFileId, completionWindow, status, outputFileId, errorFileId, createdAt, inProgressAt, expiresAt, finalizingAt, completedAt, failedAt, expiredAt, cancellingAt, cancelledAt, requestCounts, metadata, additionalProperties) }
/* spotless:on */

override fun hashCode(): Int {
if (hashCode == 0) {
hashCode = /* spotless:off */ Objects.hash(id, object_, endpoint, errors, inputFileId, completionWindow, status, outputFileId, errorFileId, createdAt, inProgressAt, expiresAt, finalizingAt, completedAt, failedAt, expiredAt, cancellingAt, cancelledAt, requestCounts, metadata, additionalProperties) /* spotless:on */
}
return hashCode
}
override fun hashCode(): Int = hashCode

override fun toString() =
"Batch{id=$id, object_=$object_, endpoint=$endpoint, errors=$errors, inputFileId=$inputFileId, completionWindow=$completionWindow, status=$status, outputFileId=$outputFileId, errorFileId=$errorFileId, createdAt=$createdAt, inProgressAt=$inProgressAt, expiresAt=$expiresAt, finalizingAt=$finalizingAt, completedAt=$completedAt, failedAt=$failedAt, expiredAt=$expiredAt, cancellingAt=$cancellingAt, cancelledAt=$cancelledAt, requestCounts=$requestCounts, metadata=$metadata, additionalProperties=$additionalProperties}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,10 @@ constructor(
return true
}

return /* spotless:off */ other is BatchCancelParams && this.batchId == other.batchId && this.additionalHeaders == other.additionalHeaders && this.additionalQueryParams == other.additionalQueryParams && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */
return /* spotless:off */ other is BatchCancelParams && batchId == other.batchId && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams && additionalBodyProperties == other.additionalBodyProperties /* spotless:on */
}

override fun hashCode(): Int {
return /* spotless:off */ Objects.hash(batchId, additionalHeaders, additionalQueryParams, additionalBodyProperties) /* spotless:on */
}
override fun hashCode(): Int = /* spotless:off */ Objects.hash(batchId, additionalHeaders, additionalQueryParams, additionalBodyProperties) /* spotless:on */

override fun toString() =
"BatchCancelParams{batchId=$batchId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ constructor(
* Your input file must be formatted as a
* [JSONL file](https://platform.openai.com/docs/api-reference/batch/request-input), and
* must be uploaded with the purpose `batch`. The file can contain up to 50,000 requests,
* and can be up to 100 MB in size.
* and can be up to 200 MB in size.
*/
@JsonProperty("input_file_id") fun inputFileId(): String? = inputFileId

Expand Down Expand Up @@ -151,7 +151,7 @@ constructor(
* Your input file must be formatted as a
* [JSONL file](https://platform.openai.com/docs/api-reference/batch/request-input), and
* must be uploaded with the purpose `batch`. The file can contain up to 50,000
* requests, and can be up to 100 MB in size.
* requests, and can be up to 200 MB in size.
*/
@JsonProperty("input_file_id")
fun inputFileId(inputFileId: String) = apply { this.inputFileId = inputFileId }
Expand Down Expand Up @@ -191,17 +191,14 @@ constructor(
return true
}

return /* spotless:off */ other is BatchCreateBody && this.completionWindow == other.completionWindow && this.endpoint == other.endpoint && this.inputFileId == other.inputFileId && this.metadata == other.metadata && this.additionalProperties == other.additionalProperties /* spotless:on */
return /* spotless:off */ other is BatchCreateBody && completionWindow == other.completionWindow && endpoint == other.endpoint && inputFileId == other.inputFileId && metadata == other.metadata && additionalProperties == other.additionalProperties /* spotless:on */
}

private var hashCode: Int = 0
/* spotless:off */
private val hashCode: Int by lazy { Objects.hash(completionWindow, endpoint, inputFileId, metadata, additionalProperties) }
/* spotless:on */

override fun hashCode(): Int {
if (hashCode == 0) {
hashCode = /* spotless:off */ Objects.hash(completionWindow, endpoint, inputFileId, metadata, additionalProperties) /* spotless:on */
}
return hashCode
}
override fun hashCode(): Int = hashCode

override fun toString() =
"BatchCreateBody{completionWindow=$completionWindow, endpoint=$endpoint, inputFileId=$inputFileId, metadata=$metadata, additionalProperties=$additionalProperties}"
Expand All @@ -218,12 +215,10 @@ constructor(
return true
}

return /* spotless:off */ other is BatchCreateParams && this.completionWindow == other.completionWindow && this.endpoint == other.endpoint && this.inputFileId == other.inputFileId && this.metadata == other.metadata && this.additionalHeaders == other.additionalHeaders && this.additionalQueryParams == other.additionalQueryParams && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */
return /* spotless:off */ other is BatchCreateParams && completionWindow == other.completionWindow && endpoint == other.endpoint && inputFileId == other.inputFileId && metadata == other.metadata && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams && additionalBodyProperties == other.additionalBodyProperties /* spotless:on */
}

override fun hashCode(): Int {
return /* spotless:off */ Objects.hash(completionWindow, endpoint, inputFileId, metadata, additionalHeaders, additionalQueryParams, additionalBodyProperties) /* spotless:on */
}
override fun hashCode(): Int = /* spotless:off */ Objects.hash(completionWindow, endpoint, inputFileId, metadata, additionalHeaders, additionalQueryParams, additionalBodyProperties) /* spotless:on */

override fun toString() =
"BatchCreateParams{completionWindow=$completionWindow, endpoint=$endpoint, inputFileId=$inputFileId, metadata=$metadata, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}"
Expand Down Expand Up @@ -282,7 +277,7 @@ constructor(
* Your input file must be formatted as a
* [JSONL file](https://platform.openai.com/docs/api-reference/batch/request-input), and
* must be uploaded with the purpose `batch`. The file can contain up to 50,000 requests,
* and can be up to 100 MB in size.
* and can be up to 200 MB in size.
*/
fun inputFileId(inputFileId: String) = apply { this.inputFileId = inputFileId }

Expand Down Expand Up @@ -434,7 +429,7 @@ constructor(
return true
}

return /* spotless:off */ other is CompletionWindow && this.value == other.value /* spotless:on */
return /* spotless:off */ other is CompletionWindow && value == other.value /* spotless:on */
}

override fun hashCode() = value.hashCode()
Expand Down Expand Up @@ -485,7 +480,7 @@ constructor(
return true
}

return /* spotless:off */ other is Endpoint && this.value == other.value /* spotless:on */
return /* spotless:off */ other is Endpoint && value == other.value /* spotless:on */
}

override fun hashCode() = value.hashCode()
Expand Down Expand Up @@ -585,17 +580,14 @@ constructor(
return true
}

return /* spotless:off */ other is Metadata && this.additionalProperties == other.additionalProperties /* spotless:on */
return /* spotless:off */ other is Metadata && additionalProperties == other.additionalProperties /* spotless:on */
}

private var hashCode: Int = 0
/* spotless:off */
private val hashCode: Int by lazy { Objects.hash(additionalProperties) }
/* spotless:on */

override fun hashCode(): Int {
if (hashCode == 0) {
hashCode = /* spotless:off */ Objects.hash(additionalProperties) /* spotless:on */
}
return hashCode
}
override fun hashCode(): Int = hashCode

override fun toString() = "Metadata{additionalProperties=$additionalProperties}"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,17 +151,14 @@ private constructor(
return true
}

return /* spotless:off */ other is BatchError && this.code == other.code && this.message == other.message && this.param == other.param && this.line == other.line && this.additionalProperties == other.additionalProperties /* spotless:on */
return /* spotless:off */ other is BatchError && code == other.code && message == other.message && param == other.param && line == other.line && additionalProperties == other.additionalProperties /* spotless:on */
}

private var hashCode: Int = 0
/* spotless:off */
private val hashCode: Int by lazy { Objects.hash(code, message, param, line, additionalProperties) }
/* spotless:on */

override fun hashCode(): Int {
if (hashCode == 0) {
hashCode = /* spotless:off */ Objects.hash(code, message, param, line, additionalProperties) /* spotless:on */
}
return hashCode
}
override fun hashCode(): Int = hashCode

override fun toString() =
"BatchError{code=$code, message=$message, param=$param, line=$line, additionalProperties=$additionalProperties}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,10 @@ private constructor(
return true
}

return /* spotless:off */ other is BatchListPage && this.batchesService == other.batchesService && this.params == other.params && this.response == other.response /* spotless:on */
return /* spotless:off */ other is BatchListPage && batchesService == other.batchesService && params == other.params && response == other.response /* spotless:on */
}

override fun hashCode(): Int {
return /* spotless:off */ Objects.hash(batchesService, params, response) /* spotless:on */
}
override fun hashCode(): Int = /* spotless:off */ Objects.hash(batchesService, params, response) /* spotless:on */

override fun toString() =
"BatchListPage{batchesService=$batchesService, params=$params, response=$response}"
Expand Down Expand Up @@ -106,15 +104,12 @@ private constructor(
return true
}

return /* spotless:off */ other is Response && this.data == other.data && this.additionalProperties == other.additionalProperties /* spotless:on */
return /* spotless:off */ other is Response && data == other.data && additionalProperties == other.additionalProperties /* spotless:on */
}

override fun hashCode(): Int {
return /* spotless:off */ Objects.hash(data, additionalProperties) /* spotless:on */
}
override fun hashCode(): Int = /* spotless:off */ Objects.hash(data, additionalProperties) /* spotless:on */

override fun toString() =
"BatchListPage.Response{data=$data, additionalProperties=$additionalProperties}"
override fun toString() = "Response{data=$data, additionalProperties=$additionalProperties}"

companion object {

Expand Down
Loading
Loading