2
2
3
3
from __future__ import annotations
4
4
5
- from typing import List , Union
5
+ from typing import List , Union , Iterable
6
6
7
7
import httpx
8
8
19
19
from .._base_client import make_request_options
20
20
from ..types .moderation_model import ModerationModel
21
21
from ..types .moderation_create_response import ModerationCreateResponse
22
+ from ..types .moderation_multi_modal_input_param import ModerationMultiModalInputParam
22
23
23
24
__all__ = ["Moderations" , "AsyncModerations" ]
24
25
@@ -46,7 +47,7 @@ def with_streaming_response(self) -> ModerationsWithStreamingResponse:
46
47
def create (
47
48
self ,
48
49
* ,
49
- input : Union [str , List [str ]],
50
+ input : Union [str , List [str ], Iterable [ ModerationMultiModalInputParam ] ],
50
51
model : Union [str , ModerationModel ] | NotGiven = NOT_GIVEN ,
51
52
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
52
53
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -55,20 +56,19 @@ def create(
55
56
extra_body : Body | None = None ,
56
57
timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
57
58
) -> ModerationCreateResponse :
58
- """
59
- Classifies if text is potentially harmful.
59
+ """Classifies if text and/or image inputs are potentially harmful.
60
60
61
- Args:
62
- input: The input text to classify
61
+ Learn more in
62
+ the [moderation guide](https://platform.openai.com/docs/guides/moderation).
63
63
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.
66
67
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).
72
72
73
73
extra_headers: Send extra headers
74
74
@@ -117,7 +117,7 @@ def with_streaming_response(self) -> AsyncModerationsWithStreamingResponse:
117
117
async def create (
118
118
self ,
119
119
* ,
120
- input : Union [str , List [str ]],
120
+ input : Union [str , List [str ], Iterable [ ModerationMultiModalInputParam ] ],
121
121
model : Union [str , ModerationModel ] | NotGiven = NOT_GIVEN ,
122
122
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
123
123
# 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(
126
126
extra_body : Body | None = None ,
127
127
timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
128
128
) -> ModerationCreateResponse :
129
- """
130
- Classifies if text is potentially harmful.
129
+ """Classifies if text and/or image inputs are potentially harmful.
131
130
132
- Args:
133
- input: The input text to classify
131
+ Learn more in
132
+ the [moderation guide](https://platform.openai.com/docs/guides/moderation).
134
133
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.
137
137
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).
143
142
144
143
extra_headers: Send extra headers
145
144
0 commit comments