package llm import "slices" // Capabilities declares what a model (or provider) supports and the limits // it imposes. Providers declare defaults; individual models may override. // The media pipeline normalizes image inputs against these values before a // request is serialized. // // Zero-value semantics: // - MaxImagesPerReq == 0 means image input is NOT supported. // - MaxImageBytes / MaxImageDimension / ContextWindow == 0 mean // "no declared limit", not zero. // - AllowedImageMIME empty means any MIME type is acceptable // (only meaningful when images are supported at all). type Capabilities struct { // MaxImageBytes is the largest single image payload, in bytes. MaxImageBytes int // MaxImageDimension is the largest allowed width or height, in pixels. MaxImageDimension int // AllowedImageMIME lists acceptable image content types // (e.g. "image/jpeg", "image/png"). AllowedImageMIME []string // MaxImagesPerReq is the most images one request may carry; 0 = images // unsupported. MaxImagesPerReq int SupportsTools bool SupportsStructured bool SupportsStreaming bool // ContextWindow is the model's context size in tokens, when known. ContextWindow int } // SupportsImages reports whether the target accepts image input. func (c Capabilities) SupportsImages() bool { return c.MaxImagesPerReq > 0 } // MIMEAllowed reports whether the given image MIME type is acceptable. func (c Capabilities) MIMEAllowed(mime string) bool { if len(c.AllowedImageMIME) == 0 { return true } return slices.Contains(c.AllowedImageMIME, mime) }