Commit 09dc7ef3
Changed files (1)
openai
api_resources
openai/api_resources/moderation.py
@@ -11,14 +11,14 @@ class Moderation(OpenAIObject):
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