Skip to content

Commit

Permalink
chore(internal): update example values (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored Nov 25, 2024
1 parent f1f4fc8 commit 5c11cf1
Show file tree
Hide file tree
Showing 42 changed files with 439 additions and 442 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ class BatchErrorTest {
@Test
fun createBatchError() {
val batchError =
BatchError.builder().code("code").line(123L).message("message").param("param").build()
BatchError.builder().code("code").line(0L).message("message").param("param").build()
assertThat(batchError).isNotNull
assertThat(batchError.code()).contains("code")
assertThat(batchError.line()).contains(123L)
assertThat(batchError.line()).contains(0L)
assertThat(batchError.message()).contains("message")
assertThat(batchError.param()).contains("param")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ class BatchListParamsTest {

@Test
fun createBatchListParams() {
BatchListParams.builder().after("after").limit(123L).build()
BatchListParams.builder().after("after").limit(0L).build()
}

@Test
fun getQueryParams() {
val params = BatchListParams.builder().after("after").limit(123L).build()
val params = BatchListParams.builder().after("after").limit(0L).build()
val expected = QueryParams.builder()
expected.put("after", "after")
expected.put("limit", "123")
expected.put("limit", "0")
assertThat(params.getQueryParams()).isEqualTo(expected.build())
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ class BatchRequestCountsTest {
@Test
fun createBatchRequestCounts() {
val batchRequestCounts =
BatchRequestCounts.builder().completed(123L).failed(123L).total(123L).build()
BatchRequestCounts.builder().completed(0L).failed(0L).total(0L).build()
assertThat(batchRequestCounts).isNotNull
assertThat(batchRequestCounts.completed()).isEqualTo(123L)
assertThat(batchRequestCounts.failed()).isEqualTo(123L)
assertThat(batchRequestCounts.total()).isEqualTo(123L)
assertThat(batchRequestCounts.completed()).isEqualTo(0L)
assertThat(batchRequestCounts.failed()).isEqualTo(0L)
assertThat(batchRequestCounts.total()).isEqualTo(0L)
}
}
44 changes: 22 additions & 22 deletions openai-java-core/src/test/kotlin/com/openai/models/BatchTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,22 @@ class BatchTest {
Batch.builder()
.id("id")
.completionWindow("completion_window")
.createdAt(123L)
.createdAt(0L)
.endpoint("endpoint")
.inputFileId("input_file_id")
.object_(Batch.Object.BATCH)
.status(Batch.Status.VALIDATING)
.cancelledAt(123L)
.cancellingAt(123L)
.completedAt(123L)
.cancelledAt(0L)
.cancellingAt(0L)
.completedAt(0L)
.errorFileId("error_file_id")
.errors(
Batch.Errors.builder()
.data(
listOf(
BatchError.builder()
.code("code")
.line(123L)
.line(0L)
.message("message")
.param("param")
.build()
Expand All @@ -38,28 +38,28 @@ class BatchTest {
.object_("object")
.build()
)
.expiredAt(123L)
.expiresAt(123L)
.failedAt(123L)
.finalizingAt(123L)
.inProgressAt(123L)
.expiredAt(0L)
.expiresAt(0L)
.failedAt(0L)
.finalizingAt(0L)
.inProgressAt(0L)
.metadata(JsonNull.of())
.outputFileId("output_file_id")
.requestCounts(
BatchRequestCounts.builder().completed(123L).failed(123L).total(123L).build()
BatchRequestCounts.builder().completed(0L).failed(0L).total(0L).build()
)
.build()
assertThat(batch).isNotNull
assertThat(batch.id()).isEqualTo("id")
assertThat(batch.completionWindow()).isEqualTo("completion_window")
assertThat(batch.createdAt()).isEqualTo(123L)
assertThat(batch.createdAt()).isEqualTo(0L)
assertThat(batch.endpoint()).isEqualTo("endpoint")
assertThat(batch.inputFileId()).isEqualTo("input_file_id")
assertThat(batch.object_()).isEqualTo(Batch.Object.BATCH)
assertThat(batch.status()).isEqualTo(Batch.Status.VALIDATING)
assertThat(batch.cancelledAt()).contains(123L)
assertThat(batch.cancellingAt()).contains(123L)
assertThat(batch.completedAt()).contains(123L)
assertThat(batch.cancelledAt()).contains(0L)
assertThat(batch.cancellingAt()).contains(0L)
assertThat(batch.completedAt()).contains(0L)
assertThat(batch.errorFileId()).contains("error_file_id")
assertThat(batch.errors())
.contains(
Expand All @@ -68,7 +68,7 @@ class BatchTest {
listOf(
BatchError.builder()
.code("code")
.line(123L)
.line(0L)
.message("message")
.param("param")
.build()
Expand All @@ -77,14 +77,14 @@ class BatchTest {
.object_("object")
.build()
)
assertThat(batch.expiredAt()).contains(123L)
assertThat(batch.expiresAt()).contains(123L)
assertThat(batch.failedAt()).contains(123L)
assertThat(batch.finalizingAt()).contains(123L)
assertThat(batch.inProgressAt()).contains(123L)
assertThat(batch.expiredAt()).contains(0L)
assertThat(batch.expiresAt()).contains(0L)
assertThat(batch.failedAt()).contains(0L)
assertThat(batch.finalizingAt()).contains(0L)
assertThat(batch.inProgressAt()).contains(0L)
assertThat(batch._metadata()).isEqualTo(JsonNull.of())
assertThat(batch.outputFileId()).contains("output_file_id")
assertThat(batch.requestCounts())
.contains(BatchRequestCounts.builder().completed(123L).failed(123L).total(123L).build())
.contains(BatchRequestCounts.builder().completed(0L).failed(0L).total(0L).build())
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ class ChatCompletionAudioTest {
ChatCompletionAudio.builder()
.id("id")
.data("data")
.expiresAt(123L)
.expiresAt(0L)
.transcript("transcript")
.build()
assertThat(chatCompletionAudio).isNotNull
assertThat(chatCompletionAudio.id()).isEqualTo("id")
assertThat(chatCompletionAudio.data()).isEqualTo("data")
assertThat(chatCompletionAudio.expiresAt()).isEqualTo(123L)
assertThat(chatCompletionAudio.expiresAt()).isEqualTo(0L)
assertThat(chatCompletionAudio.transcript()).isEqualTo("transcript")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class ChatCompletionChunkTest {
.toolCalls(
listOf(
ChatCompletionChunk.Choice.Delta.ToolCall.builder()
.index(123L)
.index(0L)
.id("id")
.function(
ChatCompletionChunk.Choice.Delta.ToolCall
Expand All @@ -49,22 +49,22 @@ class ChatCompletionChunkTest {
.build()
)
.finishReason(ChatCompletionChunk.Choice.FinishReason.STOP)
.index(123L)
.index(0L)
.logprobs(
ChatCompletionChunk.Choice.Logprobs.builder()
.content(
listOf(
ChatCompletionTokenLogprob.builder()
.token("token")
.bytes(listOf(123L))
.logprob(42.23)
.bytes(listOf(0L))
.logprob(0.0)
.topLogprobs(
listOf(
ChatCompletionTokenLogprob.TopLogprob
.builder()
.token("token")
.bytes(listOf(123L))
.logprob(42.23)
.bytes(listOf(0L))
.logprob(0.0)
.build()
)
)
Expand All @@ -75,15 +75,15 @@ class ChatCompletionChunkTest {
listOf(
ChatCompletionTokenLogprob.builder()
.token("token")
.bytes(listOf(123L))
.logprob(42.23)
.bytes(listOf(0L))
.logprob(0.0)
.topLogprobs(
listOf(
ChatCompletionTokenLogprob.TopLogprob
.builder()
.token("token")
.bytes(listOf(123L))
.logprob(42.23)
.bytes(listOf(0L))
.logprob(0.0)
.build()
)
)
Expand All @@ -95,28 +95,28 @@ class ChatCompletionChunkTest {
.build()
)
)
.created(123L)
.created(0L)
.model("model")
.object_(ChatCompletionChunk.Object.CHAT_COMPLETION_CHUNK)
.serviceTier(ChatCompletionChunk.ServiceTier.SCALE)
.systemFingerprint("system_fingerprint")
.usage(
CompletionUsage.builder()
.completionTokens(123L)
.promptTokens(123L)
.totalTokens(123L)
.completionTokens(0L)
.promptTokens(0L)
.totalTokens(0L)
.completionTokensDetails(
CompletionUsage.CompletionTokensDetails.builder()
.acceptedPredictionTokens(123L)
.audioTokens(123L)
.reasoningTokens(123L)
.rejectedPredictionTokens(123L)
.acceptedPredictionTokens(0L)
.audioTokens(0L)
.reasoningTokens(0L)
.rejectedPredictionTokens(0L)
.build()
)
.promptTokensDetails(
CompletionUsage.PromptTokensDetails.builder()
.audioTokens(123L)
.cachedTokens(123L)
.audioTokens(0L)
.cachedTokens(0L)
.build()
)
.build()
Expand All @@ -141,7 +141,7 @@ class ChatCompletionChunkTest {
.toolCalls(
listOf(
ChatCompletionChunk.Choice.Delta.ToolCall.builder()
.index(123L)
.index(0L)
.id("id")
.function(
ChatCompletionChunk.Choice.Delta.ToolCall.Function
Expand All @@ -159,21 +159,21 @@ class ChatCompletionChunkTest {
.build()
)
.finishReason(ChatCompletionChunk.Choice.FinishReason.STOP)
.index(123L)
.index(0L)
.logprobs(
ChatCompletionChunk.Choice.Logprobs.builder()
.content(
listOf(
ChatCompletionTokenLogprob.builder()
.token("token")
.bytes(listOf(123L))
.logprob(42.23)
.bytes(listOf(0L))
.logprob(0.0)
.topLogprobs(
listOf(
ChatCompletionTokenLogprob.TopLogprob.builder()
.token("token")
.bytes(listOf(123L))
.logprob(42.23)
.bytes(listOf(0L))
.logprob(0.0)
.build()
)
)
Expand All @@ -184,14 +184,14 @@ class ChatCompletionChunkTest {
listOf(
ChatCompletionTokenLogprob.builder()
.token("token")
.bytes(listOf(123L))
.logprob(42.23)
.bytes(listOf(0L))
.logprob(0.0)
.topLogprobs(
listOf(
ChatCompletionTokenLogprob.TopLogprob.builder()
.token("token")
.bytes(listOf(123L))
.logprob(42.23)
.bytes(listOf(0L))
.logprob(0.0)
.build()
)
)
Expand All @@ -202,7 +202,7 @@ class ChatCompletionChunkTest {
)
.build()
)
assertThat(chatCompletionChunk.created()).isEqualTo(123L)
assertThat(chatCompletionChunk.created()).isEqualTo(0L)
assertThat(chatCompletionChunk.model()).isEqualTo("model")
assertThat(chatCompletionChunk.object_())
.isEqualTo(ChatCompletionChunk.Object.CHAT_COMPLETION_CHUNK)
Expand All @@ -212,21 +212,21 @@ class ChatCompletionChunkTest {
assertThat(chatCompletionChunk.usage())
.contains(
CompletionUsage.builder()
.completionTokens(123L)
.promptTokens(123L)
.totalTokens(123L)
.completionTokens(0L)
.promptTokens(0L)
.totalTokens(0L)
.completionTokensDetails(
CompletionUsage.CompletionTokensDetails.builder()
.acceptedPredictionTokens(123L)
.audioTokens(123L)
.reasoningTokens(123L)
.rejectedPredictionTokens(123L)
.acceptedPredictionTokens(0L)
.audioTokens(0L)
.reasoningTokens(0L)
.rejectedPredictionTokens(0L)
.build()
)
.promptTokensDetails(
CompletionUsage.PromptTokensDetails.builder()
.audioTokens(123L)
.cachedTokens(123L)
.audioTokens(0L)
.cachedTokens(0L)
.build()
)
.build()
Expand Down
Loading

0 comments on commit 5c11cf1

Please sign in to comment.