Skip to content

Add api_key parameter to Moderation.create #123

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

Merged
merged 2 commits into from
Sep 20, 2022

Conversation

zafercavdar
Copy link
Contributor

@zafercavdar zafercavdar commented Sep 16, 2022

Fixes #122

This PR enables making moderation endpoint calls without setting API key as environment variable or binding API key to openai module globally.

@hallacy
Copy link
Collaborator

hallacy commented Sep 18, 2022

@lilianweng I think you added support for this endpoint. Can you take a look at this PR?

@hallacy hallacy requested a review from lilianweng September 18, 2022 01:08
)

instance = cls()
instance = cls(api_key=api_key)

Choose a reason for hiding this comment

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

Can we only have this line?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you mean removing other linting changes? I removed them now.

Copy link

@lilianweng lilianweng left a comment

Choose a reason for hiding this comment

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

LGTM

@hallacy hallacy merged commit 09dc7ef into openai:main Sep 20, 2022
cgayapr pushed a commit to cgayapr/openai-python that referenced this pull request Dec 14, 2024
* Add api_key parameter to Moderation.create

* Reverted auto-formatted linting
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.

Support api_key parameter in Moderation.create method
3 participants