Skip to content

Commit 27f0190

Browse files
committed
feat: deprecate search() function and update version to 2.0.2
1 parent d2c1e96 commit 27f0190

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
- 🔁 **Query expansion** — improve recall for vague searches
3434
- 🤝 **Find similar items** — easy recommendation / related content
3535
- 🌐 **Fully offline** via [`@xenova/transformers`](https://github.com/xenova/transformers.js) (WASM/Node) — no cloud, no API keys needed
36-
-**Optional OpenAI embeddings**switch to `text-embedding-3-small` or others with one line of config
36+
-**Optional OpenAI embeddings**`text-embedding-3-small` or others with one line of config
3737
- 🖥 **CLI-ready architecture** — easily wrap into command-line tools or scripts
3838

3939
---

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ai-embed-search",
3-
"version": "2.0.1",
3+
"version": "2.0.2",
44
"type": "module",
55
"description": "Smart. Simple. Local. AI-powered semantic search in TypeScript using transformer embeddings. No cloud, no API keys — 100% offline.",
66
"author": "Peter Sibirtsev <sibirtsev.peter@gmail.com>",

src/core/engine.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,16 @@ export async function loadEmbeds(filePath: string): Promise<void> {
9898
}
9999
}
100100

101+
let warnedSearchDeprecated = false;
102+
101103
export function search(query: string, maxItems = 5) {
104+
if (!warnedSearchDeprecated) {
105+
console.warn(
106+
'[ai-embed-search] `search()` is deprecated. Use `searchV2()` for better results (cosine | softmax | mmr, filters).'
107+
);
108+
warnedSearchDeprecated = true;
109+
}
110+
102111
let filterFn: (result: SearchResult) => boolean = () => true;
103112

104113
const runSearch = async (): Promise<SearchResult[]> => {

0 commit comments

Comments
 (0)