Skip to content

Commit 6ea0490

Browse files
authored
Merge pull request #382 from ueberdosis:feature/ai-toolkit-updated-chunk-format
feat: new chunk format in ai toolkit
2 parents b2b554a + 072e197 commit 6ea0490

File tree

2 files changed

+25
-3
lines changed

2 files changed

+25
-3
lines changed

src/content/content-ai/capabilities/ai-toolkit/changelog/ai-toolkit.mdx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@ meta:
88

99
# @tiptap-pro/ai-toolkit
1010

11+
## 3.0.0-alpha.7
12+
13+
### Major Changes
14+
15+
- Improved chunk format: now it includes the range of the chunk in the document
16+
- Improve accuracy of `getHtmlRange`, `getJsonRange`, and `getTextRange` methods when returning the chunk index
17+
1118
## 3.0.0-alpha.6
1219

1320
### Patch Changes

src/content/content-ai/capabilities/ai-toolkit/primitives/read-the-document.mdx

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,12 @@ Split the document into text chunks for large-content processing.
210210

211211
### Returns
212212

213-
`string[]`: Array of text chunks
213+
`TextChunk[]`: Array of text chunks, where each chunk contains:
214+
215+
- `content` (`string`): The text content of the chunk
216+
- `range` (`Range`): The range in the document where the chunk starts and ends
217+
- `from` (`number`): Start position in the document
218+
- `to` (`number`): End position in the document
214219

215220
### Example
216221

@@ -231,7 +236,12 @@ Split the document into HTML chunks for large-content processing.
231236

232237
### Returns
233238

234-
`string[]`: Array of HTML chunks
239+
`HtmlChunk[]`: Array of HTML chunks, where each chunk contains:
240+
241+
- `content` (`string`): The HTML content of the chunk
242+
- `range` (`Range`): The range in the document where the chunk starts and ends
243+
- `from` (`number`): Start position in the document
244+
- `to` (`number`): End position in the document
235245

236246
### Example
237247

@@ -252,7 +262,12 @@ Split the document into Tiptap JSON chunks for large-content processing.
252262

253263
### Returns
254264

255-
`any[]`: Array of Tiptap JSON chunks
265+
`JsonChunk[]`: Array of Tiptap JSON chunks, where each chunk contains:
266+
267+
- `content` (`any`): The Tiptap JSON content of the chunk. It is the JSON of a Fragment of the document.
268+
- `range` (`Range`): The range in the document where the chunk starts and ends
269+
- `from` (`number`): Start position in the document
270+
- `to` (`number`): End position in the document
256271

257272
### Example
258273

0 commit comments

Comments
 (0)