08ac7c3da5
Expose ImageRecognitionRuntime.available() and gate the image-task pre-step injection on it, so the capability is dormant until an endpoint is configured instead of guiding the model to a call that can only fail. Co-Authored-By: Claude <noreply@anthropic.com>
@deepseek-ai/dsh-image-recognition
Service Definition for the image-recognition capability seam (ctx.imageRecognition):
a provider registry and provider-selecting execution, mirrored on the web seam.
- A provider registers via
ctx.imageRecognition.registerProvider(provider); a duplicateidthrowsIMAGE_RECOGNITION_DUPLICATE_PROVIDER. recognize(request, signal)resolves the provider at call time. Selection is order-independent: a configured id must be registered andavailable(); without a configured id, exactly one usable provider auto-selects. See theImageRecognitionErrorcodes for missing/unavailable/ambiguous providers.ImageInputis a closed union offile-path,base64, andurl; a provider encodes the kind it serves.
Config
provider pins which provider wins; $DSH_IMAGE_RECOGNITION_PROVIDER is the
environment equivalent (not a hidden priority chain).
Known Limitations and Deferred Work
- The seam is provider-neutral by design; image decoding/encoding lives in the provider, not here.
ImageRecognitionErrorcodes are open-string and provider-specific codes are tolerated by consumers.