Vercel'in Yeni AI SDK'sı: Edge'de LLM Çalıştırmak
Teknoloji

Vercel'in Yeni AI SDK'sı: Edge'de LLM Çalıştırmak

Vercel AI SDK 4.0, sunucu tarafı LLM entegrasyonunu radikal biçimde basitleştiriyor. Bu yazıda gerçek bir chatbot projesi üzerinden SDK'yı inceliyoruz.

Kurulum

npm install ai @ai-sdk/openai

Streaming Text

import { streamText } from 'ai'
import { openai } from '@ai-sdk/openai'

const result = await streamText({
  model: openai('gpt-4o'),
  prompt: 'Merhaba, nasılsın?'
})