DEV Community

Cover image for introducing new Vercel AI SDK
Dom Sipowicz
Dom Sipowicz

Posted on

introducing new Vercel AI SDK

  • What is the new frontend AI library?
  • How to start new AI web app?

npm i ai


  • build your own custom AI Chat on your website fast
  • Streaming First UI Helpers
  • edge-ready software development kit for AI apps
  • built with React and Svelte.
'use client'

import { useChat } from 'ai/react'

export default function Chat() {
  const { messages, input, handleInputChange, handleSubmit } = useChat()

  return (
      {messages.length > 0
        ? => (
            <div key={}>
              {m.role === 'user' ? 'User: ' : 'AI: '}
        : null}

      <form onSubmit={handleSubmit}>
          placeholder="Say something..."
Enter fullscreen mode Exit fullscreen mode

SDK docs:

Vercel AI Playgroud:


PS. Follow me on Twitter or LinkedIn

Top comments (0)