OpenAIWhisperParser : You tried to access openai.Audio, but this is no longer supported in openai>=1.0.0 #17880
Replies: 4 comments 1 reply
-
🤖 Hey @lucasseidor33! Great to see you back here seeking adventures in the code jungle 🌴 Based on the error message you're seeing, it appears that the OpenAI API has changed in version 1.0.0 and no longer supports the To resolve this issue, you should use the # Transcribe
print(f"Transcribing part {split_number+1}!")
attempts = 0
while attempts < 3:
try:
transcript = client.audio.transcriptions.create(
model="whisper-1", file=file_obj
)
break
except Exception as e:
attempts += 1
print(f"Attempt {attempts} failed. Exception: {str(e)}")
time.sleep(5)
else:
print("Failed to transcribe after 3 attempts.")
continue This code tries to transcribe the audio using the This change should resolve the error you're encountering. If you have any other questions or run into any other issues, please let me know! For more information about the Sources
|
Beta Was this translation helpful? Give feedback.
-
did you figured it out ? |
Beta Was this translation helpful? Give feedback.
-
This works:
Unfortunately I have not been able to find the equivalent of "atranscribe" (the async/await equivalent from the old API). This makes the call abobe synchronous/blocking (super bad). |
Beta Was this translation helpful? Give feedback.
-
Regarding async, I can see that but there does not seem to be any |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Checked other resources
Commit to Help
Example Code
Description
when I try to transcribe my video to text with Python via OpenAIWhisperParser method I get the following error:
You tried to access openai.Audio, but this is no longer supported in openai>=1.0.0 - see the README at https://github.com/openai/openai-python for the API.
You can run
openai migrate
to automatically upgrade your codebase to use the 1.0.0 interface.Alternatively, you can pin your installation to the old version, e.g.
pip install openai==0.28
My version of openai is 1.2.1. Any help is welcome!
System Info
python version is 3.11.3, langchain==0.0.333
in windows
Beta Was this translation helpful? Give feedback.
All reactions