Skip to content

Commit 130eabb

Browse files
committed
docs: add embed
1 parent cd187cb commit 130eabb

File tree

2 files changed

+72
-1
lines changed

2 files changed

+72
-1
lines changed
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
---
2+
title: Embeddings (WIP)
3+
# description:
4+
---
5+
6+
---
7+
8+
## Install
9+
10+
```package-install
11+
npm i @xsai/embed
12+
```
13+
14+
[Try with pkg-size.dev](https://pkg-size.dev/@xsai/embed)
15+
16+
## embed
17+
18+
### Options
19+
20+
#### model
21+
22+
string.
23+
24+
#### input
25+
26+
string.
27+
28+
## embedMany
29+
30+
### Options
31+
32+
#### model
33+
34+
string.
35+
36+
#### input
37+
38+
string array.
39+
40+
## Examples
41+
42+
### Embedding a Single Value
43+
44+
```ts twoslash
45+
import { embed } from '@xsai/embed'
46+
47+
const { embedding } = await embed({
48+
model: 'nomic-embed-text',
49+
input: 'sunny day at the beach',
50+
})
51+
```
52+
53+
### Embedding Many Values
54+
55+
```ts twoslash
56+
import { embedMany } from '@xsai/embed'
57+
58+
const { embeddings } = await embedMany({
59+
model: 'nomic-embed-text',
60+
input: [
61+
'sunny day at the beach',
62+
'rainy afternoon in the city',
63+
'snowy night in the mountains',
64+
],
65+
})
66+
```
67+
68+
## References
69+
70+
see [`@xsai/embed`](../references/embed)

docs/content/docs/get-started/meta.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"generate-text",
77
"stream-text",
88
"generate-object",
9-
"tool"
9+
"tool",
10+
"embed"
1011
]
1112
}

0 commit comments

Comments
 (0)