funasr support payload.input and bug fix in transcription#145
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a wait_timeout parameter to the wait methods across several modules (including image, video, and audio synthesis/transcription) and implements timeout handling in both the synchronous and asynchronous wait loops in base_api.py. Additionally, it updates _only_parameters in api_request_data.py to extract "raw_input" from parameters. The review feedback suggests copying self.parameters before popping "raw_input" to prevent mutating state across multiple calls, and recommends using time.monotonic() instead of time.time() to measure elapsed time robustly against system clock adjustments.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| max_wait_seconds = 5 | ||
| increment_steps = 3 | ||
| step = 0 | ||
| start_time = time.time() |
There was a problem hiding this comment.
Using time.time() to measure elapsed time is susceptible to system clock adjustments (e.g., NTP synchronization or manual changes). Using time.monotonic() is preferred for measuring durations and timeouts as it is guaranteed to never go backwards.
| start_time = time.time() | |
| start_time = time.monotonic() |
There was a problem hiding this comment.
The retry duration here is not a strict requirement and is unnecessary.
| if wait_timeout is not None and 0 < wait_timeout <= ( | ||
| time.time() - start_time | ||
| ): |
There was a problem hiding this comment.
There was a problem hiding this comment.
Same as the previous question.
| max_wait_seconds = 5 | ||
| increment_steps = 3 | ||
| step = 0 | ||
| start_time = time.time() |
There was a problem hiding this comment.
There was a problem hiding this comment.
Same as the previous question.
| if wait_timeout is not None and 0 < wait_timeout <= ( | ||
| time.time() - start_time | ||
| ): |
There was a problem hiding this comment.
Update the elapsed time calculation to use time.monotonic() to match the monotonic start time in the synchronous wait loop.
| if wait_timeout is not None and 0 < wait_timeout <= ( | |
| time.time() - start_time | |
| ): | |
| if wait_timeout is not None and 0 < wait_timeout <= ( | |
| time.monotonic() - start_time | |
| ): |
There was a problem hiding this comment.
Same as the previous question.
No description provided.