Skip to content

feat:Add speakers and mapping fields to speaker identification schema#158

Merged
HavenDV merged 1 commit intomainfrom
bot/update-openapi_202603110442
Mar 11, 2026
Merged

feat:Add speakers and mapping fields to speaker identification schema#158
HavenDV merged 1 commit intomainfrom
bot/update-openapi_202603110442

Conversation

@HavenDV
Copy link
Contributor

@HavenDV HavenDV commented Mar 11, 2026

Summary by CodeRabbit

  • New Features
    • Speaker identification now supports providing speaker context with metadata (name, role, description) for enhanced identification accuracy.
    • Speaker identification results now include a mapping that correlates generic speaker labels to identified speaker names and roles.

@HavenDV HavenDV merged commit df142fa into main Mar 11, 2026
2 of 4 checks passed
@HavenDV HavenDV deleted the bot/update-openapi_202603110442 branch March 11, 2026 04:43
@coderabbitai
Copy link

coderabbitai bot commented Mar 11, 2026

Walkthrough

Modified OpenAPI schema definitions for speaker identification, adding a speakers array field to capture speaker metadata in requests and a mapping object field to represent speaker label mappings in responses.

Changes

Cohort / File(s) Summary
OpenAPI Schema Enhancement
src/libs/AssemblyAI/openapi.yaml
Added speakers field to SpeakerIdentificationRequestBody (array of speaker objects with role, name, description metadata) and mapping field to SpeakerIdentificationResponse (object mapping generic speaker labels to identified names/roles).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰✨ With speakers added and mappings in place,
The labels now have an identifying face!
From A and B to names so clear,
Speaker identification's future is here! 🎙️

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 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 changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title Check ✅ Passed Title check skipped as CodeRabbit has written the PR title.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

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

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.

@coderabbitai coderabbitai bot changed the title feat:@coderabbitai feat:Add speakers and mapping fields to speaker identification schema Mar 11, 2026
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

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/libs/AssemblyAI/openapi.yaml`:
- Around line 6136-6151: The speakers item schema allows empty objects; make the
item require either role or name by replacing the current properties block with
a oneOf that enforces required fields: one schema object requiring ["role"] and
another requiring ["name"] (both keep description/additionalProperties as
needed), so each speaker item must include at least role or name; this change
will tighten the OpenAPI schema for "speakers" and cause the generated model
AssemblyAI.Models.SpeakerIdentificationRequestBodySpeakerIdentificationSpeaker
to reflect the required constraint rather than allowing both fields to be
nullable.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: deffca6a-7a3d-4765-ad29-2352f7727038

📥 Commits

Reviewing files that changed from the base of the PR and between 01a0611 and 4f1d871.

⛔ Files ignored due to path filters (7)
  • src/libs/AssemblyAI/Generated/AssemblyAI.JsonSerializerContextTypes.g.cs is excluded by !**/generated/**
  • src/libs/AssemblyAI/Generated/AssemblyAI.Models.SpeakerIdentificationRequestBodySpeakerIdentification.g.cs is excluded by !**/generated/**
  • src/libs/AssemblyAI/Generated/AssemblyAI.Models.SpeakerIdentificationRequestBodySpeakerIdentificationSpeaker.Json.g.cs is excluded by !**/generated/**
  • src/libs/AssemblyAI/Generated/AssemblyAI.Models.SpeakerIdentificationRequestBodySpeakerIdentificationSpeaker.g.cs is excluded by !**/generated/**
  • src/libs/AssemblyAI/Generated/AssemblyAI.Models.SpeakerIdentificationResponseSpeakerIdentification.g.cs is excluded by !**/generated/**
  • src/libs/AssemblyAI/Generated/AssemblyAI.Models.SpeakerIdentificationResponseSpeakerIdentificationMapping.Json.g.cs is excluded by !**/generated/**
  • src/libs/AssemblyAI/Generated/AssemblyAI.Models.SpeakerIdentificationResponseSpeakerIdentificationMapping.g.cs is excluded by !**/generated/**
📒 Files selected for processing (1)
  • src/libs/AssemblyAI/openapi.yaml

Comment on lines +6136 to +6151
speakers:
type: array
description: An array of speaker objects with metadata to improve identification accuracy. Each object should include a `role` or `name` (depending on `speaker_type`) and an optional `description` to help the model identify the speaker. You can also include any additional custom properties (e.g., `company`, `title`) to provide more context. Use this as an alternative to `known_values` when you want to provide additional context about each speaker.
items:
type: object
properties:
role:
type: string
description: The role of the speaker. Required when `speaker_type` is "role".
name:
type: string
description: The name of the speaker. Required when `speaker_type` is "name".
description:
type: string
description: A description of the speaker to help the model identify them based on conversational context.
additionalProperties: true
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Model the speaker-item requirement in the schema.

Each speakers item is currently valid even when it is just {}, because neither role nor name is required. That mismatch already flows into the generated SDK model (src/libs/AssemblyAI/Generated/AssemblyAI.Models.SpeakerIdentificationRequestBodySpeakerIdentificationSpeaker.g.cs:9-32), where both fields are nullable, so invalid payloads won’t be caught until the API rejects them.

Suggested schema tightening
             speakers:
               type: array
               description: An array of speaker objects with metadata to improve identification accuracy. Each object should include a `role` or `name` (depending on `speaker_type`) and an optional `description` to help the model identify the speaker. You can also include any additional custom properties (e.g., `company`, `title`) to provide more context. Use this as an alternative to `known_values` when you want to provide additional context about each speaker.
               items:
                 type: object
                 properties:
                   role:
                     type: string
                     description: The role of the speaker. Required when `speaker_type` is "role".
                   name:
                     type: string
                     description: The name of the speaker. Required when `speaker_type` is "name".
                   description:
                     type: string
                     description: A description of the speaker to help the model identify them based on conversational context.
+                oneOf:
+                  - required: [role]
+                  - required: [name]
                 additionalProperties: true
📝 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
speakers:
type: array
description: An array of speaker objects with metadata to improve identification accuracy. Each object should include a `role` or `name` (depending on `speaker_type`) and an optional `description` to help the model identify the speaker. You can also include any additional custom properties (e.g., `company`, `title`) to provide more context. Use this as an alternative to `known_values` when you want to provide additional context about each speaker.
items:
type: object
properties:
role:
type: string
description: The role of the speaker. Required when `speaker_type` is "role".
name:
type: string
description: The name of the speaker. Required when `speaker_type` is "name".
description:
type: string
description: A description of the speaker to help the model identify them based on conversational context.
additionalProperties: true
speakers:
type: array
description: An array of speaker objects with metadata to improve identification accuracy. Each object should include a `role` or `name` (depending on `speaker_type`) and an optional `description` to help the model identify the speaker. You can also include any additional custom properties (e.g., `company`, `title`) to provide more context. Use this as an alternative to `known_values` when you want to provide additional context about each speaker.
items:
type: object
properties:
role:
type: string
description: The role of the speaker. Required when `speaker_type` is "role".
name:
type: string
description: The name of the speaker. Required when `speaker_type` is "name".
description:
type: string
description: A description of the speaker to help the model identify them based on conversational context.
oneOf:
- required: [role]
- required: [name]
additionalProperties: true
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/libs/AssemblyAI/openapi.yaml` around lines 6136 - 6151, The speakers item
schema allows empty objects; make the item require either role or name by
replacing the current properties block with a oneOf that enforces required
fields: one schema object requiring ["role"] and another requiring ["name"]
(both keep description/additionalProperties as needed), so each speaker item
must include at least role or name; this change will tighten the OpenAPI schema
for "speakers" and cause the generated model
AssemblyAI.Models.SpeakerIdentificationRequestBodySpeakerIdentificationSpeaker
to reflect the required constraint rather than allowing both fields to be
nullable.

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