Package org.springframework.ai.openai
Class OpenAiModerationModel
java.lang.Object
org.springframework.ai.openai.OpenAiModerationModel
- All Implemented Interfaces:
Model<ModerationPrompt,
,ModerationResponse> ModerationModel
OpenAiModerationModel is a class that implements the ModerationModel interface. It
provides a client for calling the OpenAI moderation generation API.
- Since:
- 1.0.0
- Author:
- Ahmed Yousri
-
Constructor Summary
ConstructorDescriptionOpenAiModerationModel
(OpenAiModerationApi openAiModerationApi) OpenAiModerationModel
(OpenAiModerationApi openAiModerationApi, org.springframework.retry.support.RetryTemplate retryTemplate) -
Method Summary
Modifier and TypeMethodDescriptioncall
(ModerationPrompt moderationPrompt) Executes a method call to the AI model.withDefaultOptions
(OpenAiModerationOptions defaultOptions)
-
Constructor Details
-
OpenAiModerationModel
-
OpenAiModerationModel
public OpenAiModerationModel(OpenAiModerationApi openAiModerationApi, org.springframework.retry.support.RetryTemplate retryTemplate)
-
-
Method Details
-
getDefaultOptions
-
withDefaultOptions
-
call
Description copied from interface:Model
Executes a method call to the AI model.- Specified by:
call
in interfaceModel<ModerationPrompt,
ModerationResponse> - Specified by:
call
in interfaceModerationModel
- Parameters:
moderationPrompt
- the request object to be sent to the AI model- Returns:
- the response from the AI model
-