Skip to content

Commit

Permalink
cleanup: add tracking_ids's to fern adapter chunk creation
Browse files Browse the repository at this point in the history
  • Loading branch information
skeptrunedev committed Dec 10, 2024
1 parent 6137e19 commit 2636810
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion clients/trieve-fern-adapter/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "trieve-fern-adapter",
"version": "0.0.3",
"version": "0.0.4",
"type": "module",
"main": "dist/index.js",
"bin": "dist/index.js",
Expand Down
5 changes: 5 additions & 0 deletions clients/trieve-fern-adapter/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,14 @@ const extractChunksFromPath = async (
metadata['description'] = subtitle;
}

const tracking_id =
`${slug ?? path.replace('.mdx', '')}-${heading}`.replace(' ', '-');

const chunk: ChunkReqPayload = {
chunk_html,
link,
tag_set,
tracking_id,
metadata,
group_tracking_ids: [path],
convert_html_to_text: true,
Expand Down Expand Up @@ -226,6 +230,7 @@ const extractChunksFromOpenapiSpec = async (
link: pageLink,
tag_set: ['openapi-route', operationId, method],
metadata,
tracking_id: operationId,
group_tracking_ids: [path],
fulltext_boost: {
phrase: heading,
Expand Down

0 comments on commit 2636810

Please sign in to comment.