Summarizer API
import AI from '@aibrow/web'
const summarizer = await AI.AIBrow.Summarizer.create({
type: "tl;dr",
length: "short"
})
// Prompt the model and wait for the whole result to come back.
const result = await summarizer.summarize("An article comparing Vim vs Emacs as the best text editor")
// Prompt the model and stream the result:
const stream = await summarizer.summarizeStreaming("An article comparing Vim vs Emacs as the best text editor")
for await (const chunk of stream) {
console.log(chunk)
}Demos
Last updated