Skip to content

Commit

Permalink
fix: fix debug log lines issue
Browse files Browse the repository at this point in the history
  • Loading branch information
adhityan committed Nov 26, 2024
1 parent 11ceaf2 commit 186278e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions databases/embedjs-lancedb/src/lance-db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export class LanceDb implements BaseVectorDatabase {
const client = await connect(dir);

const list = await client.tableNames();
this.debug.log(`Table names found - [${list.join(',')}]`);
this.debug(`Table names found - [${list.join(',')}]`);
if (list.indexOf(LanceDb.STATIC_DB_NAME) > -1) this.table = await client.openTable(LanceDb.STATIC_DB_NAME);
else {
//TODO: You can add a proper schema instead of a sample record now but it requires another package apache-arrow; another install on downstream as well
Expand Down Expand Up @@ -61,14 +61,14 @@ export class LanceDb implements BaseVectorDatabase {
};
});

this.debug.log(`Executing insert of ${mapped.length} entries`);
this.debug(`Executing insert of ${mapped.length} entries`);
await this.table.add(mapped);
return mapped.length; //TODO: check if vectorDb has addressed the issue where add returns undefined
}

async similaritySearch(query: number[], k: number): Promise<ExtractChunkData[]> {
const results = await this.table.search(query).limit(k).toArray();
this.debug.log(`Query found ${results.length} entries`);
this.debug(`Query found ${results.length} entries`);

return (
results
Expand Down
4 changes: 2 additions & 2 deletions databases/embedjs-libsql/src/libsql-db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export class LibSqlDb implements BaseVectorDatabase {
${values.join(',')}
);`;

this.debug.log(`Executing statement - ${statement}`);
this.debug(`Executing statement - ${statement}`);
const result = await this.client.execute(statement);
return result.rowsAffected;
}
Expand All @@ -51,7 +51,7 @@ export class LibSqlDb implements BaseVectorDatabase {
TOP ${k}
ASC;`;

this.debug.log(`Executing statement - ${statement}`);
this.debug(`Executing statement - ${statement}`);
const results = await this.client.execute(statement);

return results.rows.map((result) => {
Expand Down
2 changes: 1 addition & 1 deletion databases/embedjs-lmdb/src/lmdb-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export class LmdbStore implements BaseStore {
}

async init(): Promise<void> {
this.debug.log(`Opening LMDB connection with path - ${this.dataPath}`);
this.debug(`Opening LMDB connection with path - ${this.dataPath}`);
this.database = lmdb.open({
path: this.dataPath,
compression: true,
Expand Down

0 comments on commit 186278e

Please sign in to comment.