22
33from __future__ import annotations
44
5- from typing import List , Union
5+ from typing import List , Union , Iterable
66
77import httpx
88
1919from .._base_client import make_request_options
2020from ..types .moderation_model import ModerationModel
2121from ..types .moderation_create_response import ModerationCreateResponse
22+ from ..types .moderation_multi_modal_input_param import ModerationMultiModalInputParam
2223
2324__all__ = ["Moderations" , "AsyncModerations" ]
2425
@@ -46,7 +47,7 @@ def with_streaming_response(self) -> ModerationsWithStreamingResponse:
4647 def create (
4748 self ,
4849 * ,
49- input : Union [str , List [str ]],
50+ input : Union [str , List [str ], Iterable [ ModerationMultiModalInputParam ] ],
5051 model : Union [str , ModerationModel ] | NotGiven = NOT_GIVEN ,
5152 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
5253 # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -55,20 +56,19 @@ def create(
5556 extra_body : Body | None = None ,
5657 timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
5758 ) -> ModerationCreateResponse :
58- """
59- Classifies if text is potentially harmful.
59+ """Classifies if text and/or image inputs are potentially harmful.
6060
61- Args:
62- input: The input text to classify
61+ Learn more in
62+ the [moderation guide](https://platform.openai.com/docs/guides/moderation).
6363
64- model: Two content moderations models are available: `text-moderation-stable` and
65- `text-moderation-latest`.
64+ Args:
65+ input: Input (or inputs) to classify. Can be a single string, an array of strings, or
66+ an array of multi-modal input objects similar to other models.
6667
67- The default is `text-moderation-latest` which will be automatically upgraded
68- over time. This ensures you are always using our most accurate model. If you use
69- `text-moderation-stable`, we will provide advanced notice before updating the
70- model. Accuracy of `text-moderation-stable` may be slightly lower than for
71- `text-moderation-latest`.
68+ model: The content moderation model you would like to use. Learn more in
69+ [the moderation guide](https://platform.openai.com/docs/guides/moderation), and
70+ learn about available models
71+ [here](https://platform.openai.com/docs/models/moderation).
7272
7373 extra_headers: Send extra headers
7474
@@ -117,7 +117,7 @@ def with_streaming_response(self) -> AsyncModerationsWithStreamingResponse:
117117 async def create (
118118 self ,
119119 * ,
120- input : Union [str , List [str ]],
120+ input : Union [str , List [str ], Iterable [ ModerationMultiModalInputParam ] ],
121121 model : Union [str , ModerationModel ] | NotGiven = NOT_GIVEN ,
122122 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
123123 # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -126,20 +126,19 @@ async def create(
126126 extra_body : Body | None = None ,
127127 timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
128128 ) -> ModerationCreateResponse :
129- """
130- Classifies if text is potentially harmful.
129+ """Classifies if text and/or image inputs are potentially harmful.
131130
132- Args:
133- input: The input text to classify
131+ Learn more in
132+ the [moderation guide](https://platform.openai.com/docs/guides/moderation).
134133
135- model: Two content moderations models are available: `text-moderation-stable` and
136- `text-moderation-latest`.
134+ Args:
135+ input: Input (or inputs) to classify. Can be a single string, an array of strings, or
136+ an array of multi-modal input objects similar to other models.
137137
138- The default is `text-moderation-latest` which will be automatically upgraded
139- over time. This ensures you are always using our most accurate model. If you use
140- `text-moderation-stable`, we will provide advanced notice before updating the
141- model. Accuracy of `text-moderation-stable` may be slightly lower than for
142- `text-moderation-latest`.
138+ model: The content moderation model you would like to use. Learn more in
139+ [the moderation guide](https://platform.openai.com/docs/guides/moderation), and
140+ learn about available models
141+ [here](https://platform.openai.com/docs/models/moderation).
143142
144143 extra_headers: Send extra headers
145144
0 commit comments