Skip to content

Add api_key parameter to Moderation.create#123

Merged
hallacy merged 2 commits intoopenai:mainfrom
zafercavdar:fix/api-key-moderation-create
Sep 20, 2022
Merged

Add api_key parameter to Moderation.create#123
hallacy merged 2 commits intoopenai:mainfrom
zafercavdar:fix/api-key-moderation-create

Conversation

@zafercavdar
Copy link
Copy Markdown
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
Copy Markdown
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)
Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown

@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