Class AnalyzeTextOptions

java.lang.Object
com.azure.ai.contentsafety.models.AnalyzeTextOptions

public final class AnalyzeTextOptions extends Object
The text analysis request.
  • Constructor Details

    • AnalyzeTextOptions

      public AnalyzeTextOptions(String text)
      Creates an instance of AnalyzeTextOptions class.
      Parameters:
      text - the text value to set.
  • Method Details

    • getText

      public String getText()
      Get the text property: The text needs to be analyzed. We support a maximum of 10k Unicode characters (Unicode code points) in the text of one request.
      Returns:
      the text value.
    • getCategories

      public List<TextCategory> getCategories()
      Get the categories property: The categories will be analyzed. If they are not assigned, a default set of analysis results for the categories will be returned.
      Returns:
      the categories value.
    • setCategories

      public AnalyzeTextOptions setCategories(List<TextCategory> categories)
      Set the categories property: The categories will be analyzed. If they are not assigned, a default set of analysis results for the categories will be returned.
      Parameters:
      categories - the categories value to set.
      Returns:
      the AnalyzeTextOptions object itself.
    • getBlocklistNames

      public List<String> getBlocklistNames()
      Get the blocklistNames property: The names of blocklists.
      Returns:
      the blocklistNames value.
    • setBlocklistNames

      public AnalyzeTextOptions setBlocklistNames(List<String> blocklistNames)
      Set the blocklistNames property: The names of blocklists.
      Parameters:
      blocklistNames - the blocklistNames value to set.
      Returns:
      the AnalyzeTextOptions object itself.
    • isHaltOnBlocklistHit

      public Boolean isHaltOnBlocklistHit()
      Get the haltOnBlocklistHit property: When set to true, further analyses of harmful content will not be performed in cases where blocklists are hit. When set to false, all analyses of harmful content will be performed, whether or not blocklists are hit.
      Returns:
      the haltOnBlocklistHit value.
    • setHaltOnBlocklistHit

      public AnalyzeTextOptions setHaltOnBlocklistHit(Boolean haltOnBlocklistHit)
      Set the haltOnBlocklistHit property: When set to true, further analyses of harmful content will not be performed in cases where blocklists are hit. When set to false, all analyses of harmful content will be performed, whether or not blocklists are hit.
      Parameters:
      haltOnBlocklistHit - the haltOnBlocklistHit value to set.
      Returns:
      the AnalyzeTextOptions object itself.
    • getOutputType

      public AnalyzeTextOutputType getOutputType()
      Get the outputType property: This refers to the type of text analysis output. If no value is assigned, the default value will be "FourSeverityLevels".
      Returns:
      the outputType value.
    • setOutputType

      public AnalyzeTextOptions setOutputType(AnalyzeTextOutputType outputType)
      Set the outputType property: This refers to the type of text analysis output. If no value is assigned, the default value will be "FourSeverityLevels".
      Parameters:
      outputType - the outputType value to set.
      Returns:
      the AnalyzeTextOptions object itself.