Skip to content

Conversation

@HavenDV
Copy link
Contributor

@HavenDV HavenDV commented Jul 31, 2025

Summary by CodeRabbit

  • New Features

    • Expanded task parameter options to support either transcript IDs or input text as inputs.
    • Added new settings for model selection, output size, and temperature control.
  • Bug Fixes

    • Ensured required fields now include both prompt and model selection.
  • Documentation

    • Updated example to reflect current parameter options and removed outdated fields.

@coderabbitai
Copy link

coderabbitai bot commented Jul 31, 2025

Walkthrough

The schema for LemurTaskParams in the OpenAPI specification was modified to explicitly include properties from LemurBaseParams, removing inheritance. New required and optional fields were added, the list of required fields was updated, and the example was adjusted to reflect these changes.

Changes

Cohort / File(s) Change Summary
OpenAPI Schema Update
src/libs/AssemblyAI/openapi.yaml
Refactored LemurTaskParams schema: removed inheritance from LemurBaseParams, added properties (transcript_ids, input_text, final_model, max_output_size, temperature), updated required fields, and revised example.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

In the meadow of YAML, fields grew anew,
Lemur’s task now stands alone, its roots in full view.
No base to inherit, all traits in one place,
With models and prompts, it’s ready to race.
A rabbit approves with a hop and a cheer—
Schema made simple, the path is now clear! 🐇

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

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) July 31, 2025 21:20
@coderabbitai coderabbitai bot changed the title feat:@coderabbitai feat:Update LemurTaskParams schema to include LemurBaseParams properties and fields Jul 31, 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: 3

🔭 Outside diff range comments (1)
src/libs/AssemblyAI/openapi.yaml (1)

5643-5657: Duplication of transcript_ids violates DRY and risks schema drift

transcript_ids was already defined in LemurBaseParams. By in-lining the same definition here you now maintain two authoritative copies. Any future bug-fix or evolution (e.g. max size, item format) must be applied twice or the two schemas will silently diverge.

Prefer keeping a single source of truth via:

-      allOf:
-        - type: object
-          additionalProperties: false
-          properties:
-            prompt: ...
-            transcript_ids: ...
+      allOf:
+        - type: object
+          additionalProperties: false
+          properties:
+            prompt:
+              ...
+        - $ref: "#/components/schemas/LemurBaseParams"

This preserves the public surface while eliminating duplication.

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

5676-5685: temperature duplicated – constraint mismatch & maintenance hazard

Same issue as above: constraints match today but will silently diverge on future edits. Keep this property in one place.

📜 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 23e2005.

⛔ 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)
🧰 Additional context used
🧬 Code Graph Analysis (1)
src/libs/AssemblyAI/openapi.yaml (2)
src/libs/AssemblyAI/Conversions/LemurTaskParams.cs (2)
  • struct (5-36)
  • FromPrompt (25-35)
src/libs/AssemblyAI/Conversions/LemurTaskParamsVariant1.cs (2)
  • FromPrompt (24-30)
  • LemurTaskParamsVariant1 (5-31)
🔇 Additional comments (1)
src/libs/AssemblyAI/openapi.yaml (1)

5664-5670: Restore anyOf on final_model to support custom model IDs

The current change replaces the previous union type (enum ∪ string) with a strict oneOf reference to LemurModel, preventing clients from passing new or experimental model IDs without a spec bump. To maintain backward‐ and forward‐compatibility, restore the original definition:

final_model:
  x-label: Final model
  description: |
    The model that is used for the final prompt after compression is performed.
  default: "default"
  anyOf:
    - $ref: "#/components/schemas/LemurModel"
    - type: string

Locations to update:

  • src/libs/AssemblyAI/openapi.yaml (around lines 5664–5670)

Comment on lines +5657 to +5663
input_text:
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:
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

input_text duplicated & still optional – but now mutually exclusive rule vanished

input_text duplicates the base definition and, more importantly, the prose rule “Use either transcript_ids or input_text” is no longer enforceable once inheritance is removed.
Consider re-using LemurBaseParams or adding an oneOf composition to keep mutual-exclusivity machine-readable.

🤖 Prompt for AI Agents
In src/libs/AssemblyAI/openapi.yaml around lines 5657 to 5663, the input_text
property is duplicated and the mutual exclusivity rule between transcript_ids
and input_text is lost. To fix this, refactor the schema to reuse
LemurBaseParams where input_text is defined or add a oneOf composition that
enforces either transcript_ids or input_text is provided, ensuring the mutual
exclusivity is machine-readable and not just in the description.

Comment on lines +5671 to +5675
x-label: Maximum output size
description: Max output size in tokens, up to 4000
type: integer
default: 2000
temperature:
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

max_output_size duplicated with no bounds check

The duplicated field omits minimum / maximum guards that still exist in LemurBaseParams. This widens the accepted range for the task endpoint only, creating inconsistent server validation.

🤖 Prompt for AI Agents
In src/libs/AssemblyAI/openapi.yaml around lines 5671 to 5675, the
max_output_size field is duplicated without minimum and maximum bounds, unlike
in LemurBaseParams. To fix this, add the same minimum and maximum constraints
(e.g., minimum: 1, maximum: 4000) to this max_output_size definition to ensure
consistent validation across endpoints.

default: 0
minimum: 0
maximum: 1
required: [prompt, final_model]
Copy link

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Breaking change: context field silently removed

Existing clients may rely on context when calling /lemur/v3/generate/task. Removing it without a new version or deprecation period is a breaking API change.

If intentional, increment the API major version and document migration steps; otherwise restore the field via inheritance.


🏁 Script executed:

#!/bin/bash
# Locate the /lemur/v3/generate/task endpoint and inspect its requestBody schema (showing 20 lines of context)
rg -n "/lemur/v3/generate/task" -C20 src/libs/AssemblyAI/openapi.yaml

Length of output: 1665


🏁 Script executed:

#!/bin/bash
# Inspect the LemurTaskParams schema to verify if 'context' was removed
rg -n "LemurTaskParams:" -C50 src/libs/AssemblyAI/openapi.yaml

Length of output: 4448


Breaking change: context property removed from LeMUR task schema

The components/schemas/LemurTaskParams definition no longer includes a context field and only lists prompt, transcript_ids, input_text, final_model, max_output_size, and temperature as allowed properties (with additionalProperties: false), and the required array only contains [prompt, final_model]. Any clients sending context will now fail schema validation.

• File: src/libs/AssemblyAI/openapi.yaml
Location: components/schemas/LemurTaskParams (around line 5635)

Actions:

  • If removal was intentional, bump the API’s major version and document migration steps for clients.
  • Otherwise, restore the context property (e.g., via schema inheritance) to maintain backward compatibility.
🤖 Prompt for AI Agents
In src/libs/AssemblyAI/openapi.yaml around line 5635, the LemurTaskParams schema
has removed the 'context' property, causing breaking changes for clients using
it. To fix this, either restore the 'context' property in the schema to maintain
backward compatibility or, if the removal is intentional, increment the API's
major version and add clear migration instructions for clients to handle the
change.

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

Pull request was closed

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