(messages: ChunkMessageInput[])
| 76 | } |
| 77 | |
| 78 | function setup(messages: ChunkMessageInput[]) { |
| 79 | const dir = makeTempDir() |
| 80 | const dbPath = path.join(dir, 'embedding_index.db') |
| 81 | const store = new EmbeddingIndexStore(dbPath) |
| 82 | const stateStore = new SemanticIndexStateStore(dbPath) |
| 83 | stateStore.enable({ |
| 84 | dbPathHash: DB_HASH, |
| 85 | dbPath: '/chat/a.db', |
| 86 | modelId: MODEL, |
| 87 | chunkerVersion: 'v1.1', |
| 88 | chunkerConfigHash: 'cfg', |
| 89 | }) |
| 90 | return { store, stateStore, source: makeSource(messages) } |
| 91 | } |
| 92 | |
| 93 | function countStored(store: EmbeddingIndexStore): number { |
| 94 | return store.queryDense({ dbPathHash: DB_HASH, modelId: MODEL, dim: 4, embedding: [1, 0, 0, 0], k: 1000 }).length |
no test coverage detected