MediaPipeTasksRetrieval Framework Reference
Stay organized with collections
Save and categorize content based on your preferences.
TextChunker
Splits long UTF-8 documents into smaller segments suitable for embedding.
-
Partitions text into ordered segments.
Declaration
Swift
func chunk(text: String) throws -> [String]
Parameters
text | Source document text to partition. |
Return Value
Ordered text chunks, or an empty array when text contains no non-whitespace text.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-12-03 UTC.
[null,null,["Last updated 2026-12-03 UTC."],[],[]]