Record Class AiServiceMethodCreateInfo.TemplateInfo

java.lang.Object
java.lang.Record
io.quarkiverse.langchain4j.runtime.aiservice.AiServiceMethodCreateInfo.TemplateInfo
Record Components:
methodParamPosition - this is used to determine the position of the parameter that holds the template, and it is never set if 'text' is set
Enclosing class:
AiServiceMethodCreateInfo

public static record AiServiceMethodCreateInfo.TemplateInfo(Optional<String> text, Map<String,Integer> nameToParamPosition, Optional<Integer> methodParamPosition) extends Record
  • Constructor Details

    • TemplateInfo

      public TemplateInfo(Optional<String> text, Map<String,Integer> nameToParamPosition, Optional<Integer> methodParamPosition)
      Creates an instance of a TemplateInfo record class.
      Parameters:
      text - the value for the text record component
      nameToParamPosition - the value for the nameToParamPosition record component
      methodParamPosition - the value for the methodParamPosition record component
  • Method Details

    • fromText

      public static AiServiceMethodCreateInfo.TemplateInfo fromText(String text, Map<String,Integer> nameToParamPosition)
    • fromMethodParam

      public static AiServiceMethodCreateInfo.TemplateInfo fromMethodParam(Integer methodParamPosition, Map<String,Integer> nameToParamPosition)
    • 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.
    • text

      public Optional<String> text()
      Returns the value of the text record component.
      Returns:
      the value of the text record component
    • nameToParamPosition

      public Map<String,Integer> nameToParamPosition()
      Returns the value of the nameToParamPosition record component.
      Returns:
      the value of the nameToParamPosition record component
    • methodParamPosition

      public Optional<Integer> methodParamPosition()
      Returns the value of the methodParamPosition record component.
      Returns:
      the value of the methodParamPosition record component