You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/docs/03-ai-sdk-core/30-embeddings.mdx
+29-2Lines changed: 29 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,15 +10,42 @@ In this space, similar words are close to each other, and the distance between w
10
10
11
11
## Embedding a Single Value
12
12
13
-
The Vercel AI SDK provides the `embed` function to embed single values, which is useful for tasks such as finding similar words
14
-
or phrases or clustering text. You can use it with embeddings models, e.g. `openai.embedding('text-embedding-3-large')` or `mistral.embedding('mistral-embed')`.
13
+
The Vercel AI SDK provides the [`embed`](/docs/reference/ai-sdk-core/embed) function to embed single values, which is useful for tasks such as finding similar words
14
+
or phrases or clustering text.
15
+
You can use it with embeddings models, e.g. `openai.embedding('text-embedding-3-large')` or `mistral.embedding('mistral-embed')`.
15
16
16
17
```tsx
17
18
import { embed } from'ai';
18
19
import { openai } from'@ai-sdk/openai';
19
20
21
+
// 'embedding' is a single embedding object (number[])
0 commit comments