Add OpenAI Decisions classification with image attachments
OpenAI now has a Decisions API (POST /v1/decisions). It answers the same predicate, choice, and score questions as TypeSafe and OpenRouter. This change makes OpenAI a classification provider. It also lets a classification evaluate images alongside the state.
Classification::of('Inspect the product in this photo.', [Image::fromPath($photo)])
->question('damaged', new Boolean('Does the product have visible damage?'))
->classify(provider: 'openai');
OpenAI only accepts inline base64 images, so remote images are downloaded and sent inline. The Decisions guide lists no image formats, so the JPEG, PNG, GIF, and WebP allow-list follows OpenAI's vision rules. The documented response has no usage, so token counts stay 0 until OpenAI sends it. Other attachment types, and attachments sent to TypeSafe or OpenRouter, throw before the request.
[!WARNING]
Upgrade note for UPGRADE.md: Experimental ClassificationProvider::classify() and ClassificationGateway::classify() gain a trailing array $attachments = []. Custom classification providers and gateways must add the parameter.