Skip to content

Commit 0ea523e

Browse files
feat(api): realtime API updates
1 parent 45c5856 commit 0ea523e

File tree

229 files changed

+85183
-1744
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

229 files changed

+85183
-1744
lines changed

.stats.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 119
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-8517ffa1004e31ca2523d617629e64be6fe4f13403ddfd9db5b3be002656cbde.yml
3-
openapi_spec_hash: b64dd8c8b23082a7aa2a3e5c5fffd8bd
4-
config_hash: fe0ea26680ac2075a6cd66416aefe7db
1+
configured_endpoints: 118
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-356b4364203ff36d7724074cd04f6e684253bfcc3c9d969122d730aa7bc51b46.yml
3+
openapi_spec_hash: 4ab8e96f52699bc3d2b0c4432aa92af8
4+
config_hash: b854932c0ea24b400bdd64e4376936bd

openai-java-core/src/main/kotlin/com/openai/client/OpenAIClient.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import com.openai.services.blocking.GraderService
1818
import com.openai.services.blocking.ImageService
1919
import com.openai.services.blocking.ModelService
2020
import com.openai.services.blocking.ModerationService
21+
import com.openai.services.blocking.RealtimeService
2122
import com.openai.services.blocking.ResponseService
2223
import com.openai.services.blocking.UploadService
2324
import com.openai.services.blocking.VectorStoreService
@@ -92,6 +93,8 @@ interface OpenAIClient {
9293

9394
fun responses(): ResponseService
9495

96+
fun realtime(): RealtimeService
97+
9598
fun conversations(): ConversationService
9699

97100
fun evals(): EvalService
@@ -153,6 +156,8 @@ interface OpenAIClient {
153156

154157
fun responses(): ResponseService.WithRawResponse
155158

159+
fun realtime(): RealtimeService.WithRawResponse
160+
156161
fun conversations(): ConversationService.WithRawResponse
157162

158163
fun evals(): EvalService.WithRawResponse

openai-java-core/src/main/kotlin/com/openai/client/OpenAIClientAsync.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import com.openai.services.async.GraderServiceAsync
1818
import com.openai.services.async.ImageServiceAsync
1919
import com.openai.services.async.ModelServiceAsync
2020
import com.openai.services.async.ModerationServiceAsync
21+
import com.openai.services.async.RealtimeServiceAsync
2122
import com.openai.services.async.ResponseServiceAsync
2223
import com.openai.services.async.UploadServiceAsync
2324
import com.openai.services.async.VectorStoreServiceAsync
@@ -92,6 +93,8 @@ interface OpenAIClientAsync {
9293

9394
fun responses(): ResponseServiceAsync
9495

96+
fun realtime(): RealtimeServiceAsync
97+
9598
fun conversations(): ConversationServiceAsync
9699

97100
fun evals(): EvalServiceAsync
@@ -155,6 +158,8 @@ interface OpenAIClientAsync {
155158

156159
fun responses(): ResponseServiceAsync.WithRawResponse
157160

161+
fun realtime(): RealtimeServiceAsync.WithRawResponse
162+
158163
fun conversations(): ConversationServiceAsync.WithRawResponse
159164

160165
fun evals(): EvalServiceAsync.WithRawResponse

openai-java-core/src/main/kotlin/com/openai/client/OpenAIClientAsyncImpl.kt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ import com.openai.services.async.ModelServiceAsync
3434
import com.openai.services.async.ModelServiceAsyncImpl
3535
import com.openai.services.async.ModerationServiceAsync
3636
import com.openai.services.async.ModerationServiceAsyncImpl
37+
import com.openai.services.async.RealtimeServiceAsync
38+
import com.openai.services.async.RealtimeServiceAsyncImpl
3739
import com.openai.services.async.ResponseServiceAsync
3840
import com.openai.services.async.ResponseServiceAsyncImpl
3941
import com.openai.services.async.UploadServiceAsync
@@ -119,6 +121,10 @@ class OpenAIClientAsyncImpl(private val clientOptions: ClientOptions) : OpenAICl
119121
ResponseServiceAsyncImpl(clientOptionsWithUserAgent)
120122
}
121123

124+
private val realtime: RealtimeServiceAsync by lazy {
125+
RealtimeServiceAsyncImpl(clientOptionsWithUserAgent)
126+
}
127+
122128
private val conversations: ConversationServiceAsync by lazy {
123129
ConversationServiceAsyncImpl(clientOptionsWithUserAgent)
124130
}
@@ -168,6 +174,8 @@ class OpenAIClientAsyncImpl(private val clientOptions: ClientOptions) : OpenAICl
168174

169175
override fun responses(): ResponseServiceAsync = responses
170176

177+
override fun realtime(): RealtimeServiceAsync = realtime
178+
171179
override fun conversations(): ConversationServiceAsync = conversations
172180

173181
override fun evals(): EvalServiceAsync = evals
@@ -243,6 +251,10 @@ class OpenAIClientAsyncImpl(private val clientOptions: ClientOptions) : OpenAICl
243251
ResponseServiceAsyncImpl.WithRawResponseImpl(clientOptions)
244252
}
245253

254+
private val realtime: RealtimeServiceAsync.WithRawResponse by lazy {
255+
RealtimeServiceAsyncImpl.WithRawResponseImpl(clientOptions)
256+
}
257+
246258
private val conversations: ConversationServiceAsync.WithRawResponse by lazy {
247259
ConversationServiceAsyncImpl.WithRawResponseImpl(clientOptions)
248260
}
@@ -294,6 +306,8 @@ class OpenAIClientAsyncImpl(private val clientOptions: ClientOptions) : OpenAICl
294306

295307
override fun responses(): ResponseServiceAsync.WithRawResponse = responses
296308

309+
override fun realtime(): RealtimeServiceAsync.WithRawResponse = realtime
310+
297311
override fun conversations(): ConversationServiceAsync.WithRawResponse = conversations
298312

299313
override fun evals(): EvalServiceAsync.WithRawResponse = evals

openai-java-core/src/main/kotlin/com/openai/client/OpenAIClientImpl.kt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ import com.openai.services.blocking.ModelService
3434
import com.openai.services.blocking.ModelServiceImpl
3535
import com.openai.services.blocking.ModerationService
3636
import com.openai.services.blocking.ModerationServiceImpl
37+
import com.openai.services.blocking.RealtimeService
38+
import com.openai.services.blocking.RealtimeServiceImpl
3739
import com.openai.services.blocking.ResponseService
3840
import com.openai.services.blocking.ResponseServiceImpl
3941
import com.openai.services.blocking.UploadService
@@ -105,6 +107,10 @@ class OpenAIClientImpl(private val clientOptions: ClientOptions) : OpenAIClient
105107
ResponseServiceImpl(clientOptionsWithUserAgent)
106108
}
107109

110+
private val realtime: RealtimeService by lazy {
111+
RealtimeServiceImpl(clientOptionsWithUserAgent)
112+
}
113+
108114
private val conversations: ConversationService by lazy {
109115
ConversationServiceImpl(clientOptionsWithUserAgent)
110116
}
@@ -154,6 +160,8 @@ class OpenAIClientImpl(private val clientOptions: ClientOptions) : OpenAIClient
154160

155161
override fun responses(): ResponseService = responses
156162

163+
override fun realtime(): RealtimeService = realtime
164+
157165
override fun conversations(): ConversationService = conversations
158166

159167
override fun evals(): EvalService = evals
@@ -229,6 +237,10 @@ class OpenAIClientImpl(private val clientOptions: ClientOptions) : OpenAIClient
229237
ResponseServiceImpl.WithRawResponseImpl(clientOptions)
230238
}
231239

240+
private val realtime: RealtimeService.WithRawResponse by lazy {
241+
RealtimeServiceImpl.WithRawResponseImpl(clientOptions)
242+
}
243+
232244
private val conversations: ConversationService.WithRawResponse by lazy {
233245
ConversationServiceImpl.WithRawResponseImpl(clientOptions)
234246
}
@@ -280,6 +292,8 @@ class OpenAIClientImpl(private val clientOptions: ClientOptions) : OpenAIClient
280292

281293
override fun responses(): ResponseService.WithRawResponse = responses
282294

295+
override fun realtime(): RealtimeService.WithRawResponse = realtime
296+
283297
override fun conversations(): ConversationService.WithRawResponse = conversations
284298

285299
override fun evals(): EvalService.WithRawResponse = evals

openai-java-core/src/main/kotlin/com/openai/models/audio/speech/SpeechCreateParams.kt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -962,6 +962,10 @@ private constructor(
962962

963963
@JvmField val VERSE = of("verse")
964964

965+
@JvmField val MARIN = of("marin")
966+
967+
@JvmField val CEDAR = of("cedar")
968+
965969
@JvmStatic fun of(value: String) = Voice(JsonField.of(value))
966970
}
967971

@@ -975,6 +979,8 @@ private constructor(
975979
SAGE,
976980
SHIMMER,
977981
VERSE,
982+
MARIN,
983+
CEDAR,
978984
}
979985

980986
/**
@@ -995,6 +1001,8 @@ private constructor(
9951001
SAGE,
9961002
SHIMMER,
9971003
VERSE,
1004+
MARIN,
1005+
CEDAR,
9981006
/** An enum member indicating that [Voice] was instantiated with an unknown value. */
9991007
_UNKNOWN,
10001008
}
@@ -1016,6 +1024,8 @@ private constructor(
10161024
SAGE -> Value.SAGE
10171025
SHIMMER -> Value.SHIMMER
10181026
VERSE -> Value.VERSE
1027+
MARIN -> Value.MARIN
1028+
CEDAR -> Value.CEDAR
10191029
else -> Value._UNKNOWN
10201030
}
10211031

@@ -1038,6 +1048,8 @@ private constructor(
10381048
SAGE -> Known.SAGE
10391049
SHIMMER -> Known.SHIMMER
10401050
VERSE -> Known.VERSE
1051+
MARIN -> Known.MARIN
1052+
CEDAR -> Known.CEDAR
10411053
else -> throw OpenAIInvalidDataException("Unknown Voice: $value")
10421054
}
10431055

openai-java-core/src/main/kotlin/com/openai/models/chat/completions/ChatCompletionAudioParam.kt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,10 @@ private constructor(
396396

397397
@JvmField val VERSE = of("verse")
398398

399+
@JvmField val MARIN = of("marin")
400+
401+
@JvmField val CEDAR = of("cedar")
402+
399403
@JvmStatic fun of(value: String) = Voice(JsonField.of(value))
400404
}
401405

@@ -409,6 +413,8 @@ private constructor(
409413
SAGE,
410414
SHIMMER,
411415
VERSE,
416+
MARIN,
417+
CEDAR,
412418
}
413419

414420
/**
@@ -429,6 +435,8 @@ private constructor(
429435
SAGE,
430436
SHIMMER,
431437
VERSE,
438+
MARIN,
439+
CEDAR,
432440
/** An enum member indicating that [Voice] was instantiated with an unknown value. */
433441
_UNKNOWN,
434442
}
@@ -450,6 +458,8 @@ private constructor(
450458
SAGE -> Value.SAGE
451459
SHIMMER -> Value.SHIMMER
452460
VERSE -> Value.VERSE
461+
MARIN -> Value.MARIN
462+
CEDAR -> Value.CEDAR
453463
else -> Value._UNKNOWN
454464
}
455465

@@ -472,6 +482,8 @@ private constructor(
472482
SAGE -> Known.SAGE
473483
SHIMMER -> Known.SHIMMER
474484
VERSE -> Known.VERSE
485+
MARIN -> Known.MARIN
486+
CEDAR -> Known.CEDAR
475487
else -> throw OpenAIInvalidDataException("Unknown Voice: $value")
476488
}
477489

openai-java-core/src/main/kotlin/com/openai/models/evals/runs/RunCancelResponse.kt

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ import com.openai.models.responses.ResponseFormatTextConfig
3737
import com.openai.models.responses.ResponseFormatTextJsonSchemaConfig
3838
import com.openai.models.responses.ResponseInputText
3939
import com.openai.models.responses.Tool
40+
import com.openai.models.responses.WebSearchPreviewTool
4041
import com.openai.models.responses.WebSearchTool
4142
import java.util.Collections
4243
import java.util.Objects
@@ -6215,9 +6216,8 @@ private constructor(
62156216
fun addTool(computerUsePreview: ComputerTool) =
62166217
addTool(Tool.ofComputerUsePreview(computerUsePreview))
62176218

6218-
/** Alias for calling [addTool] with `Tool.ofWebSearchTool(webSearchTool)`. */
6219-
fun addTool(webSearchTool: Tool.WebSearchTool) =
6220-
addTool(Tool.ofWebSearchTool(webSearchTool))
6219+
/** Alias for calling [addTool] with `Tool.ofWebSearch(webSearch)`. */
6220+
fun addTool(webSearch: WebSearchTool) = addTool(Tool.ofWebSearch(webSearch))
62216221

62226222
/** Alias for calling [addTool] with `Tool.ofMcp(mcp)`. */
62236223
fun addTool(mcp: Tool.Mcp) = addTool(Tool.ofMcp(mcp))
@@ -6294,9 +6294,11 @@ private constructor(
62946294
fun addCustomTool(name: String) =
62956295
addTool(CustomTool.builder().name(name).build())
62966296

6297-
/** Alias for calling [addTool] with `Tool.ofWebSearchTool(webSearchTool)`. */
6298-
fun addTool(webSearchTool: WebSearchTool) =
6299-
addTool(Tool.ofWebSearchTool(webSearchTool))
6297+
/**
6298+
* Alias for calling [addTool] with `Tool.ofWebSearchPreview(webSearchPreview)`.
6299+
*/
6300+
fun addTool(webSearchPreview: WebSearchPreviewTool) =
6301+
addTool(Tool.ofWebSearchPreview(webSearchPreview))
63006302

63016303
/**
63026304
* An alternative to temperature for nucleus sampling; 1.0 includes all tokens.

openai-java-core/src/main/kotlin/com/openai/models/evals/runs/RunCreateParams.kt

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ import com.openai.models.responses.ResponseFormatTextConfig
4040
import com.openai.models.responses.ResponseFormatTextJsonSchemaConfig
4141
import com.openai.models.responses.ResponseInputText
4242
import com.openai.models.responses.Tool
43+
import com.openai.models.responses.WebSearchPreviewTool
4344
import com.openai.models.responses.WebSearchTool
4445
import java.util.Collections
4546
import java.util.Objects
@@ -6100,9 +6101,8 @@ private constructor(
61006101
fun addTool(computerUsePreview: ComputerTool) =
61016102
addTool(Tool.ofComputerUsePreview(computerUsePreview))
61026103

6103-
/** Alias for calling [addTool] with `Tool.ofWebSearchTool(webSearchTool)`. */
6104-
fun addTool(webSearchTool: Tool.WebSearchTool) =
6105-
addTool(Tool.ofWebSearchTool(webSearchTool))
6104+
/** Alias for calling [addTool] with `Tool.ofWebSearch(webSearch)`. */
6105+
fun addTool(webSearch: WebSearchTool) = addTool(Tool.ofWebSearch(webSearch))
61066106

61076107
/** Alias for calling [addTool] with `Tool.ofMcp(mcp)`. */
61086108
fun addTool(mcp: Tool.Mcp) = addTool(Tool.ofMcp(mcp))
@@ -6179,9 +6179,11 @@ private constructor(
61796179
fun addCustomTool(name: String) =
61806180
addTool(CustomTool.builder().name(name).build())
61816181

6182-
/** Alias for calling [addTool] with `Tool.ofWebSearchTool(webSearchTool)`. */
6183-
fun addTool(webSearchTool: WebSearchTool) =
6184-
addTool(Tool.ofWebSearchTool(webSearchTool))
6182+
/**
6183+
* Alias for calling [addTool] with `Tool.ofWebSearchPreview(webSearchPreview)`.
6184+
*/
6185+
fun addTool(webSearchPreview: WebSearchPreviewTool) =
6186+
addTool(Tool.ofWebSearchPreview(webSearchPreview))
61856187

61866188
/**
61876189
* An alternative to temperature for nucleus sampling; 1.0 includes all tokens.

openai-java-core/src/main/kotlin/com/openai/models/evals/runs/RunCreateResponse.kt

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ import com.openai.models.responses.ResponseFormatTextConfig
3737
import com.openai.models.responses.ResponseFormatTextJsonSchemaConfig
3838
import com.openai.models.responses.ResponseInputText
3939
import com.openai.models.responses.Tool
40+
import com.openai.models.responses.WebSearchPreviewTool
4041
import com.openai.models.responses.WebSearchTool
4142
import java.util.Collections
4243
import java.util.Objects
@@ -6215,9 +6216,8 @@ private constructor(
62156216
fun addTool(computerUsePreview: ComputerTool) =
62166217
addTool(Tool.ofComputerUsePreview(computerUsePreview))
62176218

6218-
/** Alias for calling [addTool] with `Tool.ofWebSearchTool(webSearchTool)`. */
6219-
fun addTool(webSearchTool: Tool.WebSearchTool) =
6220-
addTool(Tool.ofWebSearchTool(webSearchTool))
6219+
/** Alias for calling [addTool] with `Tool.ofWebSearch(webSearch)`. */
6220+
fun addTool(webSearch: WebSearchTool) = addTool(Tool.ofWebSearch(webSearch))
62216221

62226222
/** Alias for calling [addTool] with `Tool.ofMcp(mcp)`. */
62236223
fun addTool(mcp: Tool.Mcp) = addTool(Tool.ofMcp(mcp))
@@ -6294,9 +6294,11 @@ private constructor(
62946294
fun addCustomTool(name: String) =
62956295
addTool(CustomTool.builder().name(name).build())
62966296

6297-
/** Alias for calling [addTool] with `Tool.ofWebSearchTool(webSearchTool)`. */
6298-
fun addTool(webSearchTool: WebSearchTool) =
6299-
addTool(Tool.ofWebSearchTool(webSearchTool))
6297+
/**
6298+
* Alias for calling [addTool] with `Tool.ofWebSearchPreview(webSearchPreview)`.
6299+
*/
6300+
fun addTool(webSearchPreview: WebSearchPreviewTool) =
6301+
addTool(Tool.ofWebSearchPreview(webSearchPreview))
63006302

63016303
/**
63026304
* An alternative to temperature for nucleus sampling; 1.0 includes all tokens.

0 commit comments

Comments
 (0)