翻篇收录说明
翻篇网页快照

AI Gateway now supports extraction models - Vercel

https://vercel.com/changelog/ai-gateway-now-supports-extraction-models

最近抓取:2026-12-05 15:35:22(北京时间)

最近内容变化:2026-11-30 02:32:09(北京时间)

这是最近一次有效抓取的文本快照,不含网页脚本、图片和动态交互内容。实际网页可能已更新。

访问原网页

页面简介

AI Gateway now supports extraction models: pull typed fields from text, images, and PDFs with confidence scores, starting with ScaleDown Extract-1.

正文摘录

Extraction models are now on AI Gateway. They find specific details in the content you provide, such as an invoice number or contact names, and return them as separate fields your code can use.ScaleDown Extract-1 is the first available extraction model. It extracts text values or lists of text values from text, images, and PDFs. You can use it to process invoices, contracts, and other records.Extraction is currently available through the AI SDK only. With ai@7.0.176 or later, use experimental_extract and the model ID scaledown/extract-1:import { experimental_extract as extract } from 'ai'; const result = await extract({ model: 'scaledown/extract-1', state: 'Invoice INV-2041 from Acme Corp. Contacts: Ana, Bo.', fields: { invoiceNumber: { type: 'text', instructions: 'The invoice number' }, contacts: { type: 'list', items: 'text', instructions: 'Contact names' }, },}); console.log(result.answers.invoiceNumber.value); // 'INV-2041'console.log(result.answers.contacts.value); // ['Ana', 'Bo']Extract an invoice number and contact names from text.Each key in fields has an entry in result.answers. If a field is not found, its value is null. Extract-1 returns confidence scores from 0 to 1 for matches, including individual list items, so you can flag uncertain results for review. For text input, it can also return character offsets showing where a match appears.To extract from a PDF or image, pass it as a file part in state:import { readFile } from 'node:fs/promises';import { experimental_extract as extract } from 'ai'; const result = await extract({ model: 'scaledown/extract-1', state: [ { type: 'file', data: await readFile('./invoice.pdf'), mediaType: 'application/pdf', }, ], fields: { vendor: { type: 'text', instructions: 'The company that issued the invoice' }, total: { type: 'text', instructions: 'The total amount due' }, lineItems: { type: 'list', items: 'text', instructions: 'The line items' }, },}); console.log(result.answers);Extract the vendor, total, and line items from a PDF.Extraction requests appear in AI Gateway logs and spend tracking. See the extraction quickstart for setup and authentication.