Skip to content

Instantly share code, notes, and snippets.

@gtumedei
gtumedei / image-description.ts
Last active October 16, 2025 09:47
AI SDK image description
import { openai } from "@ai-sdk/openai"
import { generateText } from "ai"
const model = openai("gpt-4.1-mini")
const systemPrompt = `
You are an AI model that analyzes images and produces a structured JSON array describing the visual elements in the image.
Your task:
1. Provide a concise overall description of the image.