Skip to content

Commit dcf70b3

Browse files
chore(api): event shapes more accurate
1 parent 333081e commit dcf70b3

File tree

9 files changed

+195
-230
lines changed

9 files changed

+195
-230
lines changed

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 111
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-670ea0d2cc44f52a87dd3cadea45632953283e0636ba30788fdbdb22a232ccac.yml
3-
openapi_spec_hash: d8b7d38911fead545adf3e4297956410
4-
config_hash: b2a4028fdbb27a08de89831ed310e244
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-b2a451656ca64d30d174391ebfd94806b4de3ab76dc55b92843cfb7f1a54ecb6.yml
3+
openapi_spec_hash: 27d9691b400f28c17ef063a1374048b0
4+
config_hash: e822d0c9082c8b312264403949243179

api.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -710,8 +710,6 @@ Types:
710710
- <code><a href="./src/resources/responses/responses.ts">ResponseOutputTextAnnotationAddedEvent</a></code>
711711
- <code><a href="./src/resources/responses/responses.ts">ResponsePrompt</a></code>
712712
- <code><a href="./src/resources/responses/responses.ts">ResponseQueuedEvent</a></code>
713-
- <code><a href="./src/resources/responses/responses.ts">ResponseReasoningDeltaEvent</a></code>
714-
- <code><a href="./src/resources/responses/responses.ts">ResponseReasoningDoneEvent</a></code>
715713
- <code><a href="./src/resources/responses/responses.ts">ResponseReasoningItem</a></code>
716714
- <code><a href="./src/resources/responses/responses.ts">ResponseReasoningSummaryDeltaEvent</a></code>
717715
- <code><a href="./src/resources/responses/responses.ts">ResponseReasoningSummaryDoneEvent</a></code>

src/resources/audio/speech.ts

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -51,19 +51,7 @@ export interface SpeechCreateParams {
5151
* `verse`. Previews of the voices are available in the
5252
* [Text to speech guide](https://platform.openai.com/docs/guides/text-to-speech#voice-options).
5353
*/
54-
voice:
55-
| (string & {})
56-
| 'alloy'
57-
| 'ash'
58-
| 'ballad'
59-
| 'coral'
60-
| 'echo'
61-
| 'fable'
62-
| 'onyx'
63-
| 'nova'
64-
| 'sage'
65-
| 'shimmer'
66-
| 'verse';
54+
voice: (string & {}) | 'alloy' | 'ash' | 'ballad' | 'coral' | 'echo' | 'sage' | 'shimmer' | 'verse';
6755

6856
/**
6957
* Control the voice of your generated audio with additional instructions. Does not

src/resources/beta/realtime/realtime.ts

Lines changed: 9 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1130,22 +1130,9 @@ export interface RealtimeResponse {
11301130

11311131
/**
11321132
* The voice the model used to respond. Current voice options are `alloy`, `ash`,
1133-
* `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`, `shimmer`, and
1134-
* `verse`.
1135-
*/
1136-
voice?:
1137-
| (string & {})
1138-
| 'alloy'
1139-
| 'ash'
1140-
| 'ballad'
1141-
| 'coral'
1142-
| 'echo'
1143-
| 'fable'
1144-
| 'onyx'
1145-
| 'nova'
1146-
| 'sage'
1147-
| 'shimmer'
1148-
| 'verse';
1133+
* `ballad`, `coral`, `echo`, `sage`, `shimmer`, and `verse`.
1134+
*/
1135+
voice?: (string & {}) | 'alloy' | 'ash' | 'ballad' | 'coral' | 'echo' | 'sage' | 'shimmer' | 'verse';
11491136
}
11501137

11511138
/**
@@ -1832,22 +1819,9 @@ export namespace ResponseCreateEvent {
18321819
/**
18331820
* The voice the model uses to respond. Voice cannot be changed during the session
18341821
* once the model has responded with audio at least once. Current voice options are
1835-
* `alloy`, `ash`, `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`,
1836-
* `shimmer`, and `verse`.
1837-
*/
1838-
voice?:
1839-
| (string & {})
1840-
| 'alloy'
1841-
| 'ash'
1842-
| 'ballad'
1843-
| 'coral'
1844-
| 'echo'
1845-
| 'fable'
1846-
| 'onyx'
1847-
| 'nova'
1848-
| 'sage'
1849-
| 'shimmer'
1850-
| 'verse';
1822+
* `alloy`, `ash`, `ballad`, `coral`, `echo`, `sage`, `shimmer`, and `verse`.
1823+
*/
1824+
voice?: (string & {}) | 'alloy' | 'ash' | 'ballad' | 'coral' | 'echo' | 'sage' | 'shimmer' | 'verse';
18511825
}
18521826

18531827
export namespace Response {
@@ -2325,22 +2299,9 @@ export namespace SessionUpdateEvent {
23252299
/**
23262300
* The voice the model uses to respond. Voice cannot be changed during the session
23272301
* once the model has responded with audio at least once. Current voice options are
2328-
* `alloy`, `ash`, `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`,
2329-
* `shimmer`, and `verse`.
2330-
*/
2331-
voice?:
2332-
| (string & {})
2333-
| 'alloy'
2334-
| 'ash'
2335-
| 'ballad'
2336-
| 'coral'
2337-
| 'echo'
2338-
| 'fable'
2339-
| 'onyx'
2340-
| 'nova'
2341-
| 'sage'
2342-
| 'shimmer'
2343-
| 'verse';
2302+
* `alloy`, `ash`, `ballad`, `coral`, `echo`, `sage`, `shimmer`, and `verse`.
2303+
*/
2304+
voice?: (string & {}) | 'alloy' | 'ash' | 'ballad' | 'coral' | 'echo' | 'sage' | 'shimmer' | 'verse';
23442305
}
23452306

23462307
export namespace Session {

src/resources/beta/realtime/sessions.ts

Lines changed: 9 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -162,22 +162,9 @@ export interface Session {
162162
/**
163163
* The voice the model uses to respond. Voice cannot be changed during the session
164164
* once the model has responded with audio at least once. Current voice options are
165-
* `alloy`, `ash`, `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`,
166-
* `shimmer`, and `verse`.
167-
*/
168-
voice?:
169-
| (string & {})
170-
| 'alloy'
171-
| 'ash'
172-
| 'ballad'
173-
| 'coral'
174-
| 'echo'
175-
| 'fable'
176-
| 'onyx'
177-
| 'nova'
178-
| 'sage'
179-
| 'shimmer'
180-
| 'verse';
165+
* `alloy`, `ash`, `ballad`, `coral`, `echo`, `sage`, `shimmer`, and `verse`.
166+
*/
167+
voice?: (string & {}) | 'alloy' | 'ash' | 'ballad' | 'coral' | 'echo' | 'sage' | 'shimmer' | 'verse';
181168
}
182169

183170
export namespace Session {
@@ -436,21 +423,9 @@ export interface SessionCreateResponse {
436423
/**
437424
* The voice the model uses to respond. Voice cannot be changed during the session
438425
* once the model has responded with audio at least once. Current voice options are
439-
* `alloy`, `ash`, `ballad`, `coral`, `echo` `sage`, `shimmer` and `verse`.
440-
*/
441-
voice?:
442-
| (string & {})
443-
| 'alloy'
444-
| 'ash'
445-
| 'ballad'
446-
| 'coral'
447-
| 'echo'
448-
| 'fable'
449-
| 'onyx'
450-
| 'nova'
451-
| 'sage'
452-
| 'shimmer'
453-
| 'verse';
426+
* `alloy`, `ash`, `ballad`, `coral`, `echo`, `sage`, `shimmer`, and `verse`.
427+
*/
428+
voice?: (string & {}) | 'alloy' | 'ash' | 'ballad' | 'coral' | 'echo' | 'sage' | 'shimmer' | 'verse';
454429
}
455430

456431
export namespace SessionCreateResponse {
@@ -694,22 +669,9 @@ export interface SessionCreateParams {
694669
/**
695670
* The voice the model uses to respond. Voice cannot be changed during the session
696671
* once the model has responded with audio at least once. Current voice options are
697-
* `alloy`, `ash`, `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`,
698-
* `shimmer`, and `verse`.
699-
*/
700-
voice?:
701-
| (string & {})
702-
| 'alloy'
703-
| 'ash'
704-
| 'ballad'
705-
| 'coral'
706-
| 'echo'
707-
| 'fable'
708-
| 'onyx'
709-
| 'nova'
710-
| 'sage'
711-
| 'shimmer'
712-
| 'verse';
672+
* `alloy`, `ash`, `ballad`, `coral`, `echo`, `sage`, `shimmer`, and `verse`.
673+
*/
674+
voice?: (string & {}) | 'alloy' | 'ash' | 'ballad' | 'coral' | 'echo' | 'sage' | 'shimmer' | 'verse';
713675
}
714676

715677
export namespace SessionCreateParams {

src/resources/chat/completions/completions.ts

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ export interface ChatCompletion {
278278
* - If set to 'auto', then the request will be processed with the service tier
279279
* configured in the Project settings. Unless otherwise configured, the Project
280280
* will use 'default'.
281-
* - If set to 'default', then the requset will be processed with the standard
281+
* - If set to 'default', then the request will be processed with the standard
282282
* pricing and performance for the selected model.
283283
* - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or
284284
* 'priority', then the request will be processed with the corresponding service
@@ -474,19 +474,7 @@ export interface ChatCompletionAudioParam {
474474
* The voice the model uses to respond. Supported voices are `alloy`, `ash`,
475475
* `ballad`, `coral`, `echo`, `fable`, `nova`, `onyx`, `sage`, and `shimmer`.
476476
*/
477-
voice:
478-
| (string & {})
479-
| 'alloy'
480-
| 'ash'
481-
| 'ballad'
482-
| 'coral'
483-
| 'echo'
484-
| 'fable'
485-
| 'onyx'
486-
| 'nova'
487-
| 'sage'
488-
| 'shimmer'
489-
| 'verse';
477+
voice: (string & {}) | 'alloy' | 'ash' | 'ballad' | 'coral' | 'echo' | 'sage' | 'shimmer' | 'verse';
490478
}
491479

492480
/**
@@ -529,7 +517,7 @@ export interface ChatCompletionChunk {
529517
* - If set to 'auto', then the request will be processed with the service tier
530518
* configured in the Project settings. Unless otherwise configured, the Project
531519
* will use 'default'.
532-
* - If set to 'default', then the requset will be processed with the standard
520+
* - If set to 'default', then the request will be processed with the standard
533521
* pricing and performance for the selected model.
534522
* - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or
535523
* 'priority', then the request will be processed with the corresponding service
@@ -1451,7 +1439,7 @@ export interface ChatCompletionCreateParamsBase {
14511439
* - If set to 'auto', then the request will be processed with the service tier
14521440
* configured in the Project settings. Unless otherwise configured, the Project
14531441
* will use 'default'.
1454-
* - If set to 'default', then the requset will be processed with the standard
1442+
* - If set to 'default', then the request will be processed with the standard
14551443
* pricing and performance for the selected model.
14561444
* - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or
14571445
* 'priority', then the request will be processed with the corresponding service

src/resources/images.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ export namespace ImagesResponse {
446446
input_tokens_details: Usage.InputTokensDetails;
447447

448448
/**
449-
* The number of image tokens in the output image.
449+
* The number of output tokens generated by the model.
450450
*/
451451
output_tokens: number;
452452

@@ -589,6 +589,9 @@ export interface ImageEditParamsBase {
589589
* The number of partial images to generate. This parameter is used for streaming
590590
* responses that return partial images. Value must be between 0 and 3. When set to
591591
* 0, the response will be a single image sent in one streaming event.
592+
*
593+
* Note that the final image may be sent before the full number of partial images
594+
* are generated if the full image is generated more quickly.
592595
*/
593596
partial_images?: number | null;
594597

@@ -709,6 +712,9 @@ export interface ImageGenerateParamsBase {
709712
* The number of partial images to generate. This parameter is used for streaming
710713
* responses that return partial images. Value must be between 0 and 3. When set to
711714
* 0, the response will be a single image sent in one streaming event.
715+
*
716+
* Note that the final image may be sent before the full number of partial images
717+
* are generated if the full image is generated more quickly.
712718
*/
713719
partial_images?: number | null;
714720

0 commit comments

Comments
 (0)