NAME
Twilio::Rest::Knowledge::V2::Chunk - The Chunk resource
SYNOPSIS
my $client = Twilio::Rest::Client->new($account_sid, $auth_token);
for my $chunk ($client->knowledge->v2->chunks($kb_id, $knowledge_id)->read({}, 20)) {
...
}
DESCRIPTION
This file holds ChunkList, ChunkPage and ChunkInstance. Methods that make a request throw Twilio::Exceptions::RestException on an error response.
ChunkList
Returned by $client->knowledge->v2->chunks($kb_id, $knowledge_id). See also Twilio::ListResource.
read
my @records = $client->knowledge->v2->chunks($kb_id, $knowledge_id)->read(\%options, $limit, $page_size);
Retrieve a paginated list of all processed content chunks from a specific knowledge source. Chunks are smaller segments of content that have been extracted and processed from the original knowledge source. Each chunk contains content text and associated metadata that can be used for semantic search and retrieval operations. Returns the records as a list, fetching as many pages as it needs.
stream
my $stream = $client->knowledge->v2->chunks($kb_id, $knowledge_id)->stream(\%options, $limit, $page_size);
Takes the same arguments as "read", and returns a Twilio::Stream.
page
my $page = $client->knowledge->v2->chunks($kb_id, $knowledge_id)->page(\%options, $page_size, $page_token);
Fetches one page, and returns a Twilio::TokenPaginationPage. This API pages by token, so there is no page number.
get_page
my $page = $client->knowledge->v2->chunks($kb_id, $knowledge_id)->get_page($url);
Fetches the page at a URL given by Twilio.
ChunkPage
A Twilio::Page of ChunkInstance objects.
records_key
build_instance
Used by Twilio::Page.
ChunkInstance
See also Twilio::InstanceResource.
Its fields are:
- chunk_index
-
0-based position of this chunk within its source document for a single ingestion run.
- content
-
The chunk content.
- created_at
-
The date and time in GMT when the Chunk was created specified in ISO 8601 format. A Time::Piece object in UTC. See "date_time" in Twilio::Deserialize.
- document_number
-
Physical page number (1-based). PDF sources only; omitted for all other source types.
- document_title
-
Human-readable title of the source document. Web: HTML <title> from the crawled page. File: filename from Unstructured metadata. Text: knowledge name from the knowledge source.
- document_url
-
Specific page URL this chunk was crawled from. Web sources only; null for File and Text sources.
CONSTRUCTORS
new
Objects here come from the methods above, so there is no need to call new directly.
LICENSE
Copyright (c) 2026 Francisco Zarabozo. Released under the MIT License.