voice-router-dev 0.6.2 → 0.6.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,50 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.6.4] - 2026-01-13
9
+
10
+ ### Fixed
11
+
12
+ #### Zod discriminatedUnion Fix (Complete)
13
+
14
+ The fix in 0.6.3 was incomplete - it didn't handle multiline patterns generated by Orval.
15
+
16
+ **What was missing:**
17
+ - Regex patterns looked for `zod.discriminatedUnion` but Orval generates `.discriminatedUnion` (chained)
18
+ - Regex patterns expected single-line code but Orval generates multiline patterns
19
+
20
+ **Updated fixes:**
21
+ - Match both `zod.discriminatedUnion` AND `.discriminatedUnion` (method chaining)
22
+ - Handle multiline patterns where `type: zod\n .enum(...)\n .optional()` spans multiple lines
23
+ - Preserve original prefix when replacing (`.union([` vs `zod.union([`)
24
+
25
+ ---
26
+
27
+ ## [0.6.3] - 2026-01-12
28
+
29
+ ### Fixed
30
+
31
+ #### Zod discriminatedUnion Runtime Crash (Incomplete)
32
+
33
+ Fixed critical runtime error that crashed Node.js on module load:
34
+
35
+ ```
36
+ Error: Discriminator property type has duplicate value undefined
37
+ Error: A discriminator value for key `type` could not be extracted from all schema options
38
+ ```
39
+
40
+ **Root cause:** Orval-generated OpenAI Zod schemas had two bugs:
41
+ 1. Discriminator fields marked `.optional()` - allowing all variants to have `undefined` as the discriminator value
42
+ 2. Discriminator fields using `zod.string()` instead of `zod.enum()`/`zod.literal()` - Zod can't extract a literal discriminator from a generic string
43
+
44
+ **Fix:** Added two post-generation fixes in `scripts/fix-generated.js`:
45
+ - `fixDiscriminatedUnionOptionalDiscriminator`: Removes `.optional()` from discriminator fields
46
+ - Enhanced `fixDiscriminatedUnionMissingField`: Converts `discriminatedUnion` to `union` when discriminator uses `zod.string()`
47
+
48
+ **Affected schemas:** OpenAI Realtime API audio format and turn detection configs
49
+
50
+ ---
51
+
8
52
  ## [0.6.2] - 2026-01-12
9
53
 
10
54
  ### Added
@@ -20601,14 +20601,14 @@ var createRealtimeClientSecretBody = import_zod6.z.object({
20601
20601
  input: import_zod6.z.object({
20602
20602
  format: import_zod6.z.discriminatedUnion("type", [
20603
20603
  import_zod6.z.object({
20604
- type: import_zod6.z.enum(["audio/pcm"]).optional().describe("The audio format. Always `audio/pcm`."),
20604
+ type: import_zod6.z.enum(["audio/pcm"]).describe("The audio format. Always `audio/pcm`."),
20605
20605
  rate: import_zod6.z.literal(24e3).optional().describe("The sample rate of the audio. Always `24000`.")
20606
20606
  }).describe("The PCM audio format. Only a 24kHz sample rate is supported."),
20607
20607
  import_zod6.z.object({
20608
- type: import_zod6.z.enum(["audio/pcmu"]).optional().describe("The audio format. Always `audio/pcmu`.")
20608
+ type: import_zod6.z.enum(["audio/pcmu"]).describe("The audio format. Always `audio/pcmu`.")
20609
20609
  }).describe("The G.711 \u03BC-law format."),
20610
20610
  import_zod6.z.object({
20611
- type: import_zod6.z.enum(["audio/pcma"]).optional().describe("The audio format. Always `audio/pcma`.")
20611
+ type: import_zod6.z.enum(["audio/pcma"]).describe("The audio format. Always `audio/pcma`.")
20612
20612
  }).describe("The G.711 A-law format.")
20613
20613
  ]).optional(),
20614
20614
  transcription: import_zod6.z.object({
@@ -20631,13 +20631,13 @@ var createRealtimeClientSecretBody = import_zod6.z.object({
20631
20631
  )
20632
20632
  }).optional(),
20633
20633
  noise_reduction: import_zod6.z.object({
20634
- type: import_zod6.z.enum(["near_field", "far_field"]).optional().describe(
20634
+ type: import_zod6.z.enum(["near_field", "far_field"]).describe(
20635
20635
  "Type of noise reduction. `near_field` is for close-talking microphones such as headphones, `far_field` is for far-field microphones such as laptop or conference room microphones.\n"
20636
20636
  )
20637
20637
  }).optional().describe(
20638
20638
  "Configuration for input audio noise reduction. This can be set to `null` to turn off.\nNoise reduction filters audio added to the input audio buffer before it is sent to VAD and the model.\nFiltering the audio can improve VAD and turn detection accuracy (reducing false positives) and model performance by improving perception of the input audio.\n"
20639
20639
  ),
20640
- turn_detection: import_zod6.z.discriminatedUnion("type", [
20640
+ turn_detection: import_zod6.z.union([
20641
20641
  import_zod6.z.object({
20642
20642
  type: import_zod6.z.string().describe(
20643
20643
  "Type of turn detection, `server_vad` to turn on simple Server VAD.\n"
@@ -20700,14 +20700,14 @@ var createRealtimeClientSecretBody = import_zod6.z.object({
20700
20700
  output: import_zod6.z.object({
20701
20701
  format: import_zod6.z.discriminatedUnion("type", [
20702
20702
  import_zod6.z.object({
20703
- type: import_zod6.z.enum(["audio/pcm"]).optional().describe("The audio format. Always `audio/pcm`."),
20703
+ type: import_zod6.z.enum(["audio/pcm"]).describe("The audio format. Always `audio/pcm`."),
20704
20704
  rate: import_zod6.z.literal(24e3).optional().describe("The sample rate of the audio. Always `24000`.")
20705
20705
  }).describe("The PCM audio format. Only a 24kHz sample rate is supported."),
20706
20706
  import_zod6.z.object({
20707
- type: import_zod6.z.enum(["audio/pcmu"]).optional().describe("The audio format. Always `audio/pcmu`.")
20707
+ type: import_zod6.z.enum(["audio/pcmu"]).describe("The audio format. Always `audio/pcmu`.")
20708
20708
  }).describe("The G.711 \u03BC-law format."),
20709
20709
  import_zod6.z.object({
20710
- type: import_zod6.z.enum(["audio/pcma"]).optional().describe("The audio format. Always `audio/pcma`.")
20710
+ type: import_zod6.z.enum(["audio/pcma"]).describe("The audio format. Always `audio/pcma`.")
20711
20711
  }).describe("The G.711 A-law format.")
20712
20712
  ]).optional(),
20713
20713
  voice: import_zod6.z.string().or(
@@ -20750,9 +20750,9 @@ var createRealtimeClientSecretBody = import_zod6.z.object({
20750
20750
  "Realtime API can write session traces to the [Traces Dashboard](/logs?api=traces). Set to null to disable tracing. Once\ntracing is enabled for a session, the configuration cannot be modified.\n\n`auto` will create a trace for the session with default values for the\nworkflow name, group id, and metadata.\n"
20751
20751
  ),
20752
20752
  tools: import_zod6.z.array(
20753
- import_zod6.z.discriminatedUnion("type", [
20753
+ import_zod6.z.union([
20754
20754
  import_zod6.z.object({
20755
- type: import_zod6.z.enum(["function"]).optional().describe("The type of the tool, i.e. `function`."),
20755
+ type: import_zod6.z.enum(["function"]).describe("The type of the tool, i.e. `function`."),
20756
20756
  name: import_zod6.z.string().optional().describe("The name of the function."),
20757
20757
  description: import_zod6.z.string().optional().describe(
20758
20758
  "The description of the function, including guidance on when and how\nto call it, and guidance about what to tell the user when calling\n(if anything).\n"
@@ -20776,7 +20776,7 @@ var createRealtimeClientSecretBody = import_zod6.z.object({
20776
20776
  "connector_outlookcalendar",
20777
20777
  "connector_outlookemail",
20778
20778
  "connector_sharepoint"
20779
- ]).optional().describe(
20779
+ ]).describe(
20780
20780
  "Identifier for service connectors, like those available in ChatGPT. One of\n`server_url` or `connector_id` must be provided. Learn more about service\nconnectors [here](https://platform.openai.com/docs/guides/tools-remote-mcp#connectors).\n\nCurrently supported `connector_id` values are:\n\n- Dropbox: `connector_dropbox`\n- Gmail: `connector_gmail`\n- Google Calendar: `connector_googlecalendar`\n- Google Drive: `connector_googledrive`\n- Microsoft Teams: `connector_microsoftteams`\n- Outlook Calendar: `connector_outlookcalendar`\n- Outlook Email: `connector_outlookemail`\n- SharePoint: `connector_sharepoint`\n"
20781
20781
  ),
20782
20782
  authorization: import_zod6.z.string().optional().describe(
@@ -20910,14 +20910,14 @@ var createRealtimeClientSecretBody = import_zod6.z.object({
20910
20910
  input: import_zod6.z.object({
20911
20911
  format: import_zod6.z.discriminatedUnion("type", [
20912
20912
  import_zod6.z.object({
20913
- type: import_zod6.z.enum(["audio/pcm"]).optional().describe("The audio format. Always `audio/pcm`."),
20913
+ type: import_zod6.z.enum(["audio/pcm"]).describe("The audio format. Always `audio/pcm`."),
20914
20914
  rate: import_zod6.z.literal(24e3).optional().describe("The sample rate of the audio. Always `24000`.")
20915
20915
  }).describe("The PCM audio format. Only a 24kHz sample rate is supported."),
20916
20916
  import_zod6.z.object({
20917
- type: import_zod6.z.enum(["audio/pcmu"]).optional().describe("The audio format. Always `audio/pcmu`.")
20917
+ type: import_zod6.z.enum(["audio/pcmu"]).describe("The audio format. Always `audio/pcmu`.")
20918
20918
  }).describe("The G.711 \u03BC-law format."),
20919
20919
  import_zod6.z.object({
20920
- type: import_zod6.z.enum(["audio/pcma"]).optional().describe("The audio format. Always `audio/pcma`.")
20920
+ type: import_zod6.z.enum(["audio/pcma"]).describe("The audio format. Always `audio/pcma`.")
20921
20921
  }).describe("The G.711 A-law format.")
20922
20922
  ]).optional(),
20923
20923
  transcription: import_zod6.z.object({
@@ -20940,13 +20940,13 @@ var createRealtimeClientSecretBody = import_zod6.z.object({
20940
20940
  )
20941
20941
  }).optional(),
20942
20942
  noise_reduction: import_zod6.z.object({
20943
- type: import_zod6.z.enum(["near_field", "far_field"]).optional().describe(
20943
+ type: import_zod6.z.enum(["near_field", "far_field"]).describe(
20944
20944
  "Type of noise reduction. `near_field` is for close-talking microphones such as headphones, `far_field` is for far-field microphones such as laptop or conference room microphones.\n"
20945
20945
  )
20946
20946
  }).optional().describe(
20947
20947
  "Configuration for input audio noise reduction. This can be set to `null` to turn off.\nNoise reduction filters audio added to the input audio buffer before it is sent to VAD and the model.\nFiltering the audio can improve VAD and turn detection accuracy (reducing false positives) and model performance by improving perception of the input audio.\n"
20948
20948
  ),
20949
- turn_detection: import_zod6.z.discriminatedUnion("type", [
20949
+ turn_detection: import_zod6.z.union([
20950
20950
  import_zod6.z.object({
20951
20951
  type: import_zod6.z.string().describe(
20952
20952
  "Type of turn detection, `server_vad` to turn on simple Server VAD.\n"
@@ -21074,14 +21074,14 @@ var createRealtimeClientSecretResponse = import_zod6.z.object({
21074
21074
  input: import_zod6.z.object({
21075
21075
  format: import_zod6.z.discriminatedUnion("type", [
21076
21076
  import_zod6.z.object({
21077
- type: import_zod6.z.enum(["audio/pcm"]).optional().describe("The audio format. Always `audio/pcm`."),
21077
+ type: import_zod6.z.enum(["audio/pcm"]).describe("The audio format. Always `audio/pcm`."),
21078
21078
  rate: import_zod6.z.literal(24e3).optional().describe("The sample rate of the audio. Always `24000`.")
21079
21079
  }).describe("The PCM audio format. Only a 24kHz sample rate is supported."),
21080
21080
  import_zod6.z.object({
21081
- type: import_zod6.z.enum(["audio/pcmu"]).optional().describe("The audio format. Always `audio/pcmu`.")
21081
+ type: import_zod6.z.enum(["audio/pcmu"]).describe("The audio format. Always `audio/pcmu`.")
21082
21082
  }).describe("The G.711 \u03BC-law format."),
21083
21083
  import_zod6.z.object({
21084
- type: import_zod6.z.enum(["audio/pcma"]).optional().describe("The audio format. Always `audio/pcma`.")
21084
+ type: import_zod6.z.enum(["audio/pcma"]).describe("The audio format. Always `audio/pcma`.")
21085
21085
  }).describe("The G.711 A-law format.")
21086
21086
  ]).optional(),
21087
21087
  transcription: import_zod6.z.object({
@@ -21104,13 +21104,13 @@ var createRealtimeClientSecretResponse = import_zod6.z.object({
21104
21104
  )
21105
21105
  }).optional(),
21106
21106
  noise_reduction: import_zod6.z.object({
21107
- type: import_zod6.z.enum(["near_field", "far_field"]).optional().describe(
21107
+ type: import_zod6.z.enum(["near_field", "far_field"]).describe(
21108
21108
  "Type of noise reduction. `near_field` is for close-talking microphones such as headphones, `far_field` is for far-field microphones such as laptop or conference room microphones.\n"
21109
21109
  )
21110
21110
  }).optional().describe(
21111
21111
  "Configuration for input audio noise reduction. This can be set to `null` to turn off.\nNoise reduction filters audio added to the input audio buffer before it is sent to VAD and the model.\nFiltering the audio can improve VAD and turn detection accuracy (reducing false positives) and model performance by improving perception of the input audio.\n"
21112
21112
  ),
21113
- turn_detection: import_zod6.z.discriminatedUnion("type", [
21113
+ turn_detection: import_zod6.z.union([
21114
21114
  import_zod6.z.object({
21115
21115
  type: import_zod6.z.string().describe(
21116
21116
  "Type of turn detection, `server_vad` to turn on simple Server VAD.\n"
@@ -21173,14 +21173,14 @@ var createRealtimeClientSecretResponse = import_zod6.z.object({
21173
21173
  output: import_zod6.z.object({
21174
21174
  format: import_zod6.z.discriminatedUnion("type", [
21175
21175
  import_zod6.z.object({
21176
- type: import_zod6.z.enum(["audio/pcm"]).optional().describe("The audio format. Always `audio/pcm`."),
21176
+ type: import_zod6.z.enum(["audio/pcm"]).describe("The audio format. Always `audio/pcm`."),
21177
21177
  rate: import_zod6.z.literal(24e3).optional().describe("The sample rate of the audio. Always `24000`.")
21178
21178
  }).describe("The PCM audio format. Only a 24kHz sample rate is supported."),
21179
21179
  import_zod6.z.object({
21180
- type: import_zod6.z.enum(["audio/pcmu"]).optional().describe("The audio format. Always `audio/pcmu`.")
21180
+ type: import_zod6.z.enum(["audio/pcmu"]).describe("The audio format. Always `audio/pcmu`.")
21181
21181
  }).describe("The G.711 \u03BC-law format."),
21182
21182
  import_zod6.z.object({
21183
- type: import_zod6.z.enum(["audio/pcma"]).optional().describe("The audio format. Always `audio/pcma`.")
21183
+ type: import_zod6.z.enum(["audio/pcma"]).describe("The audio format. Always `audio/pcma`.")
21184
21184
  }).describe("The G.711 A-law format.")
21185
21185
  ]).optional(),
21186
21186
  voice: import_zod6.z.string().or(
@@ -21224,7 +21224,7 @@ var createRealtimeClientSecretResponse = import_zod6.z.object({
21224
21224
  ).or(import_zod6.z.null()).optional(),
21225
21225
  tools: import_zod6.z.array(
21226
21226
  import_zod6.z.object({
21227
- type: import_zod6.z.enum(["function"]).optional().describe("The type of the tool, i.e. `function`."),
21227
+ type: import_zod6.z.enum(["function"]).describe("The type of the tool, i.e. `function`."),
21228
21228
  name: import_zod6.z.string().optional().describe("The name of the function."),
21229
21229
  description: import_zod6.z.string().optional().describe(
21230
21230
  "The description of the function, including guidance on when and how\nto call it, and guidance about what to tell the user when calling\n(if anything).\n"
@@ -21248,7 +21248,7 @@ var createRealtimeClientSecretResponse = import_zod6.z.object({
21248
21248
  "connector_outlookcalendar",
21249
21249
  "connector_outlookemail",
21250
21250
  "connector_sharepoint"
21251
- ]).optional().describe(
21251
+ ]).describe(
21252
21252
  "Identifier for service connectors, like those available in ChatGPT. One of\n`server_url` or `connector_id` must be provided. Learn more about service\nconnectors [here](https://platform.openai.com/docs/guides/tools-remote-mcp#connectors).\n\nCurrently supported `connector_id` values are:\n\n- Dropbox: `connector_dropbox`\n- Gmail: `connector_gmail`\n- Google Calendar: `connector_googlecalendar`\n- Google Drive: `connector_googledrive`\n- Microsoft Teams: `connector_microsoftteams`\n- Outlook Calendar: `connector_outlookcalendar`\n- Outlook Email: `connector_outlookemail`\n- SharePoint: `connector_sharepoint`\n"
21253
21253
  ),
21254
21254
  authorization: import_zod6.z.string().optional().describe(
@@ -21392,14 +21392,14 @@ var createRealtimeClientSecretResponse = import_zod6.z.object({
21392
21392
  input: import_zod6.z.object({
21393
21393
  format: import_zod6.z.discriminatedUnion("type", [
21394
21394
  import_zod6.z.object({
21395
- type: import_zod6.z.enum(["audio/pcm"]).optional().describe("The audio format. Always `audio/pcm`."),
21395
+ type: import_zod6.z.enum(["audio/pcm"]).describe("The audio format. Always `audio/pcm`."),
21396
21396
  rate: import_zod6.z.literal(24e3).optional().describe("The sample rate of the audio. Always `24000`.")
21397
21397
  }).describe("The PCM audio format. Only a 24kHz sample rate is supported."),
21398
21398
  import_zod6.z.object({
21399
- type: import_zod6.z.enum(["audio/pcmu"]).optional().describe("The audio format. Always `audio/pcmu`.")
21399
+ type: import_zod6.z.enum(["audio/pcmu"]).describe("The audio format. Always `audio/pcmu`.")
21400
21400
  }).describe("The G.711 \u03BC-law format."),
21401
21401
  import_zod6.z.object({
21402
- type: import_zod6.z.enum(["audio/pcma"]).optional().describe("The audio format. Always `audio/pcma`.")
21402
+ type: import_zod6.z.enum(["audio/pcma"]).describe("The audio format. Always `audio/pcma`.")
21403
21403
  }).describe("The G.711 A-law format.")
21404
21404
  ]).optional(),
21405
21405
  transcription: import_zod6.z.object({
@@ -21422,7 +21422,7 @@ var createRealtimeClientSecretResponse = import_zod6.z.object({
21422
21422
  )
21423
21423
  }).optional(),
21424
21424
  noise_reduction: import_zod6.z.object({
21425
- type: import_zod6.z.enum(["near_field", "far_field"]).optional().describe(
21425
+ type: import_zod6.z.enum(["near_field", "far_field"]).describe(
21426
21426
  "Type of noise reduction. `near_field` is for close-talking microphones such as headphones, `far_field` is for far-field microphones such as laptop or conference room microphones.\n"
21427
21427
  )
21428
21428
  }).optional().describe("Configuration for input audio noise reduction.\n"),
@@ -21616,14 +21616,14 @@ var createRealtimeSessionResponse = import_zod6.z.object({
21616
21616
  input: import_zod6.z.object({
21617
21617
  format: import_zod6.z.discriminatedUnion("type", [
21618
21618
  import_zod6.z.object({
21619
- type: import_zod6.z.enum(["audio/pcm"]).optional().describe("The audio format. Always `audio/pcm`."),
21619
+ type: import_zod6.z.enum(["audio/pcm"]).describe("The audio format. Always `audio/pcm`."),
21620
21620
  rate: import_zod6.z.literal(24e3).optional().describe("The sample rate of the audio. Always `24000`.")
21621
21621
  }).describe("The PCM audio format. Only a 24kHz sample rate is supported."),
21622
21622
  import_zod6.z.object({
21623
- type: import_zod6.z.enum(["audio/pcmu"]).optional().describe("The audio format. Always `audio/pcmu`.")
21623
+ type: import_zod6.z.enum(["audio/pcmu"]).describe("The audio format. Always `audio/pcmu`.")
21624
21624
  }).describe("The G.711 \u03BC-law format."),
21625
21625
  import_zod6.z.object({
21626
- type: import_zod6.z.enum(["audio/pcma"]).optional().describe("The audio format. Always `audio/pcma`.")
21626
+ type: import_zod6.z.enum(["audio/pcma"]).describe("The audio format. Always `audio/pcma`.")
21627
21627
  }).describe("The G.711 A-law format.")
21628
21628
  ]).optional(),
21629
21629
  transcription: import_zod6.z.object({
@@ -21660,14 +21660,14 @@ var createRealtimeSessionResponse = import_zod6.z.object({
21660
21660
  output: import_zod6.z.object({
21661
21661
  format: import_zod6.z.discriminatedUnion("type", [
21662
21662
  import_zod6.z.object({
21663
- type: import_zod6.z.enum(["audio/pcm"]).optional().describe("The audio format. Always `audio/pcm`."),
21663
+ type: import_zod6.z.enum(["audio/pcm"]).describe("The audio format. Always `audio/pcm`."),
21664
21664
  rate: import_zod6.z.literal(24e3).optional().describe("The sample rate of the audio. Always `24000`.")
21665
21665
  }).describe("The PCM audio format. Only a 24kHz sample rate is supported."),
21666
21666
  import_zod6.z.object({
21667
- type: import_zod6.z.enum(["audio/pcmu"]).optional().describe("The audio format. Always `audio/pcmu`.")
21667
+ type: import_zod6.z.enum(["audio/pcmu"]).describe("The audio format. Always `audio/pcmu`.")
21668
21668
  }).describe("The G.711 \u03BC-law format."),
21669
21669
  import_zod6.z.object({
21670
- type: import_zod6.z.enum(["audio/pcma"]).optional().describe("The audio format. Always `audio/pcma`.")
21670
+ type: import_zod6.z.enum(["audio/pcma"]).describe("The audio format. Always `audio/pcma`.")
21671
21671
  }).describe("The G.711 A-law format.")
21672
21672
  ]).optional(),
21673
21673
  voice: import_zod6.z.string().or(
@@ -20550,14 +20550,14 @@ var createRealtimeClientSecretBody = zod6.object({
20550
20550
  input: zod6.object({
20551
20551
  format: zod6.discriminatedUnion("type", [
20552
20552
  zod6.object({
20553
- type: zod6.enum(["audio/pcm"]).optional().describe("The audio format. Always `audio/pcm`."),
20553
+ type: zod6.enum(["audio/pcm"]).describe("The audio format. Always `audio/pcm`."),
20554
20554
  rate: zod6.literal(24e3).optional().describe("The sample rate of the audio. Always `24000`.")
20555
20555
  }).describe("The PCM audio format. Only a 24kHz sample rate is supported."),
20556
20556
  zod6.object({
20557
- type: zod6.enum(["audio/pcmu"]).optional().describe("The audio format. Always `audio/pcmu`.")
20557
+ type: zod6.enum(["audio/pcmu"]).describe("The audio format. Always `audio/pcmu`.")
20558
20558
  }).describe("The G.711 \u03BC-law format."),
20559
20559
  zod6.object({
20560
- type: zod6.enum(["audio/pcma"]).optional().describe("The audio format. Always `audio/pcma`.")
20560
+ type: zod6.enum(["audio/pcma"]).describe("The audio format. Always `audio/pcma`.")
20561
20561
  }).describe("The G.711 A-law format.")
20562
20562
  ]).optional(),
20563
20563
  transcription: zod6.object({
@@ -20580,13 +20580,13 @@ var createRealtimeClientSecretBody = zod6.object({
20580
20580
  )
20581
20581
  }).optional(),
20582
20582
  noise_reduction: zod6.object({
20583
- type: zod6.enum(["near_field", "far_field"]).optional().describe(
20583
+ type: zod6.enum(["near_field", "far_field"]).describe(
20584
20584
  "Type of noise reduction. `near_field` is for close-talking microphones such as headphones, `far_field` is for far-field microphones such as laptop or conference room microphones.\n"
20585
20585
  )
20586
20586
  }).optional().describe(
20587
20587
  "Configuration for input audio noise reduction. This can be set to `null` to turn off.\nNoise reduction filters audio added to the input audio buffer before it is sent to VAD and the model.\nFiltering the audio can improve VAD and turn detection accuracy (reducing false positives) and model performance by improving perception of the input audio.\n"
20588
20588
  ),
20589
- turn_detection: zod6.discriminatedUnion("type", [
20589
+ turn_detection: zod6.union([
20590
20590
  zod6.object({
20591
20591
  type: zod6.string().describe(
20592
20592
  "Type of turn detection, `server_vad` to turn on simple Server VAD.\n"
@@ -20649,14 +20649,14 @@ var createRealtimeClientSecretBody = zod6.object({
20649
20649
  output: zod6.object({
20650
20650
  format: zod6.discriminatedUnion("type", [
20651
20651
  zod6.object({
20652
- type: zod6.enum(["audio/pcm"]).optional().describe("The audio format. Always `audio/pcm`."),
20652
+ type: zod6.enum(["audio/pcm"]).describe("The audio format. Always `audio/pcm`."),
20653
20653
  rate: zod6.literal(24e3).optional().describe("The sample rate of the audio. Always `24000`.")
20654
20654
  }).describe("The PCM audio format. Only a 24kHz sample rate is supported."),
20655
20655
  zod6.object({
20656
- type: zod6.enum(["audio/pcmu"]).optional().describe("The audio format. Always `audio/pcmu`.")
20656
+ type: zod6.enum(["audio/pcmu"]).describe("The audio format. Always `audio/pcmu`.")
20657
20657
  }).describe("The G.711 \u03BC-law format."),
20658
20658
  zod6.object({
20659
- type: zod6.enum(["audio/pcma"]).optional().describe("The audio format. Always `audio/pcma`.")
20659
+ type: zod6.enum(["audio/pcma"]).describe("The audio format. Always `audio/pcma`.")
20660
20660
  }).describe("The G.711 A-law format.")
20661
20661
  ]).optional(),
20662
20662
  voice: zod6.string().or(
@@ -20699,9 +20699,9 @@ var createRealtimeClientSecretBody = zod6.object({
20699
20699
  "Realtime API can write session traces to the [Traces Dashboard](/logs?api=traces). Set to null to disable tracing. Once\ntracing is enabled for a session, the configuration cannot be modified.\n\n`auto` will create a trace for the session with default values for the\nworkflow name, group id, and metadata.\n"
20700
20700
  ),
20701
20701
  tools: zod6.array(
20702
- zod6.discriminatedUnion("type", [
20702
+ zod6.union([
20703
20703
  zod6.object({
20704
- type: zod6.enum(["function"]).optional().describe("The type of the tool, i.e. `function`."),
20704
+ type: zod6.enum(["function"]).describe("The type of the tool, i.e. `function`."),
20705
20705
  name: zod6.string().optional().describe("The name of the function."),
20706
20706
  description: zod6.string().optional().describe(
20707
20707
  "The description of the function, including guidance on when and how\nto call it, and guidance about what to tell the user when calling\n(if anything).\n"
@@ -20725,7 +20725,7 @@ var createRealtimeClientSecretBody = zod6.object({
20725
20725
  "connector_outlookcalendar",
20726
20726
  "connector_outlookemail",
20727
20727
  "connector_sharepoint"
20728
- ]).optional().describe(
20728
+ ]).describe(
20729
20729
  "Identifier for service connectors, like those available in ChatGPT. One of\n`server_url` or `connector_id` must be provided. Learn more about service\nconnectors [here](https://platform.openai.com/docs/guides/tools-remote-mcp#connectors).\n\nCurrently supported `connector_id` values are:\n\n- Dropbox: `connector_dropbox`\n- Gmail: `connector_gmail`\n- Google Calendar: `connector_googlecalendar`\n- Google Drive: `connector_googledrive`\n- Microsoft Teams: `connector_microsoftteams`\n- Outlook Calendar: `connector_outlookcalendar`\n- Outlook Email: `connector_outlookemail`\n- SharePoint: `connector_sharepoint`\n"
20730
20730
  ),
20731
20731
  authorization: zod6.string().optional().describe(
@@ -20859,14 +20859,14 @@ var createRealtimeClientSecretBody = zod6.object({
20859
20859
  input: zod6.object({
20860
20860
  format: zod6.discriminatedUnion("type", [
20861
20861
  zod6.object({
20862
- type: zod6.enum(["audio/pcm"]).optional().describe("The audio format. Always `audio/pcm`."),
20862
+ type: zod6.enum(["audio/pcm"]).describe("The audio format. Always `audio/pcm`."),
20863
20863
  rate: zod6.literal(24e3).optional().describe("The sample rate of the audio. Always `24000`.")
20864
20864
  }).describe("The PCM audio format. Only a 24kHz sample rate is supported."),
20865
20865
  zod6.object({
20866
- type: zod6.enum(["audio/pcmu"]).optional().describe("The audio format. Always `audio/pcmu`.")
20866
+ type: zod6.enum(["audio/pcmu"]).describe("The audio format. Always `audio/pcmu`.")
20867
20867
  }).describe("The G.711 \u03BC-law format."),
20868
20868
  zod6.object({
20869
- type: zod6.enum(["audio/pcma"]).optional().describe("The audio format. Always `audio/pcma`.")
20869
+ type: zod6.enum(["audio/pcma"]).describe("The audio format. Always `audio/pcma`.")
20870
20870
  }).describe("The G.711 A-law format.")
20871
20871
  ]).optional(),
20872
20872
  transcription: zod6.object({
@@ -20889,13 +20889,13 @@ var createRealtimeClientSecretBody = zod6.object({
20889
20889
  )
20890
20890
  }).optional(),
20891
20891
  noise_reduction: zod6.object({
20892
- type: zod6.enum(["near_field", "far_field"]).optional().describe(
20892
+ type: zod6.enum(["near_field", "far_field"]).describe(
20893
20893
  "Type of noise reduction. `near_field` is for close-talking microphones such as headphones, `far_field` is for far-field microphones such as laptop or conference room microphones.\n"
20894
20894
  )
20895
20895
  }).optional().describe(
20896
20896
  "Configuration for input audio noise reduction. This can be set to `null` to turn off.\nNoise reduction filters audio added to the input audio buffer before it is sent to VAD and the model.\nFiltering the audio can improve VAD and turn detection accuracy (reducing false positives) and model performance by improving perception of the input audio.\n"
20897
20897
  ),
20898
- turn_detection: zod6.discriminatedUnion("type", [
20898
+ turn_detection: zod6.union([
20899
20899
  zod6.object({
20900
20900
  type: zod6.string().describe(
20901
20901
  "Type of turn detection, `server_vad` to turn on simple Server VAD.\n"
@@ -21023,14 +21023,14 @@ var createRealtimeClientSecretResponse = zod6.object({
21023
21023
  input: zod6.object({
21024
21024
  format: zod6.discriminatedUnion("type", [
21025
21025
  zod6.object({
21026
- type: zod6.enum(["audio/pcm"]).optional().describe("The audio format. Always `audio/pcm`."),
21026
+ type: zod6.enum(["audio/pcm"]).describe("The audio format. Always `audio/pcm`."),
21027
21027
  rate: zod6.literal(24e3).optional().describe("The sample rate of the audio. Always `24000`.")
21028
21028
  }).describe("The PCM audio format. Only a 24kHz sample rate is supported."),
21029
21029
  zod6.object({
21030
- type: zod6.enum(["audio/pcmu"]).optional().describe("The audio format. Always `audio/pcmu`.")
21030
+ type: zod6.enum(["audio/pcmu"]).describe("The audio format. Always `audio/pcmu`.")
21031
21031
  }).describe("The G.711 \u03BC-law format."),
21032
21032
  zod6.object({
21033
- type: zod6.enum(["audio/pcma"]).optional().describe("The audio format. Always `audio/pcma`.")
21033
+ type: zod6.enum(["audio/pcma"]).describe("The audio format. Always `audio/pcma`.")
21034
21034
  }).describe("The G.711 A-law format.")
21035
21035
  ]).optional(),
21036
21036
  transcription: zod6.object({
@@ -21053,13 +21053,13 @@ var createRealtimeClientSecretResponse = zod6.object({
21053
21053
  )
21054
21054
  }).optional(),
21055
21055
  noise_reduction: zod6.object({
21056
- type: zod6.enum(["near_field", "far_field"]).optional().describe(
21056
+ type: zod6.enum(["near_field", "far_field"]).describe(
21057
21057
  "Type of noise reduction. `near_field` is for close-talking microphones such as headphones, `far_field` is for far-field microphones such as laptop or conference room microphones.\n"
21058
21058
  )
21059
21059
  }).optional().describe(
21060
21060
  "Configuration for input audio noise reduction. This can be set to `null` to turn off.\nNoise reduction filters audio added to the input audio buffer before it is sent to VAD and the model.\nFiltering the audio can improve VAD and turn detection accuracy (reducing false positives) and model performance by improving perception of the input audio.\n"
21061
21061
  ),
21062
- turn_detection: zod6.discriminatedUnion("type", [
21062
+ turn_detection: zod6.union([
21063
21063
  zod6.object({
21064
21064
  type: zod6.string().describe(
21065
21065
  "Type of turn detection, `server_vad` to turn on simple Server VAD.\n"
@@ -21122,14 +21122,14 @@ var createRealtimeClientSecretResponse = zod6.object({
21122
21122
  output: zod6.object({
21123
21123
  format: zod6.discriminatedUnion("type", [
21124
21124
  zod6.object({
21125
- type: zod6.enum(["audio/pcm"]).optional().describe("The audio format. Always `audio/pcm`."),
21125
+ type: zod6.enum(["audio/pcm"]).describe("The audio format. Always `audio/pcm`."),
21126
21126
  rate: zod6.literal(24e3).optional().describe("The sample rate of the audio. Always `24000`.")
21127
21127
  }).describe("The PCM audio format. Only a 24kHz sample rate is supported."),
21128
21128
  zod6.object({
21129
- type: zod6.enum(["audio/pcmu"]).optional().describe("The audio format. Always `audio/pcmu`.")
21129
+ type: zod6.enum(["audio/pcmu"]).describe("The audio format. Always `audio/pcmu`.")
21130
21130
  }).describe("The G.711 \u03BC-law format."),
21131
21131
  zod6.object({
21132
- type: zod6.enum(["audio/pcma"]).optional().describe("The audio format. Always `audio/pcma`.")
21132
+ type: zod6.enum(["audio/pcma"]).describe("The audio format. Always `audio/pcma`.")
21133
21133
  }).describe("The G.711 A-law format.")
21134
21134
  ]).optional(),
21135
21135
  voice: zod6.string().or(
@@ -21173,7 +21173,7 @@ var createRealtimeClientSecretResponse = zod6.object({
21173
21173
  ).or(zod6.null()).optional(),
21174
21174
  tools: zod6.array(
21175
21175
  zod6.object({
21176
- type: zod6.enum(["function"]).optional().describe("The type of the tool, i.e. `function`."),
21176
+ type: zod6.enum(["function"]).describe("The type of the tool, i.e. `function`."),
21177
21177
  name: zod6.string().optional().describe("The name of the function."),
21178
21178
  description: zod6.string().optional().describe(
21179
21179
  "The description of the function, including guidance on when and how\nto call it, and guidance about what to tell the user when calling\n(if anything).\n"
@@ -21197,7 +21197,7 @@ var createRealtimeClientSecretResponse = zod6.object({
21197
21197
  "connector_outlookcalendar",
21198
21198
  "connector_outlookemail",
21199
21199
  "connector_sharepoint"
21200
- ]).optional().describe(
21200
+ ]).describe(
21201
21201
  "Identifier for service connectors, like those available in ChatGPT. One of\n`server_url` or `connector_id` must be provided. Learn more about service\nconnectors [here](https://platform.openai.com/docs/guides/tools-remote-mcp#connectors).\n\nCurrently supported `connector_id` values are:\n\n- Dropbox: `connector_dropbox`\n- Gmail: `connector_gmail`\n- Google Calendar: `connector_googlecalendar`\n- Google Drive: `connector_googledrive`\n- Microsoft Teams: `connector_microsoftteams`\n- Outlook Calendar: `connector_outlookcalendar`\n- Outlook Email: `connector_outlookemail`\n- SharePoint: `connector_sharepoint`\n"
21202
21202
  ),
21203
21203
  authorization: zod6.string().optional().describe(
@@ -21341,14 +21341,14 @@ var createRealtimeClientSecretResponse = zod6.object({
21341
21341
  input: zod6.object({
21342
21342
  format: zod6.discriminatedUnion("type", [
21343
21343
  zod6.object({
21344
- type: zod6.enum(["audio/pcm"]).optional().describe("The audio format. Always `audio/pcm`."),
21344
+ type: zod6.enum(["audio/pcm"]).describe("The audio format. Always `audio/pcm`."),
21345
21345
  rate: zod6.literal(24e3).optional().describe("The sample rate of the audio. Always `24000`.")
21346
21346
  }).describe("The PCM audio format. Only a 24kHz sample rate is supported."),
21347
21347
  zod6.object({
21348
- type: zod6.enum(["audio/pcmu"]).optional().describe("The audio format. Always `audio/pcmu`.")
21348
+ type: zod6.enum(["audio/pcmu"]).describe("The audio format. Always `audio/pcmu`.")
21349
21349
  }).describe("The G.711 \u03BC-law format."),
21350
21350
  zod6.object({
21351
- type: zod6.enum(["audio/pcma"]).optional().describe("The audio format. Always `audio/pcma`.")
21351
+ type: zod6.enum(["audio/pcma"]).describe("The audio format. Always `audio/pcma`.")
21352
21352
  }).describe("The G.711 A-law format.")
21353
21353
  ]).optional(),
21354
21354
  transcription: zod6.object({
@@ -21371,7 +21371,7 @@ var createRealtimeClientSecretResponse = zod6.object({
21371
21371
  )
21372
21372
  }).optional(),
21373
21373
  noise_reduction: zod6.object({
21374
- type: zod6.enum(["near_field", "far_field"]).optional().describe(
21374
+ type: zod6.enum(["near_field", "far_field"]).describe(
21375
21375
  "Type of noise reduction. `near_field` is for close-talking microphones such as headphones, `far_field` is for far-field microphones such as laptop or conference room microphones.\n"
21376
21376
  )
21377
21377
  }).optional().describe("Configuration for input audio noise reduction.\n"),
@@ -21565,14 +21565,14 @@ var createRealtimeSessionResponse = zod6.object({
21565
21565
  input: zod6.object({
21566
21566
  format: zod6.discriminatedUnion("type", [
21567
21567
  zod6.object({
21568
- type: zod6.enum(["audio/pcm"]).optional().describe("The audio format. Always `audio/pcm`."),
21568
+ type: zod6.enum(["audio/pcm"]).describe("The audio format. Always `audio/pcm`."),
21569
21569
  rate: zod6.literal(24e3).optional().describe("The sample rate of the audio. Always `24000`.")
21570
21570
  }).describe("The PCM audio format. Only a 24kHz sample rate is supported."),
21571
21571
  zod6.object({
21572
- type: zod6.enum(["audio/pcmu"]).optional().describe("The audio format. Always `audio/pcmu`.")
21572
+ type: zod6.enum(["audio/pcmu"]).describe("The audio format. Always `audio/pcmu`.")
21573
21573
  }).describe("The G.711 \u03BC-law format."),
21574
21574
  zod6.object({
21575
- type: zod6.enum(["audio/pcma"]).optional().describe("The audio format. Always `audio/pcma`.")
21575
+ type: zod6.enum(["audio/pcma"]).describe("The audio format. Always `audio/pcma`.")
21576
21576
  }).describe("The G.711 A-law format.")
21577
21577
  ]).optional(),
21578
21578
  transcription: zod6.object({
@@ -21609,14 +21609,14 @@ var createRealtimeSessionResponse = zod6.object({
21609
21609
  output: zod6.object({
21610
21610
  format: zod6.discriminatedUnion("type", [
21611
21611
  zod6.object({
21612
- type: zod6.enum(["audio/pcm"]).optional().describe("The audio format. Always `audio/pcm`."),
21612
+ type: zod6.enum(["audio/pcm"]).describe("The audio format. Always `audio/pcm`."),
21613
21613
  rate: zod6.literal(24e3).optional().describe("The sample rate of the audio. Always `24000`.")
21614
21614
  }).describe("The PCM audio format. Only a 24kHz sample rate is supported."),
21615
21615
  zod6.object({
21616
- type: zod6.enum(["audio/pcmu"]).optional().describe("The audio format. Always `audio/pcmu`.")
21616
+ type: zod6.enum(["audio/pcmu"]).describe("The audio format. Always `audio/pcmu`.")
21617
21617
  }).describe("The G.711 \u03BC-law format."),
21618
21618
  zod6.object({
21619
- type: zod6.enum(["audio/pcma"]).optional().describe("The audio format. Always `audio/pcma`.")
21619
+ type: zod6.enum(["audio/pcma"]).describe("The audio format. Always `audio/pcma`.")
21620
21620
  }).describe("The G.711 A-law format.")
21621
21621
  ]).optional(),
21622
21622
  voice: zod6.string().or(