Skip to content

Conversation

@HavenDV
Copy link
Contributor

@HavenDV HavenDV commented Sep 2, 2025

Summary by CodeRabbit

  • New Features

    • Added audio input support alongside text and images (mp3 and wav).
    • Introduced a new request format for audio using an input_audio object with data and format fields.
  • Documentation

    • Updated tool connector examples to reference SharePoint.
    • Corrected webhook example JSON to use valid double-quoted keys and strings.

@coderabbitai
Copy link

coderabbitai bot commented Sep 2, 2025

Walkthrough

Adds InputAudio schema and integrates it into allowed input types and the inputs array. Refactors InputAudio to nest data/format under input_audio with required fields updated. Updates Tools description to reference SharePoint. Fixes webhook example JSON to use double quotes.

Changes

Cohort / File(s) Summary
Audio input schema and integration
src/libs/tryAGI.OpenAI/openapi.yaml
Added InputAudio schema; restructured schema to nest data/format under input_audio with updated required fields; included InputAudio in allowed input content types; updated inputs array title and items to include InputAudio.
Tools description update
src/libs/tryAGI.OpenAI/openapi.yaml
Replaced Notion with SharePoint in MCP Tools example description.
Webhook example JSON formatting
src/libs/tryAGI.OpenAI/openapi.yaml
Converted single-quoted JSON in webhook example to double-quoted JSON.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Client
  participant API as OpenAI-compatible API
  participant Model as Model Runtime

  Note over Client,API: Submit inputs including optional input_audio (mp3/wav)

  Client->>API: POST /... with inputs [text|image|audio]
  API->>API: Validate schema (input_audio.data, .format)
  API->>Model: Dispatch request with mixed inputs
  Model-->>API: Processed output (text/other)
  API-->>Client: Response

  alt Invalid audio format/data
    API-->>Client: 4xx validation error
  end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

I twitch an ear at sounds anew,
mp3s and wavs hop through—how true! 🎧
In fields of YAML I nibble neat,
Double quotes make JSON sweet.
SharePoint trails where Notion flew—
Fresh inputs bloom; I bound on cue. 🐇

✨ 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_202509022112

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@HavenDV HavenDV merged commit 90c3805 into main Sep 2, 2025
2 of 4 checks passed
@HavenDV HavenDV deleted the bot/update-openapi_202509022112 branch September 2, 2025 21:14
@coderabbitai coderabbitai bot changed the title feat:@coderabbitai feat:Add and refactor InputAudio schema; update Tools and webhook JSON Sep 2, 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: 2

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

16641-16655: Tighten schema: add format: byte and a property description.

  • Mark base64 with format: byte for better tooling.
  • Add a short description to input_audio.

Apply:

       input_audio:
+        description: "Audio payload and format."
         required:
           - data
           - format
         type: object
         properties:
           data:
             type: string
+            format: byte
             description: "Base64-encoded audio data.\n"
           format:
             enum:
               - mp3
               - wav
             type: string
             description: "The format of the audio data. Currently supported formats are `mp3` and
 `wav`.\n"

16656-16658: Align with other discriminated types: make type const.

Other input_* schemas set x-stainless-const: true on type. Add it here for consistency and better codegen.

       type:
         enum:
           - input_audio
+        x-stainless-const: true

16669-16671: Add discriminator mapping for input_audio.

Explicit mapping improves client generation when multiple schemas share the discriminator.

       discriminator:
         propertyName: type
+        mapping:
+          input_audio: '#/components/schemas/InputAudio'
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 22cb9bc and dbe1a4d.

⛔ Files ignored due to path filters (15)
  • src/libs/tryAGI.OpenAI/Generated/AnyOf.6.Json.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/AnyOf.6.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI..JsonSerializerContext.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.AnyOf6.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.InputAudioInputAudio1Format.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.InputAudioInputAudio1FormatNullable.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.JsonConverters.InputContent.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.EvalItem.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.InputAudio.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.InputAudioInputAudio1.Json.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.InputAudioInputAudio1.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.InputAudioInputAudio1Format.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.InputContent.g.cs is excluded by !**/generated/**
  • src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.ResponseProperties.g.cs is excluded by !**/generated/**
📒 Files selected for processing (1)
  • src/libs/tryAGI.OpenAI/openapi.yaml (5 hunks)
🔇 Additional comments (2)
src/libs/tryAGI.OpenAI/openapi.yaml (2)

14272-14275: Make sure arrays can carry audio items too.

You added InputAudio to the union and updated the array title/description. Please verify that the array branch’s items.oneOf also includes InputAudio; otherwise arrays of inputs won’t accept audio elements.


24472-24472: Docs-only change LGTM.

SharePoint mention and links read well. No structural OpenAPI impact.

Comment on lines +16635 to 16639
title: Input audio
required:
- type
- data
- format
- input_audio
type: object
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Avoid a breaking change: accept both nested and legacy flat shapes.

Refactoring data/format under input_audio breaks existing clients. Consider accepting both shapes and deprecating the flat one.

-      required:
-        - type
-        - input_audio
+      oneOf:
+        - required: [type, input_audio]
+        - required: [type, data, format]  # legacy
       type: object
       properties:
         input_audio:
           required:
             - data
             - format
           type: object
           properties:
             data:
               type: string
               format: byte
               description: "Base64-encoded audio data.\n"
             format:
               enum:
                 - mp3
                 - wav
               type: string
               description: "The format of the audio data. Currently supported formats are `mp3` and
 `wav`.\n"
+        # Legacy flat shape (deprecated)
+        data:
+          deprecated: true
+          type: string
+          format: byte
+          description: "Deprecated: use input_audio.data."
+        format:
+          deprecated: true
+          type: string
+          enum: [mp3, wav]
+          description: "Deprecated: use input_audio.format."

Also applies to: 16641-16655

🤖 Prompt for AI Agents
In src/libs/tryAGI.OpenAI/openapi.yaml around lines 16635-16639 and 16641-16655,
the schema change for input_audio is breaking clients that still send the legacy
flat shape; update the OpenAPI schema to accept both the new nested shape and
the old flat shape (use oneOf/anyOf or nullable/alternate properties) and add a
deprecation note for the flat shape, then update the server-side request
handling to detect the legacy flat payload and transform it into the nested
format before further processing, and include example payloads for both variants
in the spec.

Comment on lines 28873 to +28875
description: "Sent when Realtime API Receives a incoming SIP call.\n"
x-oaiMeta:
example: "{\n \"id\": \"evt_abc123\",\n \"type\": \"realtime.call.incoming\",\n \"created_at\": 1719168000,\n \"data\": {\n \"call_id\": \"rtc_479a275623b54bdb9b6fbae2f7cbd408\",\n \"sip_headers\": [\n {'name': 'Max-Forwards', 'value': '63'},\n {'name': 'CSeq', 'value': '851287 INVITE'},\n {'name': 'Content-Type', 'value': 'application/sdp'},\n ]\n }\n}\n"
example: "{\n \"id\": \"evt_abc123\",\n \"type\": \"realtime.call.incoming\",\n \"created_at\": 1719168000,\n \"data\": {\n \"call_id\": \"rtc_479a275623b54bdb9b6fbae2f7cbd408\",\n \"sip_headers\": [\n {\"name\": \"Max-Forwards\", \"value\": \"63\"},\n {\"name\": \"CSeq\", \"value\": \"851287 INVITE\"},\n {\"name\": \"Content-Type\", \"value\": \"application/sdp\"},\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

Fix grammar and invalid JSON (trailing comma).

  • “Receives a incoming” → “receives an incoming”.
  • Remove trailing comma after the last element in sip_headers to make the JSON valid.
-      description: "Sent when Realtime API Receives a incoming SIP call.\n"
+      description: "Sent when the Realtime API receives an incoming SIP call.\n"
@@
-        example: "{\n  \"id\": \"evt_abc123\",\n  \"type\": \"realtime.call.incoming\",\n  \"created_at\": 1719168000,\n  \"data\": {\n    \"call_id\": \"rtc_479a275623b54bdb9b6fbae2f7cbd408\",\n    \"sip_headers\": [\n      {\"name\": \"Max-Forwards\", \"value\": \"63\"},\n      {\"name\": \"CSeq\", \"value\": \"851287 INVITE\"},\n      {\"name\": \"Content-Type\", \"value\": \"application/sdp\"},\n    ]\n  }\n}\n"
+        example: "{\n  \"id\": \"evt_abc123\",\n  \"type\": \"realtime.call.incoming\",\n  \"created_at\": 1719168000,\n  \"data\": {\n    \"call_id\": \"rtc_479a275623b54bdb9b6fbae2f7cbd408\",\n    \"sip_headers\": [\n      {\"name\": \"Max-Forwards\", \"value\": \"63\"},\n      {\"name\": \"CSeq\", \"value\": \"851287 INVITE\"},\n      {\"name\": \"Content-Type\", \"value\": \"application/sdp\"}\n    ]\n  }\n}\n"
📝 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
description: "Sent when Realtime API Receives a incoming SIP call.\n"
x-oaiMeta:
example: "{\n \"id\": \"evt_abc123\",\n \"type\": \"realtime.call.incoming\",\n \"created_at\": 1719168000,\n \"data\": {\n \"call_id\": \"rtc_479a275623b54bdb9b6fbae2f7cbd408\",\n \"sip_headers\": [\n {'name': 'Max-Forwards', 'value': '63'},\n {'name': 'CSeq', 'value': '851287 INVITE'},\n {'name': 'Content-Type', 'value': 'application/sdp'},\n ]\n }\n}\n"
example: "{\n \"id\": \"evt_abc123\",\n \"type\": \"realtime.call.incoming\",\n \"created_at\": 1719168000,\n \"data\": {\n \"call_id\": \"rtc_479a275623b54bdb9b6fbae2f7cbd408\",\n \"sip_headers\": [\n {\"name\": \"Max-Forwards\", \"value\": \"63\"},\n {\"name\": \"CSeq\", \"value\": \"851287 INVITE\"},\n {\"name\": \"Content-Type\", \"value\": \"application/sdp\"},\n ]\n }\n}\n"
description: "Sent when the Realtime API receives an incoming SIP call.\n"
example: "{\n \"id\": \"evt_abc123\",\n \"type\": \"realtime.call.incoming\",\n \"created_at\": 1719168000,\n \"data\": {\n \"call_id\": \"rtc_479a275623b54bdb9b6fbae2f7cbd408\",\n \"sip_headers\": [\n {\"name\": \"Max-Forwards\", \"value\": \"63\"},\n {\"name\": \"CSeq\", \"value\": \"851287 INVITE\"},\n {\"name\": \"Content-Type\", \"value\": \"application/sdp\"}\n ]\n }\n}\n"
🤖 Prompt for AI Agents
In src/libs/tryAGI.OpenAI/openapi.yaml around lines 28873 to 28875, fix the
grammar and invalid JSON in the example: change the phrase “Receives a incoming”
to “receives an incoming” (or “receives an incoming request” if more context
desired) and remove the trailing comma after the last element in the sip_headers
array so the JSON parses correctly; update the YAML snippet accordingly to
reflect these edits.

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.

2 participants