Skip to content

bug fix for audio models#207

Closed
songguocola wants to merge 3 commits into
dashscope:mainfrom
songguocola:dev_0423
Closed

bug fix for audio models#207
songguocola wants to merge 3 commits into
dashscope:mainfrom
songguocola:dev_0423

Conversation

@songguocola
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates HttpSpeechSynthesisParam to merge additional parameters into the HTTP body, refines OmniRealtimeConfig with better null handling and transcription configuration merging, and changes WebSocket close codes to 1001 in OkHttpWebSocketClient. Feedback suggests addressing variable shadowing in OmniRealtimeConfig and translating a Chinese comment to English for consistency.

if (existingConfig instanceof Map) {
@SuppressWarnings("unchecked")
Map<String, Object> tempMap = (Map<String, Object>) existingConfig;
tempMap.putAll(transcriptionConfig);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The local variable transcriptionConfig (which is a Map) shadows the class field transcriptionConfig (which is an OmniRealtimeTranscriptionParam). This makes the code confusing and error-prone, as the same identifier refers to different types and objects within the same scope. It is highly recommended to rename the local map variable to something more distinct, such as transcriptionMap.

@SuppressWarnings("unchecked")
Map<String, Object> tempMap = (Map<String, Object>) existingConfig;
tempMap.putAll(transcriptionConfig);
// 显式赋值:利用引用机制虽已更新,但显式 put 能极大增强代码的意图表达和可读性
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The comment is written in Chinese, while the rest of the codebase uses English. For consistency and to ensure the code is maintainable by a wider audience, please use English for all comments.

Suggested change
// 显式赋值:利用引用机制虽已更新,但显式 put 能极大增强代码的意图表达和可读性
// Explicit assignment: although the map is updated via reference, explicit put enhances clarity and intent.

@songguocola songguocola deleted the dev_0423 branch April 27, 2026 05:54
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.

1 participant