-
-
Notifications
You must be signed in to change notification settings - Fork 1
feat:Refactor LemurTaskParams schema to inline properties and update fields #112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughThe schema for Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~7 minutes 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. 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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this 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
🔭 Outside diff range comments (1)
src/libs/AssemblyAI/openapi.yaml (1)
5643-5656: Property duplication – please keep single-source via allOf
transcript_idsandinput_textare now hard-coded again in LemurTaskParams, while they still live inLemurBaseParams.
Duplicating these definitions bloats the spec and will inevitably drift (e.g. the descriptive copy already differs slightly). Prefer reverting to the previousallOf: [ $ref: #/components/schemas/LemurBaseParams ]approach or, if inheritance must go, delete them fromLemurBaseParamsto maintain one canonical definition.
🧹 Nitpick comments (1)
src/libs/AssemblyAI/openapi.yaml (1)
5671-5686: Required vs default contradiction
final_modelis now declaredrequiredand given a default"default". Requiring a field that already has a server-side default is redundant and forces clients to send unnecessary data. Drop it fromrequiredif the default is kept, or drop the default if you truly need the caller to specify.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (3)
src/libs/AssemblyAI/Generated/AssemblyAI.JsonConverters.LemurTaskParams.g.csis excluded by!**/generated/**src/libs/AssemblyAI/Generated/AssemblyAI.Models.LemurTaskParams.g.csis excluded by!**/generated/**src/libs/AssemblyAI/Generated/AssemblyAI.Models.LemurTaskParamsVariant1.g.csis 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 (1)
src/libs/AssemblyAI/Conversions/LemurTaskParams.cs (2)
struct(5-36)FromPrompt(25-35)
| 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: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
context field silently dropped
LemurBaseParams exposes an optional context attribute that many clients rely on. By inlining properties you removed it from LemurTaskParams, so POST /lemur/v3/generate/task will now reject valid payloads that worked before. Re-add context here (or restore the base-schema reference).
🤖 Prompt for AI Agents
In src/libs/AssemblyAI/openapi.yaml around lines 5657 to 5663, the optional
'context' field from LemurBaseParams was removed when inlining properties,
causing valid payloads to be rejected. To fix this, re-add the 'context' field
explicitly in LemurTaskParams or restore the reference to the base schema that
includes 'context' so that the POST /lemur/v3/generate/task endpoint accepts the
previously valid payloads.
| 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: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
❓ Verification inconclusive
final_model type overly restrictive
Changing anyOf → oneOf eliminates the “free-form string” escape hatch clients used for unreleased models. Unless that is an intentional breaking change, keep anyOf with an additional type: string branch:
- oneOf:
+ anyOf:
- $ref: "#/components/schemas/LemurModel"
+ - type: stringAllow free-form strings for final_model
Revert the schema to use anyOf with an extra type: string branch so clients can still pass unreleased model names without breaking:
- File: src/libs/AssemblyAI/openapi.yaml (around lines 5664–5670)
Required change:
- oneOf:
- - $ref: "#/components/schemas/LemurModel"
+ anyOf:
+ - $ref: "#/components/schemas/LemurModel"
+ - type: string📝 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.
| 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: | |
| 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 | |
| max_output_size: |
🤖 Prompt for AI Agents
In src/libs/AssemblyAI/openapi.yaml around lines 5664 to 5670, the schema for
final_model currently uses oneOf with only a reference to LemurModel, which
restricts it to predefined models. To allow free-form strings for final_model,
change oneOf to anyOf and add an additional branch with type: string. This lets
clients pass unreleased or custom model names without breaking validation.
Pull request was closed
Summary by CodeRabbit
New Features
Documentation