Class MessageTextFileCitationAnnotation

java.lang.Object
com.azure.ai.openai.assistants.models.MessageTextAnnotation
com.azure.ai.openai.assistants.models.MessageTextFileCitationAnnotation
All Implemented Interfaces:
com.azure.json.JsonSerializable<MessageTextAnnotation>

public final class MessageTextFileCitationAnnotation extends MessageTextAnnotation
A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the 'file_search' tool to search files.
  • Constructor Details

    • MessageTextFileCitationAnnotation

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

    • getFileCitation

      public MessageTextFileCitationDetails getFileCitation()
      Get the fileCitation property: A citation within the message that points to a specific quote from a specific file. Generated when the assistant uses the "file_search" tool to search files.
      Returns:
      the fileCitation value.
    • toJson

      public com.azure.json.JsonWriter toJson(com.azure.json.JsonWriter jsonWriter) throws IOException
      Specified by:
      toJson in interface com.azure.json.JsonSerializable<MessageTextAnnotation>
      Overrides:
      toJson in class MessageTextAnnotation
      Throws:
      IOException
    • fromJson

      public static MessageTextFileCitationAnnotation fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      Reads an instance of MessageTextFileCitationAnnotation from the JsonReader.
      Parameters:
      jsonReader - The JsonReader being read.
      Returns:
      An instance of MessageTextFileCitationAnnotation if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.
      Throws:
      IllegalStateException - If the deserialized JSON object was missing any required properties.
      IOException - If an error occurs while reading the MessageTextFileCitationAnnotation.
    • getType

      public String getType()
      Get the type property: The object type.
      Overrides:
      getType in class MessageTextAnnotation
      Returns:
      the type value.
    • getStartIndex

      public Integer getStartIndex()
      Get the startIndex property: The first text index associated with this text annotation.
      Returns:
      the startIndex value.
    • getEndIndex

      public Integer getEndIndex()
      Get the endIndex property: The last text index associated with this text annotation.
      Returns:
      the endIndex value.
    • setStartIndex

      public MessageTextFileCitationAnnotation setStartIndex(Integer startIndex)
      Set the startIndex property: The first text index associated with this text annotation.
      Parameters:
      startIndex - the startIndex value to set.
      Returns:
      the MessageTextFileCitationAnnotation object itself.
    • setEndIndex

      public MessageTextFileCitationAnnotation setEndIndex(Integer endIndex)
      Set the endIndex property: The last text index associated with this text annotation.
      Parameters:
      endIndex - the endIndex value to set.
      Returns:
      the MessageTextFileCitationAnnotation object itself.