Skip to content

geraldinefiser/build-an-ai-app-starter-dec-24

 
 

Repository files navigation

Workshop: Building AI apps with the AI SDK and Next.js December 2024

This is a Next.js project bootstrapped with create-next-app.

Getting Started

First, to run files in terminal:

pnpm classification
pnpm extraction

Open http://localhost:3000 with your browser to see the result for the following routes:

/summarize
/extraction
/chat

This project uses next/font to automatically optimize and load Geist, a new font family for Vercel.

Tools used

  • AI SDK
  • OpenAi models
  • Zod library
  • AI/react hooks

Some key takeaways

Main ways to use ai:

  • await generateText({})
  • await generateObject({})
  • streamText({})
  • streamObject({})

Objects need a schema, that's where Zod came into play.

Zod descriptions (.describe()) are super usefull to tell the model how the answer should look like or what is the context that it might need to generate a better more specific answer.

Adding a system prompt allows for customizing the "voice" of the model answer.

About

Working through Nextjs AI Workshop (Dec 2024)

Topics

Resources

Stars

Watchers

Forks

Languages

  • TypeScript 94.6%
  • CSS 4.8%
  • JavaScript 0.6%