We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 507cc36 commit 50858d4Copy full SHA for 50858d4
apps/sim/lib/knowledge/dynamic-tables.ts
@@ -22,6 +22,9 @@ function isTagSlotKey(key: string): key is AllTagSlot {
22
23
/** Convert a KB UUID to a valid Postgres table name */
24
export function kbTableName(kbId: string): string {
25
+ if (!/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(kbId)) {
26
+ throw new Error(`Invalid knowledge base ID: "${kbId}". Must be a UUID.`)
27
+ }
28
return `kb_embeddings_${kbId.replace(/-/g, '_')}`
29
}
30
0 commit comments