capabilities.work

AI Gateway Embed Then Summarize

A 2-step recipe with Vercel. We can help you get access.

Recipe · 2 steps

AI Gateway Embed Then Summarize

with Vercel

Embed a document, then summarize it with a chat completion.

  1. Create an embedding for the document text.
  2. Ask a chat model to summarize the same document text.
What you'll need to have ready
  • apiKey: Vercel AI Gateway API key (AI_GATEWAY_API_KEY) used as a Bearer token.
  • embeddingModel: Embedding model id (e.g. openai/text-embedding-3-small).
  • chatModel: Chat model id in 'provider/model-name' form.
  • document: The document text to embed and summarize.
For your developer

Arazzo workflow vercel:embedThenSummarize, 2 operations: createEmbedding → createChatCompletion. Specs on APIs.io.