feat:Add language_detection_options to Transcript schemas in OpenAPI#124
feat:Add language_detection_options to Transcript schemas in OpenAPI#124
Conversation
WalkthroughAdds 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
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
✨ Finishing Touches🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
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 invalidobjects:keys withitems:The verification scripts confirmed that there are still two occurrences of the incorrect
objects:key under array definitions, which must be renamed toitems: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: stringNo other issues were detected with the bracketed
["auto"]guidance or thex-labelonexpected_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: TranscriptLanguageCodeAlso 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.
⛔ Files ignored due to path filters (5)
src/libs/AssemblyAI/Generated/AssemblyAI.JsonSerializerContextTypes.g.csis excluded by!**/generated/**src/libs/AssemblyAI/Generated/AssemblyAI.Models.Transcript.g.csis excluded by!**/generated/**src/libs/AssemblyAI/Generated/AssemblyAI.Models.TranscriptLanguageDetectionOptions.Json.g.csis excluded by!**/generated/**src/libs/AssemblyAI/Generated/AssemblyAI.Models.TranscriptLanguageDetectionOptions.g.csis excluded by!**/generated/**src/libs/AssemblyAI/Generated/AssemblyAI.Models.TranscriptOptionalParamsLanguageDetectionOptions.g.csis excluded by!**/generated/**
📒 Files selected for processing (1)
src/libs/AssemblyAI/openapi.yaml(2 hunks)
| 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" | ||
|
|
There was a problem hiding this comment.
🛠️ Refactor suggestion
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.
| 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.
Summary by CodeRabbit