Skip to content

Commit

Permalink
Clean up logs
Browse files Browse the repository at this point in the history
  • Loading branch information
justyns committed Jul 24, 2024
1 parent 48ae22f commit e8432b5
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/embeddings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import { editor, system } from "$sb/syscalls.ts";
import { aiSettings, configureSelectedModel } from "./init.ts";
import * as cache from "./cache.ts";

const searchPrefix = "🤖 ";

/**
* Generate embeddings for each paragraph in a page, and then indexes
* them.
Expand Down Expand Up @@ -158,8 +160,6 @@ export async function indexSummary({ name: page, tree }: IndexTreeEvent) {
cache.setCache(cacheKey, summary);
}

// console.log("summary", summary);

const summaryEmbeddings = await currentEmbeddingProvider.generateEmbeddings({
text: summary,
});
Expand Down Expand Up @@ -234,8 +234,6 @@ export async function searchEmbeddings(
results.push(...summaryResults);
}

// log("client", "AI: searchEmbeddings", results);

return results
.sort((a, b) => b.similarity - a.similarity)
.slice(0, numResults);
Expand Down Expand Up @@ -289,6 +287,7 @@ export async function searchCombinedEmbeddings(
-1,
);
} else {
console.log("system.invokeFunctionOnServer not supported.");
searchResults = await searchEmbeddings(query, -1);
}

Expand Down Expand Up @@ -337,8 +336,6 @@ export async function debugSearchEmbeddings() {
log("any", "AI: Search results", searchResults);
}

const searchPrefix = "🤖 ";

/**
* Display an empty "AI: Search" page
*/
Expand Down

0 comments on commit e8432b5

Please sign in to comment.