Array Output Mode - AI SDK

R
Renaudil y a 2 jours
0

Description

Learn the difference between array and object output modes with streamObject from the AI SDK.

npx boilerapp array-output-mode

文档

Structured Object Generation Array Mode

Deploy with Vercel

This is a Next.js project that uses the the streamObject function from the Vercel AI SDK to stream structured objects. This project showcases the new output mode which allows you to stream structured objects by complete object rather than by token. This solves layout shift issues common to AI applications using structured object generation.

Getting Started

First, clone the repository:

git clone https://github.com/vercel-labs/structured-object-generation-array-mode.git

Then, install the dependencies:

pnpm install

Copy the .env.exampmle file to .env.local and fill in the required environment variables:

OPENAI_API_KEY=sk-...

Finally, run the development server:

pnpm dev

Open http://localhost:3000 with your browser to see the result.

Learn More

To learn more about Next.js, take a look at the following resources:

Deploy on Vercel

The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.

Check out our Next.js deployment documentation for more details.

Prix

Gratuit

FREE

评论 (0)

常见问题

常见问题解答 (FAQ)

有问题?我们有答案。如果您找不到想要的答案,请随时联系我们。

Boilerapp 是一个专门用于分享 Boilerplates、入门套件(Starter Kits)和项目模版的开发者社区平台。我们的目标很简单:为您节省初始配置(Setup)的时间,让您可以专注于真正重要的代码。无论您是在寻找简单的代码库还是完整的 SaaS 项目,都能在这里找到。

还有其他问题?

我们的团队随时为您提供帮助。联系我们,我们将尽快回复。

Array Output Mode - AI SDK | BoilerApp