Skip to content

funasr support payload.input and bug fix in transcription#145

Merged
lzsweb merged 2 commits into
dashscope:mainfrom
songguocola:dev/audio_0618
Jun 17, 2026
Merged

funasr support payload.input and bug fix in transcription#145
lzsweb merged 2 commits into
dashscope:mainfrom
songguocola:dev/audio_0618

Conversation

@songguocola

Copy link
Copy Markdown
Contributor

No description provided.

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

Copy link
Copy Markdown
Contributor

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 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.

Comment thread dashscope/api_entities/api_request_data.py
max_wait_seconds = 5
increment_steps = 3
step = 0
start_time = time.time()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

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.

Suggested change
start_time = time.time()
start_time = time.monotonic()

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The retry duration here is not a strict requirement and is unnecessary.

Comment on lines +228 to +230
if wait_timeout is not None and 0 < wait_timeout <= (
time.time() - start_time
):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Update the elapsed time calculation to use time.monotonic() to match the monotonic start time.

Suggested change
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
):

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Same as the previous question.

max_wait_seconds = 5
increment_steps = 3
step = 0
start_time = time.time()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Using time.time() to measure elapsed time is susceptible to system clock adjustments. Using time.monotonic() is preferred for measuring durations and timeouts in the synchronous wait loop as well.

Suggested change
start_time = time.time()
start_time = time.monotonic()

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Same as the previous question.

Comment on lines +835 to +837
if wait_timeout is not None and 0 < wait_timeout <= (
time.time() - start_time
):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Update the elapsed time calculation to use time.monotonic() to match the monotonic start time in the synchronous wait loop.

Suggested change
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
):

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Same as the previous question.

@lzsweb lzsweb merged commit 791659f into dashscope:main Jun 17, 2026
2 checks passed
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.

2 participants