Skip to content
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

Using latest audio transcribe from openai. #28879

Closed
wants to merge 3 commits into from

Conversation

BirenMer
Copy link

Thank you for contributing to LangChain!

  • openai bug fix in audio.py: "community: found a bug while testing langchain in another repo found the bug in the main langchian repo as well hence correcting it"

Copy link

vercel bot commented Dec 22, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
langchain ⬜️ Ignored (Inspect) Visit Preview Dec 22, 2024 6:01pm

@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. community Related to langchain-community 🤖:bug Related to a bug, vulnerability, unexpected error with an existing feature labels Dec 22, 2024
@BirenMer BirenMer force-pushed the fix-a-bug-in-audio.py branch from e2f8722 to ce5bd74 Compare December 22, 2024 17:43
@BirenMer BirenMer changed the title fixing an error in audio.py Using latest audio transcribe from openai. Dec 22, 2024
@BirenMer
Copy link
Author

Changing the below line of code :
transcript = openai.Audio.transcribe("whisper-1", file_obj) # type: ignore[attr-defined]

As above functionality is no longer supported by openai.
To make the code more consistent and stable.

The new line is as follows:
transcript = openai.audio.transcriptions.create(
model="whisper-1",
file=file_obj, )

Copy link
Collaborator

@ccurme ccurme left a comment

Choose a reason for hiding this comment

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

You should only hit this line if you are using an old (pre-1.0) version of the openai sdk. For these versions the line looks correct:

https://github.com/openai/openai-python/blob/f7ccce126325ea35b6e5224ab954652c97a74896/openai/api_resources/audio.py#L46

Let me know if I've misunderstood something.

@ccurme ccurme closed this Dec 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖:bug Related to a bug, vulnerability, unexpected error with an existing feature community Related to langchain-community size:XS This PR changes 0-9 lines, ignoring generated files.
Projects
Status: Closed
Development

Successfully merging this pull request may close these issues.

2 participants