Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions openai/api_resources/moderation.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ def get_url(self):
return "/moderations"

@classmethod
def create(cls, input: Union[str, List[str]], model: Optional[str] = None):
def create(cls, input: Union[str, List[str]], model: Optional[str] = None, api_key: Optional[str] = None):
if model is not None and model not in cls.VALID_MODEL_NAMES:
raise ValueError(
f"The parameter model should be chosen from {cls.VALID_MODEL_NAMES} "
f"and it is default to be None."
)

instance = cls()
instance = cls(api_key=api_key)
params = {"input": input}
if model is not None:
params["model"] = model
Expand Down