Absolute path to the file to chunk
Regex pattern to split on (default: 2+ newlines). Must have 'g' flag.
OptionalmaxTokensPerChunk: numberOptional maximum tokens per chunk (will split if exceeded)
Characters per token estimate (default: 2.5 for code)
Array of chunks with content and position information
Chunks a file based on a delimiter regex pattern. Returns chunks with their original positions in the file.
If maxTokensPerChunk is specified, oversized chunks will be automatically split to ensure all chunks can be embedded.