
![Code snippet using Jev 1.14.0 to decide whether a cat is shown in an image.
import { experimental_decide as decide } from 'ai'
import { readFileSync } from 'node:fs'
const { answers } = await decide({
model: 'typesafe-ai/jev-1.14.0',
state: [
{
type: 'file',
mediaType: 'image',
data: readFileSync('cat.jpg')
}
],
questions: {
cat: {
type: 'boolean',
instructions: 'Does the image show a cat?'
}
}
})
console.log(answers.cat.probability)](https://pbs.twimg.com/media/HU_DZdmakAElgfE.jpg?name=small&format=webp)
ALT Code snippet using Jev 1.14.0 to decide whether a cat is shown in an image. import { experimental_decide as decide } from 'ai' import { readFileSync } from 'node:fs' const { answers } = await decide({ model: 'typesafe-ai/jev-1.14.0', state: [ { type: 'file', mediaType: 'image', data: readFileSync('cat.jpg') } ], questions: { cat: { type: 'boolean', instructions: 'Does the image show a cat?' } } }) console.log(answers.cat.probability)

ALT Code snippet showcasing a text streaming function using Gemini 4 Argon to generate database guide content efficiently: import { streamText } from "ai" const result = streamText({ model:"google/gemini-4-argon", prompt: "Write a detailed guide to building a relational database from scratch", maxOutputTokens: 200_000 }) for await (const textPart of result.textStream) { process.stdout.write(textPart); }

ALT A code snippet shows an import statement for generating text using an AI model, detailing a prompt for creating a new holiday: import { generateText } from 'ai' const { text } = await generateText({ model: 'anthropic/claude-sonnet-5.5', prompt: 'Invent a new holiday and describe its traditions.' })

ALT Code snippet shows an import statement and a function call to generate text using the Claude Sonnet 5.5 model with a specified prompt: import { generateText } from 'ai'; const { text } = await generateText({ model: 'anthropic/claude-sonnet-5.5', prompt: 'Invent a new holiday and describe its traditions.', });
![Code snippet showcasing the import of libraries and functions for connecting to an MCP client and using an AI SDK with OAuth authentication:
import { createMCPClient } from '@ai-sdk/mcp';
import { connectAuthProvider } from '@vercel/connect/ai-sdk';
import { streamText } from 'ai';
const mcpClient = await createMCPClient({
transport: {
type: 'http',
url: 'https://mcp.linear.app',
authProvider: connectAuthProvider('oauth/linear', {
subject: { type: 'user', id: userId },
scopes: ['read'],
}),
},
});
const result = await streamText({
model: 'openai/gpt-5.6-sol',
tools: await mcpClient.tools(),
prompt,
});](https://pbs.twimg.com/media/HQlV-x7aIAAUIG0.jpg?name=small&format=webp)
ALT Code snippet showcasing the import of libraries and functions for connecting to an MCP client and using an AI SDK with OAuth authentication: import { createMCPClient } from '@ai-sdk/mcp'; import { connectAuthProvider } from '@vercel/connect/ai-sdk'; import { streamText } from 'ai'; const mcpClient = await createMCPClient({ transport: { type: 'http', url: 'https://mcp.linear.app', authProvider: connectAuthProvider('oauth/linear', { subject: { type: 'user', id: userId }, scopes: ['read'], }), }, }); const result = await streamText({ model: 'openai/gpt-5.6-sol', tools: await mcpClient.tools(), prompt, });





















