feat: fill in some custom fields for vllm-omini - #4154
Conversation
WalkthroughTwo modifications enhance audio request handling: the AudioRequest struct was expanded with seven optional Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@dto/audio.go`:
- Around line 26-28: The three optional scalar fields XVectorOnlyMode,
MaxNewTokens, and InitialCodecChunkFrames in the dto.audio struct currently use
json.RawMessage which loses type guarantees; change them to typed pointer scalar
fields (e.g., *bool for XVectorOnlyMode and *int for MaxNewTokens and
InitialCodecChunkFrames or the correct scalar types used elsewhere in the
codebase), keep the `json:"...,omitempty"` tags, and remove json.RawMessage so
the DTO follows the scalar-pointer rule and preserves explicit zero values.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 0ddcd24b-3787-42f8-b914-8054e2528b57
📒 Files selected for processing (2)
dto/audio.gorelay/channel/openai/adaptor.go
| XVectorOnlyMode json.RawMessage `json:"x_vector_only_mode,omitempty"` | ||
| MaxNewTokens json.RawMessage `json:"max_new_tokens,omitempty"` | ||
| InitialCodecChunkFrames json.RawMessage `json:"initial_codec_chunk_frames,omitempty"` |
There was a problem hiding this comment.
Use typed pointer scalars for scalar extension parameters.
Line 26-Line 28 are optional scalar-style request params but currently use json.RawMessage. This loses type guarantees and conflicts with the DTO scalar-field rule.
💡 Suggested change
- XVectorOnlyMode json.RawMessage `json:"x_vector_only_mode,omitempty"`
- MaxNewTokens json.RawMessage `json:"max_new_tokens,omitempty"`
- InitialCodecChunkFrames json.RawMessage `json:"initial_codec_chunk_frames,omitempty"`
+ XVectorOnlyMode *bool `json:"x_vector_only_mode,omitempty"`
+ MaxNewTokens *int `json:"max_new_tokens,omitempty"`
+ InitialCodecChunkFrames *int `json:"initial_codec_chunk_frames,omitempty"`As per coding guidelines, dto/**/*.go optional scalar fields MUST use pointer types with omitempty to preserve explicit zero values.
📝 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.
| XVectorOnlyMode json.RawMessage `json:"x_vector_only_mode,omitempty"` | |
| MaxNewTokens json.RawMessage `json:"max_new_tokens,omitempty"` | |
| InitialCodecChunkFrames json.RawMessage `json:"initial_codec_chunk_frames,omitempty"` | |
| XVectorOnlyMode *bool `json:"x_vector_only_mode,omitempty"` | |
| MaxNewTokens *int `json:"max_new_tokens,omitempty"` | |
| InitialCodecChunkFrames *int `json:"initial_codec_chunk_frames,omitempty"` |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@dto/audio.go` around lines 26 - 28, The three optional scalar fields
XVectorOnlyMode, MaxNewTokens, and InitialCodecChunkFrames in the dto.audio
struct currently use json.RawMessage which loses type guarantees; change them to
typed pointer scalar fields (e.g., *bool for XVectorOnlyMode and *int for
MaxNewTokens and InitialCodecChunkFrames or the correct scalar types used
elsewhere in the codebase), keep the `json:"...,omitempty"` tags, and remove
json.RawMessage so the DTO follows the scalar-pointer rule and preserves
explicit zero values.
feat: fill in some custom fields for vllm-omini
Summary by CodeRabbit
Release Notes