Skip to content

Add api_key parameter to Moderation.create - #123

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

hallacy merged 2 commits into
openai:mainfrom
zafercavdar:fix/api-key-moderation-create

Conversation

@zafercavdar

@zafercavdar zafercavdar commented Sep 16, 2022 •

Copy link
Copy Markdown
Contributor

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

hallacy commented Sep 18, 2022

Copy link
Copy Markdown
Contributor

@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.

@lilianweng lilianweng left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM

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