Class OpenAiModerationApi
java.lang.Object
org.springframework.ai.openai.api.OpenAiModerationApi
OpenAI Moderation API.
- Author:
- Ahmed Yousri
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final record
static final record
static final record
static final record
static final record
static final record
-
Field Summary
-
Constructor Summary
ConstructorDescriptionOpenAiModerationApi
(String openAiToken) Create a new OpenAI Moderation api with base URL set to https://api.openai.comOpenAiModerationApi
(String baseUrl, String openAiToken, org.springframework.web.client.RestClient.Builder restClientBuilder, org.springframework.web.client.ResponseErrorHandler responseErrorHandler) -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<OpenAiModerationApi.OpenAiModerationResponse>
createModeration
(OpenAiModerationApi.OpenAiModerationRequest openAiModerationRequest)
-
Field Details
-
DEFAULT_MODERATION_MODEL
- See Also:
-
-
Constructor Details
-
OpenAiModerationApi
Create a new OpenAI Moderation api with base URL set to https://api.openai.com- Parameters:
openAiToken
- OpenAI apiKey.
-
OpenAiModerationApi
-
-
Method Details
-
createModeration
public org.springframework.http.ResponseEntity<OpenAiModerationApi.OpenAiModerationResponse> createModeration(OpenAiModerationApi.OpenAiModerationRequest openAiModerationRequest)
-