Skip to content

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

Closed
songguocola wants to merge 2 commits into
dashscope:mainfrom
songguocola:dev/audio_0618
Closed

funasr support payload.input and bug fix in transcription#143
songguocola wants to merge 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 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.

Comment thread dashscope/api_entities/api_request_data.py
Comment on lines +632 to +634
wait_timeout = -1
if "wait_timeout" in kwargs:
wait_timeout = kwargs.pop("wait_timeout")

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.

high

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

@songguocola songguocola deleted the dev/audio_0618 branch June 16, 2026 08:00
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