Record Class ClassifierRequest

java.lang.Object
java.lang.Record
com.google.adk.classifiers.ClassifierRequest
Record Components:
input - what the questions are about
questions - each caller-chosen question ID mapped to its question; the ClassifierResponse answers under the same IDs. There is at least one question, and the questions keep the map's iteration order.

@Experimental public record ClassifierRequest(ClassifierInput input, com.google.common.collect.ImmutableMap<String,Question> questions) extends Record
A request to a Classifier to answer one or more typed questions about an input.
  • Constructor Details

    • ClassifierRequest

      public ClassifierRequest(ClassifierInput input, com.google.common.collect.ImmutableMap<String,Question> questions)
      Creates an instance of a ClassifierRequest record class.
      Parameters:
      input - the value for the input record component
      questions - the value for the questions record component
    • ClassifierRequest

      public ClassifierRequest(ClassifierInput input, Map<String, ? extends Question> questions)
      Creates a request with a copy of questions.
    • ClassifierRequest

      public ClassifierRequest(String text, Map<String, ? extends Question> questions)
      Creates a request that classifies plain text.
    • ClassifierRequest

      public ClassifierRequest(com.google.genai.types.Content content, Map<String, ? extends Question> questions)
      Creates a request that classifies content.
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • input

      public ClassifierInput input()
      Returns the value of the input record component.
      Returns:
      the value of the input record component
    • questions

      public com.google.common.collect.ImmutableMap<String,Question> questions()
      Returns the value of the questions record component.
      Returns:
      the value of the questions record component