Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Fix] Fix audio api methods arguments not being considered #340

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

bnznamco
Copy link

Methods of Audio package are not passing arguments to cls.__prepare_request.

This prevents to override the configuration of the client from the method.

Before:

@classmethod
def transcribe(
    cls,
    model,
    file,
    api_key=None,
    api_base=None,
    api_type=None,
    api_version=None,
    organization=None,
    **params,
):
    requestor, files, data = cls._prepare_request(file, file.name, model, **params)

After:

def translate(
    cls,
    model,
    file,
    api_key=None,
    api_base=None,
    api_type=None,
    api_version=None,
    organization=None,
    **params,
):
    requestor, files, data = cls._prepare_request(
        file,
        file.name,
        model,
        api_key,
        api_base,
        api_type,
        api_version,
        organization,
        **params,
    )

After this fix you will be able to override for example api_key directly calling the method.

openai.Audio.transcribe("whisper-1", file, api_key="my-api-key")

@hallacy hallacy requested a review from mpokrass March 30, 2023 04:42
@mpokrass mpokrass removed their request for review April 4, 2023 16:03
@hallacy
Copy link
Collaborator

hallacy commented Apr 8, 2023

Closing this because #369 fixed it

@hallacy hallacy closed this Apr 8, 2023
safa0 pushed a commit to safa0/openai-agents-python that referenced this pull request Apr 27, 2025
Previously the stream was closing as soon as all the audio was added but
didn't wait for it to be finished. Additionally the audio might seem
chopped off if there is no additional silence so this PR also adds one
second of silence before exiting the program.
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