-
-
Notifications
You must be signed in to change notification settings - Fork 1
feat:Refactor LemurTaskParams schema to remove inheritance and expand properties #105
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 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: 1
🔭 Outside diff range comments (1)
src/libs/AssemblyAI/openapi.yaml (1)
5643-5686: Avoid manual duplication – re-useLemurBaseParamsvia$refinstead of copying its fields.
LemurTaskParamspreviously inherited everything inLemurBaseParamsthrough anallOf$ref.
By inliningtranscript_ids,input_text,final_model,max_output_size, andtemperatureyou have:
- Introduced five copies of definitions that now have to be changed in two places.
- Silently dropped
contextand the liberalanyOftyping (string | object) that was still exposed byLemurBaseParams.- Created schema drift –
LemurSummaryParams/LemurQuestionAnswerParamsstill inherit, so the same field now has two slightly different shapes depending on the endpoint.Unless there is a compelling generator limitation, keep composition and simply add
required: [prompt](orprompt, final_modelif truly needed):- allOf: - - type: object - additionalProperties: false - properties: - prompt: { ... } - ... - required: [prompt, final_model] +allOf: + - type: object + additionalProperties: false + properties: + prompt: + x-label: Prompt + description: Your text to prompt the model to produce a desired output, including any context you want to pass into the model. + type: string + required: [prompt] + - $ref: "#/components/schemas/LemurBaseParams"This restores single-source-of-truth, keeps
contextavailable and prevents future divergence.
🧹 Nitpick comments (1)
src/libs/AssemblyAI/openapi.yaml (1)
5671-5685: Metadata annotations removed – will degrade generated SDKs.
max_output_sizeandtemperaturepreviously carriedx-ts-type/x-go-typeoverrides.
Stripping them means TypeScript & Go SDKs fall back to raw primitives, losing the branded-type ergonomics the rest of the spec maintains. Re-add the annotations for consistency.
📜 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 lost the “string passthrough” capability.
The original definition allowed either an enum value or any arbitrary string, via:
anyOf:
- $ref: "#/components/schemas/LemurModel"
- type: stringChanging to oneOf with only the $ref breaks backward compatibility for callers that rely on custom model IDs (your C# helper explicitly allows string). Restore the anyOf union:
- oneOf:
- - $ref: "#/components/schemas/LemurModel"
+ anyOf:
+ - $ref: "#/components/schemas/LemurModel"
+ - type: string
+ x-ts-type: LiteralUnion<LemurModel, string>
+ x-go-type: LeMURModel🤖 Prompt for AI Agents
In src/libs/AssemblyAI/openapi.yaml around lines 5664 to 5670, the final_model
property was changed from an anyOf union allowing either a LemurModel enum or
any string to a oneOf with only the LemurModel reference. This removes support
for arbitrary string values and breaks backward compatibility. To fix this,
revert the schema to use anyOf with both the LemurModel reference and a string
type, restoring the original behavior that permits either an enum value or any
string.
Pull request was closed
Summary by CodeRabbit
New Features
Bug Fixes
Documentation