parseUrl
Generic URL parser. Extracts standard URL parts (domain, path, query) plus Prisme.ai-specific fields (workspaceId, file id/filename).
Returns an object with the following fields:
How id / filename splitting works
The last path segment is parsed based on the number of dots:
- 2+ dots (
{id}.{name}.{ext}):idis everything before the first dot,filenameis the rest. - 1 dot (
{name}.{ext}): the whole segment is thefilename, noid. - 0 dots: the whole segment is the
filename, noid.
Examples
Extract a file ID from a native upload URL:splitText
Split text into chunks using a recursive character splitting strategy. The splitter tries separators in order, splits on the first one found, merges small pieces back up tochunkSize, maintains chunkOverlap between consecutive chunks, and recurses with finer separators for pieces still too large.
Returns an array of
{ content, size } objects: