@@ -25,13 +25,11 @@ SUPPORT_PATHS=(
2525 openai-java-core/src/test/kotlin/com/openai/core/StructuredOutputsTestUtils.kt
2626)
2727
28- # These generated tests explicitly exercise Kotlin `internal` structured-output or validation
29- # helpers. They remain covered by the normal test suite, but are not consumer fixtures and must not
30- # define the public compatibility surface.
28+ # This generated test explicitly exercises Kotlin `internal` structured-output helpers. It remains
29+ # covered by the normal test suite, but is not a consumer fixture and must not define the public
30+ # compatibility surface.
3131INTERNAL_FIXTURES=(
3232 openai-java-core/src/test/kotlin/com/openai/models/chat/completions/StructuredChatCompletionCreateParamsTest.kt
33- openai-java-core/src/test/kotlin/com/openai/models/responses/StructuredResponseCreateParamsTest.kt
34- openai-java-core/src/test/kotlin/com/openai/services/ResponseStreamEventValidationTest.kt
3533)
3634
3735# Multipart fixtures exercise public parameter builders and union factories, but their generated
@@ -93,6 +91,53 @@ for PATHSPEC in "${INTERNAL_FIXTURES[@]}"; do
9391 fi
9492done
9593
94+ # These baseline tests combine public API coverage with Kotlin-internal implementation setup.
95+ # Replace them with consumer-style fixtures that preserve the public expressions without relying on
96+ # internal constructors or helpers.
97+ cat > " ${COMPATIBILITY_ROOT} /openai-java-core/src/test/kotlin/com/openai/models/responses/StructuredResponseCreateParamsTest.kt" << 'KOTLIN '
98+ package com.openai.models.responses
99+
100+ import com.openai.models.ChatModel
101+ import com.openai.services.async.ResponseServiceAsync
102+ import com.openai.services.blocking.ResponseService
103+
104+ internal class StructuredResponseOutput(val value: String)
105+
106+ internal fun publicBuilder(): StructuredResponseCreateParams<StructuredResponseOutput> =
107+ StructuredResponseCreateParams.builder<StructuredResponseOutput>()
108+ .input("input")
109+ .model(ChatModel.GPT_4O_MINI)
110+ .text(StructuredResponseOutput::class.java)
111+ .build()
112+
113+ internal fun blockingServiceOverloads(
114+ service: ResponseService,
115+ params: StructuredResponseCreateParams<StructuredResponseOutput>,
116+ ) {
117+ service.create(params)
118+ service.createStreaming(params)
119+ }
120+
121+ internal fun asyncServiceOverloads(
122+ service: ResponseServiceAsync,
123+ params: StructuredResponseCreateParams<StructuredResponseOutput>,
124+ ) {
125+ service.create(params)
126+ service.createStreaming(params)
127+ }
128+ KOTLIN
129+
130+ cat > " ${COMPATIBILITY_ROOT} /openai-java-core/src/test/kotlin/com/openai/services/ResponseStreamEventValidationTest.kt" << 'KOTLIN '
131+ package com.openai.services
132+
133+ import com.openai.models.responses.ResponseStreamEvent
134+
135+ internal class ResponseStreamEventValidationTest {
136+ fun outputTextDelta(event: ResponseStreamEvent): String? =
137+ if (event.isOutputTextDelta()) event.asOutputTextDelta().delta() else null
138+ }
139+ KOTLIN
140+
96141# Keep the public API coverage in structured-output fixtures while replacing only references to
97142# Kotlin-internal constructors and JsonField helpers.
98143replace_internal_reference () {
0 commit comments