Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add embedding reference #1584

Merged
merged 2 commits into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions content/docs/07-reference/ai-sdk-core/05-embed.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
title: embed
description: Embed a single value using the AI SDK Core
---

# `embed`

Generate an embedding for a single value using an embedding model.

This is ideal for use cases where you need to embed a single value to e.g. retrieve similar items or to use the embedding in a downstream task.

## Import

<Snippet text={`import { embed } from "ai"`} prompt={false} />

<ReferenceTable packageName="core" functionName="embed" />
14 changes: 10 additions & 4 deletions content/docs/07-reference/ai-sdk-core/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,29 @@ description: Reference documentation for the AI SDK Core
cards={[
{
title: 'generateText',
description: 'Generate text from a model.',
description: 'Generate text from a language model.',
href: '/docs/reference/ai-sdk-core/generate-text',
},
{
title: 'streamText',
description: 'Stream text generation from a model.',
description: 'Stream text generation from a language model.',
href: '/docs/reference/ai-sdk-core/stream-text',
},
{
title: 'generateObject',
description: 'Generate structured data from a model.',
description: 'Generate structured data from a language model.',
href: '/docs/reference/ai-sdk-core/generate-object',
},
{
title: 'streamObject',
description: 'Stream structured data generation from a model.',
description: 'Stream structured data generation from a language model.',
href: '/docs/reference/ai-sdk-core/stream-object',
},
{
title: 'embed',
description:
'Generate an embedding for a single value using an embedding model.',
href: '/docs/reference/ai-sdk-core/embed',
},
]}
/>
Loading