Skip to content

Conversation

@HavenDV
Copy link
Contributor

@HavenDV HavenDV commented Aug 1, 2025

Summary by CodeRabbit

  • New Features

    • Expanded support for task parameters, allowing users to provide either transcript IDs or input text as input.
    • Added configurable options for model selection, output size, and temperature control.
  • Bug Fixes

    • Improved schema clarity by explicitly listing all available parameters for task creation.
  • Documentation

    • Updated example usage and parameter descriptions for better guidance.

@coderabbitai
Copy link

coderabbitai bot commented Aug 1, 2025

Walkthrough

The schema for LemurTaskParams in the OpenAPI specification was updated by removing inheritance from LemurBaseParams and explicitly declaring all relevant properties within LemurTaskParams. Additional fields were added, required fields were updated, and the example was modified to reflect these changes.

Changes

Cohort / File(s) Change Summary
OpenAPI Schema Update
src/libs/AssemblyAI/openapi.yaml
Expanded LemurTaskParams schema to include properties from LemurBaseParams; removed inheritance; updated required fields and example.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐇
In the fields of YAML, I hop with glee,
Merging base and task for all to see.
No more inheritance, just properties clear,
Prompt and model—now both required here.
With transcripts or text, the schema’s anew,
Oh, what a lovely update to review!

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

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.
    • Explain this complex logic.
    • 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. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • 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 src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

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

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

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

Documentation and Community

  • 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 enabled auto-merge (squash) August 1, 2025 02:00
@coderabbitai coderabbitai bot changed the title feat:@coderabbitai feat:Refactor LemurTaskParams schema to remove inheritance and update fields Aug 1, 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 (1)
src/libs/AssemblyAI/openapi.yaml (1)

5636-5642: Unnecessary single-item allOf wrapper adds avoidable complexity

LemurTaskParams now wraps its single object schema inside an allOf: list that contains only that same object.
This extra indirection has no functional benefit but complicates downstream tooling (codegen, validation, diffing).

-allOf:
-  - type: object
+type: object
+additionalProperties: false
+properties:
+  ...

Unless you intend to add additional allOf members, flatten the structure.
Cleaner YAML ≙ fewer surprises for generators like OpenAPI-Generator & Fern.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between eaafad3 and 4ba0eb7.

⛔ Files ignored due to path filters (3)
  • src/libs/AssemblyAI/Generated/AssemblyAI.JsonConverters.LemurTaskParams.g.cs is excluded by !**/generated/**
  • src/libs/AssemblyAI/Generated/AssemblyAI.Models.LemurTaskParams.g.cs is excluded by !**/generated/**
  • src/libs/AssemblyAI/Generated/AssemblyAI.Models.LemurTaskParamsVariant1.g.cs is excluded by !**/generated/**
📒 Files selected for processing (1)
  • src/libs/AssemblyAI/openapi.yaml (1 hunks)

Comment on lines +5647 to +5656
transcript_ids:
x-label: Transcript IDs
description: |
A list of completed transcripts with text. Up to a maximum of 100 hours of audio.
Use either transcript_ids or input_text as input into LeMUR.
type: array
items:
x-label: Transcript ID
type: string
format: uuid
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Schema now duplicates fields from LemurBaseParams – consider composition to stay DRY

transcript_ids, input_text, max_output_size, temperature, etc. are copied wholesale.
Keeping two independent copies means the moment you tweak validation in one place, the other silently drifts.

A safer pattern:

LemurTaskParams:
  allOf:
    - $ref: "#/components/schemas/LemurBaseParams"
    - type: object
      required: [prompt]
      properties:
        prompt:
          type: string

This keeps the single source-of-truth in LemurBaseParams and just adds the prompt requirement.

Also applies to: 5671-5685

🤖 Prompt for AI Agents
In src/libs/AssemblyAI/openapi.yaml around lines 5647 to 5656, the schema
duplicates fields from LemurBaseParams, causing maintenance issues. Refactor
LemurTaskParams to use composition by referencing LemurBaseParams with allOf,
then add or override properties like prompt as needed. This keeps validation
centralized and avoids duplication. Apply the same pattern to lines 5671 to
5685.

Comment on lines +5658 to +5670
x-label: Input text
description: |
Custom formatted transcript data. Maximum size is the context limit of the selected model.
Use either transcript_ids or input_text as input into LeMUR.
type: string
final_model:
x-label: Final model
description: |
The model that is used for the final prompt after compression is performed.
default: "default"
oneOf:
- $ref: "#/components/schemas/LemurModel"
max_output_size:
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

final_model definition diverges from the canonical one – risk of breaking SDKs

Previously, final_model in LemurBaseParams used anyOf + x-ts-type + x-go-type to allow either an enum value or an arbitrary string.

The duplication here:

final_model:
  ...           # description kept
  default: "default"
  oneOf:        # <-- switched to oneOf
    - $ref: "#/components/schemas/LemurModel"
  1. Switching from anyOfoneOf tightens validation and may reject inputs that were valid before (e.g. a custom model string).
  2. x-ts-type / x-go-type hints are lost, so generated SDKs will expose different types for the same field across request objects.

Recommend re-using the original definition via $ref (or copy it verbatim) to keep behaviour and typings consistent:

-  oneOf:
-    - $ref: "#/components/schemas/LemurModel"
+  anyOf:
+    - $ref: "#/components/schemas/LemurModel"
+    - type: string
+  x-ts-type: LiteralUnion<LemurModel, string>
+  x-go-type: LeMURModel

Failing to align these will cause breaking changes for clients generated from this spec.

🤖 Prompt for AI Agents
In src/libs/AssemblyAI/openapi.yaml around lines 5658 to 5670, the final_model
field definition changed from using anyOf with x-ts-type and x-go-type to oneOf
without these type hints, which restricts valid inputs and breaks SDK typings.
To fix this, revert final_model to use the original anyOf structure including
x-ts-type and x-go-type annotations, either by referencing the original schema
or copying it verbatim, ensuring consistent validation and SDK compatibility.

@HavenDV HavenDV closed this Aug 1, 2025
auto-merge was automatically disabled August 1, 2025 09:07

Pull request was closed

@HavenDV HavenDV deleted the bot/update-openapi_202508010159 branch August 1, 2025 09:07
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