Class Segment

java.lang.Object
com.google.genai.JsonSerializable
com.google.genai.types.Segment

public abstract class Segment extends JsonSerializable
Segment of the content.
  • Constructor Details

    • Segment

      public Segment()
  • Method Details

    • endIndex

      public abstract Optional<Integer> endIndex()
      Output only. End index in the given Part, measured in bytes. Offset from the start of the Part, exclusive, starting at zero.
    • partIndex

      public abstract Optional<Integer> partIndex()
      Output only. The index of a Part object within its parent Content object.
    • startIndex

      public abstract Optional<Integer> startIndex()
      Output only. Start index in the given Part, measured in bytes. Offset from the start of the Part, inclusive, starting at zero.
    • text

      public abstract Optional<String> text()
      Output only. The text corresponding to the segment from the response.
    • builder

      public static Segment.Builder builder()
      Instantiates a builder for Segment.
    • toBuilder

      public abstract Segment.Builder toBuilder()
      Creates a builder with the same values as this instance.
    • fromJson

      public static Segment fromJson(String jsonString)
      Deserializes a JSON string to a Segment object.