Class OpenAiModerationApi

java.lang.Object
org.springframework.ai.openai.api.OpenAiModerationApi

public class OpenAiModerationApi extends Object
OpenAI Moderation API.
Author:
Ahmed Yousri, Ilayaperumal Gopinathan
See Also:
  • Field Details

  • Constructor Details

    • OpenAiModerationApi

      @Deprecated(forRemoval=true, since="1.0.0-M6") public OpenAiModerationApi(String openAiToken)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Create a new OpenAI Moderation api with base URL set to https://api.openai.com
      Parameters:
      openAiToken - OpenAI apiKey.
    • OpenAiModerationApi

      @Deprecated(forRemoval=true, since="1.0.0-M6") public OpenAiModerationApi(String baseUrl, String openAiToken, org.springframework.web.client.RestClient.Builder restClientBuilder, org.springframework.web.client.ResponseErrorHandler responseErrorHandler)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • 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