Skip to content

Conversation

@HavenDV
Copy link
Contributor

@HavenDV HavenDV commented Aug 27, 2025

Summary by CodeRabbit

  • New Features
    • Introduced configurable language detection options for transcripts, allowing you to specify expected languages and a fallback language.
    • Defaults: expected languages to “all” when unspecified; fallback language to “auto” (automatically selects the best match from expected languages).
  • Documentation
    • Clarified defaults for expected languages within the new language detection options.
  • Chores
    • Extended the public API schema to expose the new language detection configuration without changing existing endpoints or behavior.

@coderabbitai
Copy link

coderabbitai bot commented Aug 27, 2025

Walkthrough

Adds a new language_detection_options object to the Transcript and TranscriptOptionalParams schemas in src/libs/AssemblyAI/openapi.yaml, defining expected_languages and fallback_language with defaults, descriptions, and additionalProperties: false. No endpoint changes; updates are schema-level additions.

Changes

Cohort / File(s) Summary
Schema: Language detection options
src/libs/AssemblyAI/openapi.yaml
Added language_detection_options to components/schemas/Transcript and TranscriptOptionalParams with properties expected_languages (array, defaults to ["all"]) and fallback_language (string, default "auto"); enforced additionalProperties: false; updated descriptions to mention defaults.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

A bunny nibbles specs by night,
Adds options neat, both clear and light.
Languages lined, a fallback too,
YAML meadows, fresh and new.
Hop—constraints set, no extras stray,
Schema fields now lead the way. 🐇✨

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

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 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 e6bc237 into main Aug 27, 2025
2 of 4 checks passed
@HavenDV HavenDV deleted the bot/update-openapi_202508271519 branch August 27, 2025 15:20
@coderabbitai coderabbitai bot changed the title feat:@coderabbitai feat:Add language_detection_options to Transcript schemas in OpenAPI Aug 27, 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: 1

Caution

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

⚠️ Outside diff range comments (2)
src/libs/AssemblyAI/openapi.yaml (2)

1262-1275: Fix OpenAPI array schema and text errors (items vs objects; label; "auto" formatting).

  • OpenAPI arrays use "items", not "objects" — this breaks validation and codegen.
  • x-label is copy/paste incorrect (“Minimum speakers expected”) for expected_languages.
  • fallback_language description wrongly says ["auto"] despite being a string; should be "auto".

Apply:

           properties:
             expected_languages:
-              x-label: Minimum speakers expected
-              description: List of languages expected in the audio file. Defaults to `["all"]` when unspecified.
+              x-label: Expected languages
+              description: List of languages expected in the audio file. Defaults to `["all"]` when unspecified.
               type: array
-              objects:
+              items:
                 x-label: language
                 type: string
             fallback_language:
               x-label: Fallback language
               description: |
-                If the detected language of the audio file is not in the list of expected languages, the `fallback_language` is used. Specify `["auto"]` to let our model choose the fallback language from `expected_languages` with the highest confidence score.
+                If the detected language of the audio file is not in the list of expected languages, the `fallback_language` is used. Specify `"auto"` to let our model choose the fallback language from `expected_languages` with the highest confidence score.
               type: string
               default: "auto"

1256-1275: Replace invalid objects: keys with items:

The verification scripts confirmed that there are still two occurrences of the incorrect objects: key under array definitions, which must be renamed to items: to conform with the OpenAPI spec:

• src/libs/AssemblyAI/openapi.yaml, lines 1264–1268 (under language_detection_options.properties.expected_languages)
• src/libs/AssemblyAI/openapi.yaml, lines 2655–2659 (same snippet in the 2647–2666 region)

Suggested diff:

--- a/src/libs/AssemblyAI/openapi.yaml
+++ b/src/libs/AssemblyAI/openapi.yaml
@@ -1264,7 +1264,7 @@
               description: List of languages expected in the audio file. Defaults to `["all"]` when unspecified.
               type: array
-              objects:
+              items:
                 x-label: language
                 type: string
@@ -2655,7 +2655,7 @@
               description: List of languages expected in the audio file. Defaults to `["all"]` when unspecified.
               type: array
-              objects:
+              items:
                 x-label: language
                 type: string

No other issues were detected with the bracketed ["auto"] guidance or the x-label on expected_languages. Please apply these fixes to ensure valid OpenAPI syntax.

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

1256-1275: Optional: add explicit defaults and stronger typing for SDKs.

  • Consider default: ["all"] on expected_languages to match docs.
  • Consider constraining types like language_code: allow enum or free-form string.
             expected_languages:
               x-label: Expected languages
               description: List of languages expected in the audio file. Defaults to `["all"]` when unspecified.
               type: array
+              default: ["all"]
               items:
-                x-label: language
-                type: string
+                x-label: language
+                anyOf:
+                  - $ref: "#/components/schemas/TranscriptLanguageCode"
+                  - type: string
+                x-ts-type: LiteralUnion<TranscriptLanguageCode, string>
+                x-go-type: TranscriptLanguageCode

Also applies to: 2647-2666

📜 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 f679407 and 76bc456.

⛔ Files ignored due to path filters (5)
  • src/libs/AssemblyAI/Generated/AssemblyAI.JsonSerializerContextTypes.g.cs is excluded by !**/generated/**
  • src/libs/AssemblyAI/Generated/AssemblyAI.Models.Transcript.g.cs is excluded by !**/generated/**
  • src/libs/AssemblyAI/Generated/AssemblyAI.Models.TranscriptLanguageDetectionOptions.Json.g.cs is excluded by !**/generated/**
  • src/libs/AssemblyAI/Generated/AssemblyAI.Models.TranscriptLanguageDetectionOptions.g.cs is excluded by !**/generated/**
  • src/libs/AssemblyAI/Generated/AssemblyAI.Models.TranscriptOptionalParamsLanguageDetectionOptions.g.cs is excluded by !**/generated/**
📒 Files selected for processing (1)
  • src/libs/AssemblyAI/openapi.yaml (2 hunks)

Comment on lines +2647 to +2666
language_detection_options:
x-label: Specify options for Automatic Language Detection.
description: Specify options for Automatic Language Detection.
type: object
additionalProperties: false
properties:
expected_languages:
x-label: Minimum speakers expected
description: List of languages expected in the audio file. Defaults to `["all"]` when unspecified.
type: array
objects:
x-label: language
type: string
fallback_language:
x-label: Fallback language
description: |
If the detected language of the audio file is not in the list of expected languages, the `fallback_language` is used. Specify `["auto"]` to let our model choose the fallback language from `expected_languages` with the highest confidence score.
type: string
default: "auto"

Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

⚠️ Potential issue

Same schema issues in Transcript: replace "objects" with "items", fix label and "auto" text.

Mirror the fixes in the response shape to keep request/response symmetric and valid.

         language_detection_options:
           x-label: Specify options for Automatic Language Detection.
           description: Specify options for Automatic Language Detection.
           type: object
           additionalProperties: false
           properties:
             expected_languages:
-              x-label: Minimum speakers expected
+              x-label: Expected languages
               description: List of languages expected in the audio file. Defaults to `["all"]` when unspecified.
               type: array
-              objects:
+              items:
                 x-label: language
                 type: string
             fallback_language:
               x-label: Fallback language
               description: |
-                If the detected language of the audio file is not in the list of expected languages, the `fallback_language` is used. Specify `["auto"]` to let our model choose the fallback language from `expected_languages` with the highest confidence score.
+                If the detected language of the audio file is not in the list of expected languages, the `fallback_language` is used. Specify `"auto"` to let our model choose the fallback language from `expected_languages` with the highest confidence score.
               type: string
               default: "auto"
📝 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
language_detection_options:
x-label: Specify options for Automatic Language Detection.
description: Specify options for Automatic Language Detection.
type: object
additionalProperties: false
properties:
expected_languages:
x-label: Minimum speakers expected
description: List of languages expected in the audio file. Defaults to `["all"]` when unspecified.
type: array
objects:
x-label: language
type: string
fallback_language:
x-label: Fallback language
description: |
If the detected language of the audio file is not in the list of expected languages, the `fallback_language` is used. Specify `["auto"]` to let our model choose the fallback language from `expected_languages` with the highest confidence score.
type: string
default: "auto"
language_detection_options:
x-label: Specify options for Automatic Language Detection.
description: Specify options for Automatic Language Detection.
type: object
additionalProperties: false
properties:
expected_languages:
x-label: Expected languages
description: List of languages expected in the audio file. Defaults to `["all"]` when unspecified.
type: array
items:
x-label: language
type: string
fallback_language:
x-label: Fallback language
description: |
If the detected language of the audio file is not in the list of expected languages, the `fallback_language` is used. Specify `"auto"` to let our model choose the fallback language from `expected_languages` with the highest confidence score.
type: string
default: "auto"
🤖 Prompt for AI Agents
In src/libs/AssemblyAI/openapi.yaml around lines 2647 to 2666, the
language_detection_options schema is invalid and asymmetric: change the
expected_languages property from using "objects" to "items" (items.type:
string), correct the x-labels (use a clear label like "language" for array items
and "Expected languages" for the array), and update the fallback_language
default/text to a plain string value (auto) and its x-label to "Fallback
language"; apply the identical fixes to the corresponding response schema so
request/response shapes remain symmetric and valid.

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