funasr support payload.input and bug fix in transcription#143
funasr support payload.input and bug fix in transcription#143songguocola wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a wait_timeout parameter to the task waiting mechanism, allowing users to specify a maximum duration to wait for task completion before returning a timeout error. It also updates the request data formatting to extract raw_input from parameters. However, two critical issues were identified: first, in _only_parameters, the modified parameters dictionary (with raw_input removed) is never assigned back to the request object, causing the raw input to be sent twice; second, in BaseAsyncApi.call, wait_timeout is popped from kwargs after async_call is invoked, resulting in the timeout parameter being incorrectly sent to the server.
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.
| wait_timeout = -1 | ||
| if "wait_timeout" in kwargs: | ||
| wait_timeout = kwargs.pop("wait_timeout") |
There was a problem hiding this comment.
In BaseAsyncApi.call, wait_timeout is popped from kwargs after cls.async_call has already been invoked. Because kwargs is passed to cls.async_call before being popped, wait_timeout is still sent to the server as an unexpected request parameter.
To fix this, wait_timeout should be popped from kwargs before calling cls.async_call:
@classmethod
def call(
cls,
*args,
api_key: str = None,
workspace: str = None,
**kwargs,
) -> DashScopeAPIResponse:
"""Call service and get result."""
wait_timeout = kwargs.pop("wait_timeout", -1)
task_response = cls.async_call(
*args,
api_key=api_key,
workspace=workspace,
**kwargs,
)
response = cls.wait(
task_response,
api_key=api_key,
workspace=workspace,
wait_timeout=wait_timeout,
)
return response
No description provided.