assistant.bones.image

Classes

ImageBoneRelSkel

RelSkel designed to use as using skeleton in a ImageBone.

ImageBone

A specialized FileBone for image files.

Module Contents

class assistant.bones.image.ImageBoneRelSkel

Bases: viur.core.skeleton.RelSkel

RelSkel designed to use as using skeleton in a ImageBone.

alt
class assistant.bones.image.ImageBone(*, using=ImageBoneRelSkel, validMimeTypes=('image/*',), enable_describe_image=True, **kwargs)

Bases: viur.core.bones.FileBone

A specialized FileBone for image files.

This bone type extends FileBone by:

  • Restricting accepted MIME types to images (by default).

  • Has a using skel with an alt StringBone.

  • Optionally enabling the Describe Image bone action, which allows AI to generate an alt-text or caption for the uploaded image via an admin-triggerable action.

Initialize an ImageBone, a file-based bone specialized for handling image uploads.

Optionally adds a bone action that allows AI-based image description (alt-text generation) to be triggered from within the admin interface.

Parameters:
  • using (Type[viur.core.skeleton.RelSkel]) – The relational skeleton class used for additional data of this image. Defaults to ImageBoneRelSkel, including the alt StringBone.

  • validMimeTypes (None | Iterable[str]) – A list of accepted MIME types. Defaults to only allow image types (("image/*",)).

  • enable_describe_image (bool) – If True, the bone will include the DESCRIBE_IMAGE bone action, allowing AI-assisted image description via the vi-admin UI.

  • kwargs – Additional keyword arguments passed to the base FileBone.

type