Skip to content

Conversation

HavenDV
Copy link
Contributor

@HavenDV HavenDV commented Sep 10, 2025

Summary by CodeRabbit

  • New Features
    • Introduced GA session and transcription session objects with expanded configuration (audio input/output options, output modalities, tool choice/tools, tracing, turn detection, max output tokens, includes).
  • Refactor
    • Public APIs now reference GA session objects, replacing legacy session responses.
    • Narrowed allowed realtime client events; removed the “transcription session created” server event.
  • Documentation
    • Refined session/update descriptions and added note that idle turn detection may emit a timeout_triggered event.
    • Minor terminology and formatting improvements for clarity.

Copy link

coderabbitai bot commented Sep 10, 2025

Walkthrough

Replaced prerelease session schemas with GA variants in the OpenAPI spec, removed two public event schemas, adjusted anyOf references to GA types, removed one client event type, tweaked descriptions (including idle turn-detection notes), and dropped a const metadata flag.

Changes

Cohort / File(s) Summary of changes
GA session schemas added
src/libs/tryAGI.OpenAI/openapi.yaml
Added RealtimeSessionCreateResponseGA and RealtimeTranscriptionSessionCreateResponseGA schemas with expanded configuration (audio, include, tracing, turn_detection, etc.).
Session refs updated to GA
src/libs/tryAGI.OpenAI/openapi.yaml
Updated anyOf session configuration references to GA schemas, replacing RealtimeSessionCreateResponse and RealtimeTranscriptionSessionCreateResponse.
Event schema removals
src/libs/tryAGI.OpenAI/openapi.yaml
Removed RealtimeClientEventTranscriptionSessionUpdate and RealtimeServerEventTranscriptionSessionCreated from public schemas.
Metadata and enum adjustments
src/libs/tryAGI.OpenAI/openapi.yaml
Added GA naming metadata (x-oaiMeta); removed x-stainless-const: true from a content field; maintained include enums (e.g., item.input_audio_transcription.logprobs).
Docs/description tweaks
src/libs/tryAGI.OpenAI/openapi.yaml
Reformatted session-update description; enhanced idle turn-detection description to note possible timeout_triggered emission.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Client
  participant API as Realtime API

  rect rgb(235, 245, 255)
    note over Client,API: GA session creation flow
    Client->>API: POST /sessions (create)
    alt Standard session
      API-->>Client: 201 RealtimeSessionCreateResponseGA
    else Transcription session
      API-->>Client: 201 RealtimeTranscriptionSessionCreateResponseGA
    end
  end

  rect rgb(245, 235, 255)
    note over Client,API: Session lifecycle events
    Client->>API: WebSocket subscribe
    API-->>Client: ...updates (e.g., TranscriptionSessionUpdated)
    note right of API: "Created" event removed from public stream
    opt Idle turn detection
      API-->>Client: timeout_triggered (on idle threshold)
    end
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Pre-merge checks (2 passed, 1 warning)

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Title Check ⚠️ Warning The current title “feat:@coderabbitai” fails to describe the substantive changes in the pull request, which involve adding GA variants for session-create schemas, removing deprecated events, and updating metadata in the OpenAPI specification. It references a username rather than summarizing the PR’s content, making it unclear to reviewers and teammates scanning the commit history. Because it does not highlight the main change or context, it does not meet the criteria for a concise and descriptive title. Please rename the pull request to a concise title that reflects the primary update, for example “feat(openapi): introduce GA session-create/transcription schemas and remove deprecated realtime events”, so that the change’s intent is immediately clear to reviewers.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.

Poem

I thump my paws at GA dawn,
Old sprouts pruned, new schemas drawn.
Events hop past—creation’s gone—
Updates nibble, carry on.
When silence grows, a timeout squeaks,
And into fields of YAML tweaks,
I bound through docs with tidy cheeks.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch bot/update-openapi_202509101515

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@HavenDV HavenDV merged commit 73d0cdd into main Sep 10, 2025
2 of 4 checks passed
@HavenDV HavenDV deleted the bot/update-openapi_202509101515 branch September 10, 2025 15:16
@coderabbitai coderabbitai bot changed the title feat:@coderabbitai feat:Adopt GA session schemas; remove event schemas; update OpenAPI refs Sep 10, 2025
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/libs/tryAGI.OpenAI/openapi.yaml (1)

24582-24590: GA session schema needs a concrete type (and likely object) to satisfy discriminator and const semantics.

required: [client_secret, type] is declared, but type isn’t defined in properties (as shown). Add a constant type: "realtime"; consider also const-encoding object: "realtime.session".

Apply:

     RealtimeSessionCreateResponseGA:
       required:
         - client_secret
         - type
       type: object
       properties:
+        type:
+          type: string
+          enum: [realtime]
+          description: The type of session. Always `realtime` for realtime sessions.
+          x-stainless-const: true
+        object:
+          type: string
+          enum: [realtime.session]
+          description: The object type. Always `realtime.session`.
+          x-stainless-const: true
         audio:

Also verify client_secret is actually returned by this endpoint; if not, drop it from required.

🧹 Nitpick comments (1)
src/libs/tryAGI.OpenAI/openapi.yaml (1)

24450-24582: Non-GA and GA session objects coexist; consider deprecating or removing the old one.

If nothing references RealtimeSessionCreateResponse anymore, mark it deprecated or remove it to avoid confusion and accidental use.

I can search the repo to confirm references before you remove it.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4110026 and 7f037be.

⛔ Files ignored due to path filters (79)
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI..JsonSerializerContext.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.RealtimeClientEvent.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.RealtimeSessionCreateResponseGAAudioInputTurnDetectionEagerness.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.RealtimeSessionCreateResponseGAAudioInputTurnDetectionEagernessNullable.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.RealtimeSessionCreateResponseGAAudioInputTurnDetectionType.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.RealtimeSessionCreateResponseGAAudioInputTurnDetectionTypeNullable.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.RealtimeSessionCreateResponseGAIncludeItem.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.RealtimeSessionCreateResponseGAIncludeItemNullable.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.RealtimeSessionCreateResponseGAMaxOutputTokens.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.RealtimeSessionCreateResponseGAMaxOutputTokensNullable.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.RealtimeSessionCreateResponseGAModel.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.RealtimeSessionCreateResponseGAModelNullable.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.RealtimeSessionCreateResponseGAOutputModalitie.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.RealtimeSessionCreateResponseGAOutputModalitieNullable.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.RealtimeSessionCreateResponseGATracingEnum.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.RealtimeSessionCreateResponseGATracingEnumNullable.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.RealtimeSessionCreateResponseGAType.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.RealtimeSessionCreateResponseGATypeNullable.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.RealtimeTranscriptionSessionCreateResponseGAIncludeItem.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.RealtimeTranscriptionSessionCreateResponseGAIncludeItemNullable.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.RealtimeTranscriptionSessionCreateResponseGAType.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.RealtimeTranscriptionSessionCreateResponseGATypeNullable.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.Session2.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonSerializerContextTypes.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeClientEvent.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeClientEventSessionUpdate.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeServerEventTranscriptionSessionCreated.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeSessionCreateRequestGAAudioInputTurnDetection.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeSessionCreateResponse.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeSessionCreateResponseAudio.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeSessionCreateResponseAudioInput.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeSessionCreateResponseAudioInputNoiseReduction.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeSessionCreateResponseAudioInputTurnDetection.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeSessionCreateResponseAudioOutput.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeSessionCreateResponseGA.Json.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeSessionCreateResponseGA.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeSessionCreateResponseGAAudio.Json.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeSessionCreateResponseGAAudio.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeSessionCreateResponseGAAudioInput.Json.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeSessionCreateResponseGAAudioInput.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeSessionCreateResponseGAAudioInputNoiseReduction.Json.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeSessionCreateResponseGAAudioInputNoiseReduction.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeSessionCreateResponseGAAudioInputTurnDetection.Json.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeSessionCreateResponseGAAudioInputTurnDetection.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeSessionCreateResponseGAAudioInputTurnDetectionEagerness.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeSessionCreateResponseGAAudioInputTurnDetectionType.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeSessionCreateResponseGAAudioOutput.Json.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeSessionCreateResponseGAAudioOutput.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeSessionCreateResponseGAClientSecret.Json.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeSessionCreateResponseGAClientSecret.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeSessionCreateResponseGAIncludeItem.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeSessionCreateResponseGAMaxOutputTokens.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeSessionCreateResponseGAModel.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeSessionCreateResponseGAOutputModalitie.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeSessionCreateResponseGATracingEnum.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeSessionCreateResponseGATracingEnum2.Json.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeSessionCreateResponseGATracingEnum2.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeSessionCreateResponseGATracingEnumMetadata.Json.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeSessionCreateResponseGATracingEnumMetadata.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeSessionCreateResponseGAType.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeSessionCreateResponseOutputModalities.Json.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeSessionCreateResponseOutputModalities.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeSessionCreateResponseTracingEnum2.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeSessionCreateResponseTracingEnumMetadata.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeSessionCreateResponseTurnDetection.Json.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeSessionCreateResponseTurnDetection.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeTranscriptionSessionCreateResponseGA.Json.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeTranscriptionSessionCreateResponseGA.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeTranscriptionSessionCreateResponseGAAudio.Json.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeTranscriptionSessionCreateResponseGAAudio.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeTranscriptionSessionCreateResponseGAAudioInput.Json.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeTranscriptionSessionCreateResponseGAAudioInput.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeTranscriptionSessionCreateResponseGAAudioInputNoiseReduction.Json.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeTranscriptionSessionCreateResponseGAAudioInputNoiseReduction.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeTranscriptionSessionCreateResponseGAAudioInputTurnDetection.Json.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeTranscriptionSessionCreateResponseGAAudioInputTurnDetection.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeTranscriptionSessionCreateResponseGAIncludeItem.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.RealtimeTranscriptionSessionCreateResponseGAType.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.Session2.g.cs is excluded by !**/generated/**
📒 Files selected for processing (1)
  • src/libs/tryAGI.OpenAI/openapi.yaml (6 hunks)
🔇 Additional comments (3)
src/libs/tryAGI.OpenAI/openapi.yaml (3)

24319-24319: New event mention: verify timeout_triggered is defined.

You now document an emitted timeout_triggered event. Ensure a corresponding event schema/name exists elsewhere, or rename here to match the actual event.

Would you like me to search and list where this event is (or isn’t) defined across the spec?


24622-24622: Repeat of new event mention: verify timeout_triggered exists.

Same concern as earlier idle-timeout description: ensure the event is defined and consistently named.


24955-24957: Validate RealtimeAudioFormats supports string literal pcm16 used in example.

The example uses "format": "pcm16", while other examples show an object form. Please confirm #/components/schemas/RealtimeAudioFormats permits the string variant and includes pcm16.

If not, align the example or widen the schema (e.g., oneOf string enum | object form).

Also applies to: 25006-25006

description: 'The event type, must be `session.update`.'
x-stainless-const: true
description: "Send this event to update the session’s configuration.\nThe client may send this event at any time to update any field\nexcept for `voice` and `model`. `voice` can be updated only if there have been no other\naudio outputs yet. \n\nWhen the server receives a `session.update`, it will respond\nwith a `session.updated` event showing the full, effective configuration.\nOnly the fields that are present in the `session.update` are updated. To clear a field like\n`instructions`, pass an empty string. To clear a field like `tools`, pass an empty array.\nTo clear a field like `turn_detection`, pass `null`.\n"
description: "Send this event to update the session’s configuration.\nThe client may send this event at any time to update any field\nexcept for `voice` and `model`. `voice` can be updated only if there have been no other audio outputs yet.\n\nWhen the server receives a `session.update`, it will respond\nwith a `session.updated` event showing the full, effective configuration.\nOnly the fields that are present in the `session.update` are updated. To clear a field like\n`instructions`, pass an empty string. To clear a field like `tools`, pass an empty array.\nTo clear a field like `turn_detection`, pass `null`.\n"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Doc says you can clear turn_detection with null, but schema doesn’t allow null.

The description instructs clients to send turn_detection: null, yet the schema blocks nulls (no nullable: true). This will break clients/codegen.

Follow-up: See suggested fixes on Lines 24561-24576 and 24966-24981 to mark these fields nullable.

🤖 Prompt for AI Agents
In src/libs/tryAGI.OpenAI/openapi.yaml around line 21728, the documentation
tells clients to send turn_detection: null but the schema does not permit nulls;
update the OpenAPI schema by adding nullable: true (or using type: ['object',
'null'] where appropriate) to the turn_detection property definitions referenced
in the file and to the other occurrences indicated around lines 24561-24576 and
24966-24981 so the field accepts null; ensure any component/schema definitions
and request/response examples remain consistent with the nullable change.

Comment on lines +22211 to 22215
- $ref: '#/components/schemas/RealtimeSessionCreateResponseGA'
- $ref: '#/components/schemas/RealtimeTranscriptionSessionCreateResponseGA'
description: "The session configuration for either a realtime or transcription session.\n"
discriminator:
propertyName: type
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Discriminator likely broken: GA “session” schema lacks a concrete type value + no mapping.

discriminator.propertyName: type is set, but RealtimeSessionCreateResponseGA appears to not define a type property/value, while the transcription GA variant does. Add a constant type: "realtime" and explicit discriminator mapping.

Apply:

           discriminator:
             propertyName: type
+            mapping:
+              realtime: '#/components/schemas/RealtimeSessionCreateResponseGA'
+              transcription: '#/components/schemas/RealtimeTranscriptionSessionCreateResponseGA'

And add type in the GA session schema (see Lines 24582-24590 comment).

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- $ref: '#/components/schemas/RealtimeSessionCreateResponseGA'
- $ref: '#/components/schemas/RealtimeTranscriptionSessionCreateResponseGA'
description: "The session configuration for either a realtime or transcription session.\n"
discriminator:
propertyName: type
discriminator:
propertyName: type
mapping:
realtime: '#/components/schemas/RealtimeSessionCreateResponseGA'
transcription: '#/components/schemas/RealtimeTranscriptionSessionCreateResponseGA'
🤖 Prompt for AI Agents
In src/libs/tryAGI.OpenAI/openapi.yaml around lines 22211-22215 (and update the
GA session schema at lines ~24582-24590), the discriminator is misconfigured:
discriminator.propertyName is set to "type" but RealtimeSessionCreateResponseGA
does not declare a constant type value and there's no mapping entry. Fix by
adding a required, constant property type: "realtime" to the
RealtimeSessionCreateResponseGA schema, and add an explicit
discriminator.mapping entry mapping the discriminator value "realtime" to the
RealtimeSessionCreateResponseGA component (e.g.,
"#/components/schemas/RealtimeSessionCreateResponseGA") so the OAS discriminator
can resolve the subtype correctly.

Comment on lines +24561 to +24576
turn_detection:
type: object
properties:
prefix_padding_ms:
type: integer
description: "Amount of audio to include before the VAD detected speech (in\nmilliseconds). Defaults to 300ms.\n"
silence_duration_ms:
type: integer
description: "Duration of silence to detect speech stop (in milliseconds). Defaults\nto 500ms. With shorter values the model will respond more quickly,\nbut may jump in on short pauses from the user.\n"
threshold:
type: number
description: "Activation threshold for VAD (0.0 to 1.0), this defaults to 0.5. A\nhigher threshold will require louder audio to activate the model, and\nthus might perform better in noisy environments.\n"
type:
type: string
description: "Type of turn detection, only `server_vad` is currently supported.\n"
description: "Configuration for turn detection. Can be set to `null` to turn off. Server\nVAD means that the model will detect the start and end of speech based on\naudio volume and respond at the end of user speech.\n"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Schema-Doc mismatch: allow null for turn_detection and add bounds for threshold.

  • Description: “Can be set to null to turn off.” But nullable isn’t set.
  • threshold is described as 0.0–1.0; encode that as min/max for better validation.

Apply:

         turn_detection:
           type: object
+          nullable: true
           properties:
             prefix_padding_ms:
               type: integer
             silence_duration_ms:
               type: integer
             threshold:
               type: number
+              minimum: 0
+              maximum: 1
             type:
               type: string
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
turn_detection:
type: object
properties:
prefix_padding_ms:
type: integer
description: "Amount of audio to include before the VAD detected speech (in\nmilliseconds). Defaults to 300ms.\n"
silence_duration_ms:
type: integer
description: "Duration of silence to detect speech stop (in milliseconds). Defaults\nto 500ms. With shorter values the model will respond more quickly,\nbut may jump in on short pauses from the user.\n"
threshold:
type: number
description: "Activation threshold for VAD (0.0 to 1.0), this defaults to 0.5. A\nhigher threshold will require louder audio to activate the model, and\nthus might perform better in noisy environments.\n"
type:
type: string
description: "Type of turn detection, only `server_vad` is currently supported.\n"
description: "Configuration for turn detection. Can be set to `null` to turn off. Server\nVAD means that the model will detect the start and end of speech based on\naudio volume and respond at the end of user speech.\n"
turn_detection:
type: object
nullable: true
properties:
prefix_padding_ms:
type: integer
silence_duration_ms:
type: integer
threshold:
type: number
minimum: 0
maximum: 1
type:
type: string
🤖 Prompt for AI Agents
In src/libs/tryAGI.OpenAI/openapi.yaml around lines 24561 to 24576, the schema
for turn_detection incorrectly omits nullable and the threshold lacks numeric
bounds; update the turn_detection property to include nullable: true (or
explicitly allow ["object","null"] if using oneOf/anyOf style) so it can be set
to null as described, and add minimum: 0.0 and maximum: 1.0 to the threshold
property (ensuring type: number/float) to enforce the documented 0.0–1.0 range.

description: "Configuration for turn detection. Can be set to `null` to turn off. Server\nVAD means that the model will detect the start and end of speech based on\naudio volume and respond at the end of user speech.\n"
description: "A Realtime session configuration object.\n"
x-oaiMeta:
example: "{\n \"id\": \"sess_001\",\n \"object\": \"realtime.session\",\n \"expires_at\": 1742188264,\n \"model\": \"gpt-realtime\",\n \"output_modalities\": [\"audio\"],\n \"instructions\": \"You are a friendly assistant.\",\n \"tools\": [],\n \"tool_choice\": \"none\",\n \"max_output_tokens\": \"inf\",\n \"tracing\": \"auto\",\n \"truncation\": \"auto\",\n \"prompt\": null,\n \"audio\": {\n \"input\": {\n \"format\": {\n \"type\": \"audio/pcm\",\n \"rate\": 24000\n },\n \"transcription\": { \"model\": \"whisper-1\" },\n \"noise_reduction\": null,\n \"turn_detection\": null\n },\n \"output\": {\n \"format\": {\n \"type\": \"audio/pcm\",\n \"rate\": 24000\n },\n \"voice\": \"alloy\",\n \"speed\": 1.0\n }\n }\n}\n"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Example contains fields not in schema (truncation, prompt).

The example JSON shows truncation and prompt which aren’t defined in this schema block. This will confuse users and can fail example validation.

Apply:

-  "truncation": "auto",
-  "prompt": null,

(Or add these fields to the schema if they are intended.)

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
example: "{\n \"id\": \"sess_001\",\n \"object\": \"realtime.session\",\n \"expires_at\": 1742188264,\n \"model\": \"gpt-realtime\",\n \"output_modalities\": [\"audio\"],\n \"instructions\": \"You are a friendly assistant.\",\n \"tools\": [],\n \"tool_choice\": \"none\",\n \"max_output_tokens\": \"inf\",\n \"tracing\": \"auto\",\n \"truncation\": \"auto\",\n \"prompt\": null,\n \"audio\": {\n \"input\": {\n \"format\": {\n \"type\": \"audio/pcm\",\n \"rate\": 24000\n },\n \"transcription\": { \"model\": \"whisper-1\" },\n \"noise_reduction\": null,\n \"turn_detection\": null\n },\n \"output\": {\n \"format\": {\n \"type\": \"audio/pcm\",\n \"rate\": 24000\n },\n \"voice\": \"alloy\",\n \"speed\": 1.0\n }\n }\n}\n"
- "truncation": "auto",
- "prompt": null,
🤖 Prompt for AI Agents
In src/libs/tryAGI.OpenAI/openapi.yaml around line 24579, the example JSON
includes fields "truncation" and "prompt" that are not defined in the
corresponding schema; remove those fields from the example to match the schema,
or if they are intended properties, add "truncation" and/or "prompt" definitions
to the schema (with appropriate types and descriptions) and update any required
lists so the example validates against the schema.

Comment on lines +24966 to +24981
type: object
properties:
prefix_padding_ms:
type: integer
description: "Amount of audio to include before the VAD detected speech (in\nmilliseconds). Defaults to 300ms.\n"
silence_duration_ms:
type: integer
description: "Duration of silence to detect speech stop (in milliseconds). Defaults\nto 500ms. With shorter values the model will respond more quickly,\nbut may jump in on short pauses from the user.\n"
threshold:
type: number
description: "Activation threshold for VAD (0.0 to 1.0), this defaults to 0.5. A\nhigher threshold will require louder audio to activate the model, and\nthus might perform better in noisy environments.\n"
type:
type: string
description: "Type of turn detection, only `server_vad` is currently supported.\n"
description: "Configuration for turn detection. Can be set to `null` to turn off. Server\nVAD means that the model will detect the start and end of speech based on\naudio volume and respond at the end of user speech.\n"
description: "Configuration for input audio for the session.\n"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Transcription GA: allow null for turn_detection and add bounds for threshold.

Mirror the realtime session changes: set nullable: true and encode 0–1 range.

Apply:

         turn_detection:
           type: object
+          nullable: true
           properties:
             prefix_padding_ms:
               type: integer
             silence_duration_ms:
               type: integer
             threshold:
               type: number
+              minimum: 0
+              maximum: 1
             type:
               type: string
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
type: object
properties:
prefix_padding_ms:
type: integer
description: "Amount of audio to include before the VAD detected speech (in\nmilliseconds). Defaults to 300ms.\n"
silence_duration_ms:
type: integer
description: "Duration of silence to detect speech stop (in milliseconds). Defaults\nto 500ms. With shorter values the model will respond more quickly,\nbut may jump in on short pauses from the user.\n"
threshold:
type: number
description: "Activation threshold for VAD (0.0 to 1.0), this defaults to 0.5. A\nhigher threshold will require louder audio to activate the model, and\nthus might perform better in noisy environments.\n"
type:
type: string
description: "Type of turn detection, only `server_vad` is currently supported.\n"
description: "Configuration for turn detection. Can be set to `null` to turn off. Server\nVAD means that the model will detect the start and end of speech based on\naudio volume and respond at the end of user speech.\n"
description: "Configuration for input audio for the session.\n"
turn_detection:
type: object
nullable: true
properties:
prefix_padding_ms:
type: integer
silence_duration_ms:
type: integer
threshold:
type: number
minimum: 0
maximum: 1
type:
type: string
🤖 Prompt for AI Agents
In src/libs/tryAGI.OpenAI/openapi.yaml around lines 24966 to 24981, the
transcription GA schema needs to allow null for the turn_detection field and
enforce a 0–1 range for the threshold; change the turn_detection property to
include nullable: true and add minimum: 0 and maximum: 1 (or inclusive bounds
appropriate to your schema flavor) under the threshold property so the OpenAPI
spec mirrors the realtime session behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant