Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix(knowledge): add knowledge-base to usage_log_source enum, fix docs…
…-chunker type
  • Loading branch information
waleedlatif1 committed Apr 3, 2026
commit 63c5fdf8efed42fed48550b4612c39fdf22672fe
11 changes: 2 additions & 9 deletions apps/sim/lib/chunkers/docs-chunker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,8 @@ export class DocsChunker {
const textChunks = await this.splitContent(markdownContent)

logger.info(`Generating embeddings for ${textChunks.length} chunks in ${relativePath}`)
const { embeddings } =
textChunks.length > 0
? await generateEmbeddings(textChunks)
: {
embeddings: [] as number[][],
totalTokens: 0,
isBYOK: false,
modelName: 'text-embedding-3-small',
}
const embeddings: number[][] =
textChunks.length > 0 ? (await generateEmbeddings(textChunks)).embeddings : []
const embeddingModel = 'text-embedding-3-small'

const chunks: DocChunk[] = []
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TYPE "public"."usage_log_source" ADD VALUE 'knowledge-base';
7 changes: 7 additions & 0 deletions packages/db/migrations/meta/_journal.json
Original file line number Diff line number Diff line change
Expand Up @@ -1289,6 +1289,13 @@
"when": 1775149654511,
"tag": "0184_hard_thaddeus_ross",
"breakpoints": true
},
{
"idx": 185,
"version": "7",
"when": 1775236630000,
"tag": "0185_knowledge_base_usage_source",
"breakpoints": true
}
]
}
1 change: 1 addition & 0 deletions packages/db/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2273,6 +2273,7 @@ export const usageLogSourceEnum = pgEnum('usage_log_source', [
'workspace-chat',
'mcp_copilot',
'mothership_block',
'knowledge-base',
])

export const usageLog = pgTable(
Expand Down
Loading