Skip to content

Conversation

@kdcokenny
Copy link

This just allows the user to pass in an api_key directly into OpenAIWhisperParser. Very simple addition.
@rlancemartin
@eyurtsev

@vercel
Copy link

vercel bot commented Jul 6, 2023

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

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
langchain ⬜️ Ignored (Inspect) Jul 6, 2023 3:12pm

@bito-bot
Copy link

bito-bot commented Jul 6, 2023

Bito AI analyzed this PR as follows.

The change added an optional api_key parameter to the OpenAIWhisperParser class. This allows passing an OpenAI API key to the parser. If provided, the API key is set using openai.api_key = self.api_key before making requests to the OpenAI API.
This change fixes the parser issue requiring an OpenAI API key to be set as an environment variable. Accepting the API key as a parameter makes the parser more flexible, and the API key does not need to be set as an environment variable.

A potential risk is that by accepting the API key as a parameter, it needs to be passed by the user and could potentially be exposed. To mitigate this, the calling code should handle the API key securely.

An improvement could be accepting the API key from an environment variable as a fallback. This would provide more flexibility, allowing the API key to be passed as a parameter or set as an environment variable. The parameter value would take precedence over the environment variable.

This output is generated automatically by analyzing the diff patch on a model grounded to the LangChain codebase. This is meant to be helpful for the community, and the solution may not be 100% accurate.
http://www.bito.ai

@kdcokenny kdcokenny marked this pull request as ready for review July 6, 2023 21:28
@baskaryan baskaryan merged commit 34a2755 into langchain-ai:master Jul 7, 2023
@baskaryan
Copy link
Collaborator

thanks @kdcokenny!

@kdcokenny kdcokenny deleted the OpenAIWhisperParser branch July 10, 2023 23:38
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.

3 participants