Skip to content

Commit 63c5fdf

Browse files
committed
fix(knowledge): add knowledge-base to usage_log_source enum, fix docs-chunker type
1 parent 61cfb7e commit 63c5fdf

File tree

4 files changed

+11
-9
lines changed

4 files changed

+11
-9
lines changed

apps/sim/lib/chunkers/docs-chunker.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -81,15 +81,8 @@ export class DocsChunker {
8181
const textChunks = await this.splitContent(markdownContent)
8282

8383
logger.info(`Generating embeddings for ${textChunks.length} chunks in ${relativePath}`)
84-
const { embeddings } =
85-
textChunks.length > 0
86-
? await generateEmbeddings(textChunks)
87-
: {
88-
embeddings: [] as number[][],
89-
totalTokens: 0,
90-
isBYOK: false,
91-
modelName: 'text-embedding-3-small',
92-
}
84+
const embeddings: number[][] =
85+
textChunks.length > 0 ? (await generateEmbeddings(textChunks)).embeddings : []
9386
const embeddingModel = 'text-embedding-3-small'
9487

9588
const chunks: DocChunk[] = []
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ALTER TYPE "public"."usage_log_source" ADD VALUE 'knowledge-base';

packages/db/migrations/meta/_journal.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1289,6 +1289,13 @@
12891289
"when": 1775149654511,
12901290
"tag": "0184_hard_thaddeus_ross",
12911291
"breakpoints": true
1292+
},
1293+
{
1294+
"idx": 185,
1295+
"version": "7",
1296+
"when": 1775236630000,
1297+
"tag": "0185_knowledge_base_usage_source",
1298+
"breakpoints": true
12921299
}
12931300
]
12941301
}

packages/db/schema.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2273,6 +2273,7 @@ export const usageLogSourceEnum = pgEnum('usage_log_source', [
22732273
'workspace-chat',
22742274
'mcp_copilot',
22752275
'mothership_block',
2276+
'knowledge-base',
22762277
])
22772278

22782279
export const usageLog = pgTable(

0 commit comments

Comments
 (0)