-
-
Notifications
You must be signed in to change notification settings - Fork 1
feat:Refactor LemurTaskParams schema to inline properties and update fields #102
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
🧹 Nitpick comments (1)
src/libs/AssemblyAI/openapi.yaml (1)
5647-5657: Schema duplication – consider re-usingLemurBaseParamsinstead of in-line copies.
transcript_ids,input_text,max_output_size, andtemperatureare now duplicated here and inLemurBaseParams. This increases maintenance overhead and invites subtle drift.Simpler alternative:
allOf: - $ref: "#/components/schemas/LemurBaseParams" - type: object additionalProperties: false properties: prompt: ... required: [prompt, final_model]This preserves the flattened definition while guaranteeing single-source truth for shared properties.
Also applies to: 5671-5685
📜 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 (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)
| 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.
final_model loses backward-compatibility by switching from anyOf to oneOf.
The previous schema (via LemurBaseParams) allowed either a documented enum or any custom model string.
By moving to
oneOf:
- $ref: "#/components/schemas/LemurModel"you silently break existing clients that pass bespoke model IDs (or the literal "default" which is not part of the enum).
- oneOf:
- - $ref: "#/components/schemas/LemurModel"
+ anyOf:
+ - $ref: "#/components/schemas/LemurModel"
+ - type: stringRe-introducing the string fallback restores compatibility and mirrors the earlier LemurBaseParams contract.
🤖 Prompt for AI Agents
In src/libs/AssemblyAI/openapi.yaml around lines 5664 to 5670, the final_model
schema changed from anyOf to oneOf, which breaks backward compatibility by
disallowing custom string model IDs like "default". To fix this, revert to using
anyOf with both the LemurModel reference and a string type fallback to allow any
custom model string, restoring compatibility with existing clients.
| default: 0 | ||
| minimum: 0 | ||
| maximum: 1 | ||
| required: [prompt, 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.
🛠️ Refactor suggestion
final_model is marked required despite a default – validation will still fail when omitted.
OpenAPI treats default as a documentation hint, not as a substitute for missing data. Requiring the field nullifies the benefit of the default and forces callers to always supply a value, which departs from prior behaviour.
Either:
- Drop
final_modelfrom therequiredlist, or - Keep it required and remove the
default, making the expectation explicit.
Failing to resolve will create breaking API changes for all callers that relied on the implicit "default" model.
🤖 Prompt for AI Agents
In src/libs/AssemblyAI/openapi.yaml at line 5686, the property final_model is
marked as required despite having a default value, which causes validation
errors when the field is omitted. To fix this, either remove final_model from
the required list so the default can be used when the field is missing, or keep
it required but remove the default value to make the requirement explicit.
Choose one approach to avoid breaking changes for callers relying on the
default.
Pull request was closed
Summary by CodeRabbit
New Features
Documentation