Skip to content
Closed
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
12 changes: 6 additions & 6 deletions .castiron.stats.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
schema_version: 1
generation_id: b935ba17-9980-45bd-b8c7-1939d1b03aba
openapi_spec_hash: e81fa0fd2133715dabef9f00a42557a9
openapi_transformed_spec_hash: bea7a30d23deed3fc8f1c6413a38d354
config_hash: dda57991526f80e9f99d8f9621460eaa
codegen_sha: 9306aff2af8ad922f591ebbc1d29362cf9271bc8
generation_id: 9ef5fd34-09a3-42b5-b0dd-0caaa6d5e976
openapi_spec_hash: 049c3c7cd03d2c6dc132ac9a5e35cb96
openapi_transformed_spec_hash: 29c60a4e6f3a651f4bc17d307a364f8a
config_hash: 18a21de301345621ed0715ffe99465fc
codegen_sha: 13f2c3dd11749ceb0a026c794af1a764f74d2819
codegen_hash: bda6b5fe61d5a094103b7cbc38597c82109f4c14bb23d4501d6c3e1569f75878
public_codegen_sha: 43d374297ff620990fa45fdd39a32079c3905e30
public_codegen_sha: 1cd5b8d81b1c6afc29c814ea3fd28abd7aed7017
18 changes: 18 additions & 0 deletions api_reference/openapi.transformed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3573,6 +3573,9 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/CreateCompletionResponse'
text/event-stream:
schema:
$ref: '#/components/schemas/CreateCompletionResponse'
'400':
description: Invalid completion request or incompatible request parameters.
content:
Expand Down Expand Up @@ -21277,6 +21280,9 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/Response'
text/event-stream:
schema:
$ref: '#/components/schemas/ResponseStreamEvent'
'404':
description: The response was not found.
content:
Expand Down Expand Up @@ -21770,6 +21776,9 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/RunObject'
text/event-stream:
schema:
$ref: '#/components/schemas/AssistantStreamEvent'
'429':
$ref: '#/components/responses/TooManyRequests'
x-oaiMeta:
Expand Down Expand Up @@ -23054,6 +23063,9 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/RunObject'
text/event-stream:
schema:
$ref: '#/components/schemas/AssistantStreamEvent'
'429':
$ref: '#/components/responses/TooManyRequests'
x-oaiMeta:
Expand Down Expand Up @@ -23994,6 +24006,9 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/RunObject'
text/event-stream:
schema:
$ref: '#/components/schemas/AssistantStreamEvent'
'429':
$ref: '#/components/responses/TooManyRequests'
x-oaiMeta:
Expand Down Expand Up @@ -35876,6 +35891,9 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/BetaResponse'
text/event-stream:
schema:
$ref: '#/components/schemas/BetaResponseStreamEvent'
'404':
description: The response was not found.
content:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import com.openai.client.okhttp.OpenAIOkHttpClientAsync
import com.openai.core.JsonValue
import com.openai.models.chat.completions.ChatCompletionStreamOptions
import com.openai.models.completions.CompletionCreateParams
import org.junit.jupiter.api.Disabled
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.extension.ExtendWith

Expand Down Expand Up @@ -60,7 +59,6 @@ internal class CompletionServiceAsyncTest {
completion.validate()
}

@Disabled("Prism does not support SSE streaming mock responses")
@Test
fun createStreaming() {
val client =
Expand Down Expand Up @@ -103,10 +101,15 @@ internal class CompletionServiceAsyncTest {
.build()
)

val received = java.util.concurrent.atomic.AtomicInteger()
val onCompleteFuture =
completionStreamResponse
.subscribe { completion -> completion.validate() }
.subscribe { event ->
event.validate()
received.incrementAndGet()
}
.onCompleteFuture()
onCompleteFuture.get()
check(received.get() > 0) { "Expected at least one streaming event" }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import com.openai.models.images.ImageCreateVariationParams
import com.openai.models.images.ImageEditParams
import com.openai.models.images.ImageGenerateParams
import com.openai.models.images.ImageModel
import org.junit.jupiter.api.Disabled
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.extension.ExtendWith

Expand Down Expand Up @@ -75,7 +74,6 @@ internal class ImageServiceAsyncTest {
imagesResponse.validate()
}

@Disabled("Prism does not support SSE streaming mock responses")
@Test
fun editStreaming() {
val client =
Expand Down Expand Up @@ -106,11 +104,16 @@ internal class ImageServiceAsyncTest {
.build()
)

val received = java.util.concurrent.atomic.AtomicInteger()
val onCompleteFuture =
imagesResponseStreamResponse
.subscribe { imagesResponse -> imagesResponse.validate() }
.subscribe { event ->
event.validate()
received.incrementAndGet()
}
.onCompleteFuture()
onCompleteFuture.get()
check(received.get() > 0) { "Expected at least one streaming event" }
}

@Test
Expand Down Expand Up @@ -146,7 +149,6 @@ internal class ImageServiceAsyncTest {
imagesResponse.validate()
}

@Disabled("Prism does not support SSE streaming mock responses")
@Test
fun generateStreaming() {
val client =
Expand Down Expand Up @@ -176,10 +178,15 @@ internal class ImageServiceAsyncTest {
.build()
)

val received = java.util.concurrent.atomic.AtomicInteger()
val onCompleteFuture =
imagesResponseStreamResponse
.subscribe { imagesResponse -> imagesResponse.validate() }
.subscribe { event ->
event.validate()
received.incrementAndGet()
}
.onCompleteFuture()
onCompleteFuture.get()
check(received.get() > 0) { "Expected at least one streaming event" }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import com.openai.models.responses.ResponsePrompt
import com.openai.models.responses.ResponseRetrieveParams
import com.openai.models.responses.ResponseTextConfig
import com.openai.models.responses.ToolChoiceOptions
import org.junit.jupiter.api.Disabled
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.extension.ExtendWith

Expand Down Expand Up @@ -165,7 +164,6 @@ internal class ResponseServiceAsyncTest {
response.validate()
}

@Disabled("Prism does not support SSE streaming mock responses")
@Test
fun createStreaming() {
val client =
Expand Down Expand Up @@ -303,9 +301,16 @@ internal class ResponseServiceAsyncTest {
.build()
)

val received = java.util.concurrent.atomic.AtomicInteger()
val onCompleteFuture =
responseStreamResponse.subscribe { response -> response.validate() }.onCompleteFuture()
responseStreamResponse
.subscribe { event ->
event.validate()
received.incrementAndGet()
}
.onCompleteFuture()
onCompleteFuture.get()
check(received.get() > 0) { "Expected at least one streaming event" }
}

@Test
Expand All @@ -332,7 +337,6 @@ internal class ResponseServiceAsyncTest {
response.validate()
}

@Disabled("Prism does not support SSE streaming mock responses")
@Test
fun retrieveStreaming() {
val client =
Expand All @@ -353,9 +357,16 @@ internal class ResponseServiceAsyncTest {
.build()
)

val received = java.util.concurrent.atomic.AtomicInteger()
val onCompleteFuture =
responseStreamResponse.subscribe { response -> response.validate() }.onCompleteFuture()
responseStreamResponse
.subscribe { event ->
event.validate()
received.incrementAndGet()
}
.onCompleteFuture()
onCompleteFuture.get()
check(received.get() > 0) { "Expected at least one streaming event" }
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import com.openai.models.audio.AudioModel
import com.openai.models.audio.AudioResponseFormat
import com.openai.models.audio.transcriptions.TranscriptionCreateParams
import com.openai.models.audio.transcriptions.TranscriptionInclude
import org.junit.jupiter.api.Disabled
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.extension.ExtendWith

Expand Down Expand Up @@ -48,7 +47,6 @@ internal class TranscriptionServiceAsyncTest {
transcription.validate()
}

@Disabled("Prism does not support SSE streaming mock responses")
@Test
fun createStreaming() {
val client =
Expand Down Expand Up @@ -78,10 +76,15 @@ internal class TranscriptionServiceAsyncTest {
.build()
)

val received = java.util.concurrent.atomic.AtomicInteger()
val onCompleteFuture =
transcriptionStreamResponse
.subscribe { transcription -> transcription.validate() }
.subscribe { event ->
event.validate()
received.incrementAndGet()
}
.onCompleteFuture()
onCompleteFuture.get()
check(received.get() > 0) { "Expected at least one streaming event" }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -313,8 +313,16 @@ internal class ResponseServiceAsyncTest {
.build()
)

val onCompleteFuture = betaResponseStreamResponse.subscribe {}.onCompleteFuture()
val received = java.util.concurrent.atomic.AtomicInteger()
val onCompleteFuture =
betaResponseStreamResponse
.subscribe { event ->
event.validate()
received.incrementAndGet()
}
.onCompleteFuture()
onCompleteFuture.get()
check(received.get() > 0) { "Expected at least one streaming event" }
}

@Test
Expand Down Expand Up @@ -363,11 +371,16 @@ internal class ResponseServiceAsyncTest {
.build()
)

val received = java.util.concurrent.atomic.AtomicInteger()
val onCompleteFuture =
betaResponseStreamResponse
.subscribe { betaResponse -> betaResponse.validate() }
.subscribe { event ->
event.validate()
received.incrementAndGet()
}
.onCompleteFuture()
onCompleteFuture.get()
check(received.get() > 0) { "Expected at least one streaming event" }
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import com.openai.models.beta.threads.AssistantToolChoiceOption
import com.openai.models.beta.threads.ThreadCreateAndRunParams
import com.openai.models.beta.threads.ThreadCreateParams
import com.openai.models.beta.threads.ThreadUpdateParams
import org.junit.jupiter.api.Disabled
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.extension.ExtendWith

Expand Down Expand Up @@ -285,7 +284,6 @@ internal class ThreadServiceAsyncTest {
run.validate()
}

@Disabled("Prism does not support SSE streaming mock responses")
@Test
fun createAndRunStreaming() {
val client =
Expand Down Expand Up @@ -403,8 +401,15 @@ internal class ThreadServiceAsyncTest {
.build()
)

val received = java.util.concurrent.atomic.AtomicInteger()
val onCompleteFuture =
runStreamResponse.subscribe { run -> run.validate() }.onCompleteFuture()
runStreamResponse
.subscribe { event ->
event.validate()
received.incrementAndGet()
}
.onCompleteFuture()
onCompleteFuture.get()
check(received.get() > 0) { "Expected at least one streaming event" }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -167,14 +167,17 @@ internal class SessionServiceAsyncTest {
.build()
)

val received = java.util.concurrent.atomic.AtomicInteger()
val onCompleteFuture =
agentSessionStreamResponse
.subscribe { agentSession ->
agentSession.validate()
deltas.add(agentSession.asTurnOutputTextDelta().delta())
.subscribe { event ->
event.validate()
deltas.add(event.asTurnOutputTextDelta().delta())
received.incrementAndGet()
}
.onCompleteFuture()
onCompleteFuture.get()
check(received.get() > 0) { "Expected at least one streaming event" }
assertThat(deltas).containsExactly("hello")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,17 @@ internal class EventServiceAsyncTest {

val agentSessionEventStreamResponse = eventServiceAsync.streamStreaming("session_id")

val received = java.util.concurrent.atomic.AtomicInteger()
val onCompleteFuture =
agentSessionEventStreamResponse
.subscribe { agentSessionEvent ->
agentSessionEvent.validate()
deltas.add(agentSessionEvent.asTurnOutputTextDelta().delta())
.subscribe { event ->
event.validate()
deltas.add(event.asTurnOutputTextDelta().delta())
received.incrementAndGet()
}
.onCompleteFuture()
onCompleteFuture.get()
check(received.get() > 0) { "Expected at least one streaming event" }
assertThat(deltas).containsExactly("hello")
}
}
Loading
Loading