The zero-based end index of the segment within the specified Part, measured in UTF-8 bytes. This offset is exclusive, meaning the character at this index is not included in the segment.
The zero-based index of the Part object within the parts array of its parent Content object. This identifies which part of the content the segment belongs to.
The zero-based start index of the segment within the specified Part, measured in UTF-8 bytes. This offset is inclusive, starting from 0 at the beginning of the part's content (e.g., Part.text).
The text corresponding to the segment from the response.
Segment.endIndex
The zero-based end index of the segment within the specified Part, measured in UTF-8 bytes. This offset is exclusive, meaning the character at this index is not included in the segment.
Signature:
endIndex:number;
Segment.partIndex
The zero-based index of the Part object within the parts array of its parent Content object. This identifies which part of the content the segment belongs to.
Signature:
partIndex:number;
Segment.startIndex
The zero-based start index of the segment within the specified Part, measured in UTF-8 bytes. This offset is inclusive, starting from 0 at the beginning of the part's content (e.g., Part.text).
Signature:
startIndex:number;
Segment.text
The text corresponding to the segment from the response.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-07-17 UTC."],[],[],null,["# Segment interface\n\nRepresents a specific segment within a [Content](./ai.content.md#content_interface) object, often used to pinpoint the exact location of text or data that grounding information refers to.\n\n**Signature:** \n\n export interface Segment \n\nProperties\n----------\n\n| Property | Type | Description |\n|-------------------------------------------------|--------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [endIndex](./ai.segment.md#segmentendindex) | number | The zero-based end index of the segment within the specified `Part`, measured in UTF-8 bytes. This offset is exclusive, meaning the character at this index is not included in the segment. |\n| [partIndex](./ai.segment.md#segmentpartindex) | number | The zero-based index of the [Part](./ai.md#part) object within the `parts` array of its parent [Content](./ai.content.md#content_interface) object. This identifies which part of the content the segment belongs to. |\n| [startIndex](./ai.segment.md#segmentstartindex) | number | The zero-based start index of the segment within the specified `Part`, measured in UTF-8 bytes. This offset is inclusive, starting from 0 at the beginning of the part's content (e.g., `Part.text`). |\n| [text](./ai.segment.md#segmenttext) | string | The text corresponding to the segment from the response. |\n\nSegment.endIndex\n----------------\n\nThe zero-based end index of the segment within the specified `Part`, measured in UTF-8 bytes. This offset is exclusive, meaning the character at this index is not included in the segment.\n\n**Signature:** \n\n endIndex: number;\n\nSegment.partIndex\n-----------------\n\nThe zero-based index of the [Part](./ai.md#part) object within the `parts` array of its parent [Content](./ai.content.md#content_interface) object. This identifies which part of the content the segment belongs to.\n\n**Signature:** \n\n partIndex: number;\n\nSegment.startIndex\n------------------\n\nThe zero-based start index of the segment within the specified `Part`, measured in UTF-8 bytes. This offset is inclusive, starting from 0 at the beginning of the part's content (e.g., `Part.text`).\n\n**Signature:** \n\n startIndex: number;\n\nSegment.text\n------------\n\nThe text corresponding to the segment from the response.\n\n**Signature:** \n\n text: string;"]]