Documentation
¶
Overview ¶
Package main demonstrates sending media to a vision model by durable storage reference with the PromptKit SDK.
Instead of inlining image bytes on every request, the caller stores the image once in a MediaStorageService and passes a durable reference. At model-call time the provider resolves that reference to a model-fetchable URL (or bytes) via the store. With a cloud store the model fetches the presigned URL directly, so no image bytes need to transit the app.
This example shows:
- Creating a local disk-backed MediaStorageService
- Storing an image once and getting back a durable reference
- Wiring the store into the conversation with WithMediaStorage
- Sending the image by reference with WithImageStorageRef
Run with:
export OPENAI_API_KEY=your-key go run .
Alternatively set GEMINI_API_KEY or ANTHROPIC_API_KEY and the SDK will select the matching vision-capable provider from the environment.
Click to show internal directories.
Click to hide internal directories.