semantic-router-ts 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -11
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
#
|
|
1
|
+
# semantic-router-ts
|
|
2
2
|
|
|
3
|
-
Superfast semantic routing for LLMs and AI agents.
|
|
3
|
+
Superfast semantic routing for LLMs and AI agents.
|
|
4
4
|
|
|
5
|
-
[](https://www.npmjs.com/package/semantic-router-ts)
|
|
6
6
|
[](https://opensource.org/licenses/MIT)
|
|
7
7
|
|
|
8
8
|
## Features
|
|
@@ -17,7 +17,7 @@ Superfast semantic routing for LLMs and AI agents. TypeScript port of [aurelio-l
|
|
|
17
17
|
## Installation
|
|
18
18
|
|
|
19
19
|
```bash
|
|
20
|
-
npm install
|
|
20
|
+
npm install semantic-router-ts
|
|
21
21
|
|
|
22
22
|
# For local/offline embeddings (recommended)
|
|
23
23
|
npm install @xenova/transformers
|
|
@@ -29,7 +29,7 @@ npm install openai
|
|
|
29
29
|
## Quick Start
|
|
30
30
|
|
|
31
31
|
```typescript
|
|
32
|
-
import { SemanticRouter, Route, LocalEncoder } from '
|
|
32
|
+
import { SemanticRouter, Route, LocalEncoder } from 'semantic-router-ts';
|
|
33
33
|
|
|
34
34
|
// Define your routes
|
|
35
35
|
const routes: Route[] = [
|
|
@@ -74,7 +74,7 @@ console.log(noMatch.name); // null
|
|
|
74
74
|
Uses [Transformers.js](https://huggingface.co/docs/transformers.js) for fully offline embeddings:
|
|
75
75
|
|
|
76
76
|
```typescript
|
|
77
|
-
import { LocalEncoder } from '
|
|
77
|
+
import { LocalEncoder } from 'semantic-router-ts';
|
|
78
78
|
|
|
79
79
|
const encoder = new LocalEncoder({
|
|
80
80
|
model: 'Xenova/all-MiniLM-L6-v2', // Default, 384 dimensions
|
|
@@ -93,7 +93,7 @@ Supported models:
|
|
|
93
93
|
Uses OpenAI's embedding API:
|
|
94
94
|
|
|
95
95
|
```typescript
|
|
96
|
-
import { OpenAIEncoder } from '
|
|
96
|
+
import { OpenAIEncoder } from 'semantic-router-ts';
|
|
97
97
|
|
|
98
98
|
const encoder = new OpenAIEncoder({
|
|
99
99
|
apiKey: process.env.OPENAI_API_KEY,
|
|
@@ -178,10 +178,6 @@ interface RouteMatch {
|
|
|
178
178
|
}
|
|
179
179
|
```
|
|
180
180
|
|
|
181
|
-
## Acknowledgments
|
|
182
|
-
|
|
183
|
-
This is a TypeScript port of the excellent [semantic-router](https://github.com/aurelio-labs/semantic-router) by Aurelio Labs.
|
|
184
|
-
|
|
185
181
|
## License
|
|
186
182
|
|
|
187
183
|
MIT
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "semantic-router-ts",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "Superfast semantic routing for LLMs and AI agents
|
|
3
|
+
"version": "1.0.3",
|
|
4
|
+
"description": "Superfast semantic routing for LLMs and AI agents",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
7
7
|
"types": "dist/index.d.ts",
|