bug fix for audio models#207
Conversation
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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 能极大增强代码的意图表达和可读性 |
There was a problem hiding this comment.
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.
| // 显式赋值:利用引用机制虽已更新,但显式 put 能极大增强代码的意图表达和可读性 | |
| // Explicit assignment: although the map is updated via reference, explicit put enhances clarity and intent. |
No description provided.