Skip to content

Commit 2636810

Browse files
committed
cleanup: add tracking_ids's to fern adapter chunk creation
1 parent 6137e19 commit 2636810

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

clients/trieve-fern-adapter/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "trieve-fern-adapter",
3-
"version": "0.0.3",
3+
"version": "0.0.4",
44
"type": "module",
55
"main": "dist/index.js",
66
"bin": "dist/index.js",

clients/trieve-fern-adapter/src/index.ts

+5
Original file line numberDiff line numberDiff line change
@@ -142,10 +142,14 @@ const extractChunksFromPath = async (
142142
metadata['description'] = subtitle;
143143
}
144144

145+
const tracking_id =
146+
`${slug ?? path.replace('.mdx', '')}-${heading}`.replace(' ', '-');
147+
145148
const chunk: ChunkReqPayload = {
146149
chunk_html,
147150
link,
148151
tag_set,
152+
tracking_id,
149153
metadata,
150154
group_tracking_ids: [path],
151155
convert_html_to_text: true,
@@ -226,6 +230,7 @@ const extractChunksFromOpenapiSpec = async (
226230
link: pageLink,
227231
tag_set: ['openapi-route', operationId, method],
228232
metadata,
233+
tracking_id: operationId,
229234
group_tracking_ids: [path],
230235
fulltext_boost: {
231236
phrase: heading,

0 commit comments

Comments
 (0)