Class OpenAiModerationApi
java.lang.Object
org.springframework.ai.openai.api.OpenAiModerationApi
OpenAI Moderation API.
- Author:
- Ahmed Yousri, Ilayaperumal Gopinathan
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Builder to constructOpenAiModerationApi
instance.static final record
static final record
static final record
static final record
static final record
static final record
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionOpenAiModerationApi
(String baseUrl, ApiKey apiKey, org.springframework.util.MultiValueMap<String, String> headers, org.springframework.web.client.RestClient.Builder restClientBuilder, org.springframework.web.client.ResponseErrorHandler responseErrorHandler) Create a new OpenAI Moderation API with the provided base URL. -
Method Summary
Modifier and TypeMethodDescriptionstatic OpenAiModerationApi.Builder
builder()
org.springframework.http.ResponseEntity<OpenAiModerationApi.OpenAiModerationResponse>
createModeration
(OpenAiModerationApi.OpenAiModerationRequest openAiModerationRequest)
-
Field Details
-
DEFAULT_MODERATION_MODEL
- See Also:
-
-
Constructor Details
-
OpenAiModerationApi
public OpenAiModerationApi(String baseUrl, ApiKey apiKey, org.springframework.util.MultiValueMap<String, String> headers, org.springframework.web.client.RestClient.Builder restClientBuilder, org.springframework.web.client.ResponseErrorHandler responseErrorHandler) Create a new OpenAI Moderation API with the provided base URL.- Parameters:
baseUrl
- the base URL for the OpenAI API.apiKey
- OpenAI apiKey.restClientBuilder
- the rest client builder to use.
-
-
Method Details
-
createModeration
public org.springframework.http.ResponseEntity<OpenAiModerationApi.OpenAiModerationResponse> createModeration(OpenAiModerationApi.OpenAiModerationRequest openAiModerationRequest) -
builder
-