Skip to content

NappAI CMS Media

NappAI CMS Media works with the NappAI CMS media library: it lists the images (also only the ones without alt text), uploads images, SVGs or videos, reads a CMS image so a vision model can describe it, and saves the alt text proposals in the CMS.

The flow only proposes alt texts: the CMS never replaces the one a person wrote.

When to use it

  • In the flow the CMS launches to describe images, to read each image (Read Image Bytes) and save the descriptions (Save Alt Text Proposals).
  • To find the images that have no alt text (List Media with Only Without Alt Text).
  • To upload to the library an image generated or downloaded in the flow (Upload Media (Draft)).

Configuration

You need a NappAI-CMS credential with the address of your NappAI CMS (for example https://web.your-company.com) and a key that starts with ncms_. See Credentials.

A CMS administrator creates the key in Ajustes › IA › Conexión con NappAI › Claves NappAI-CMS, and the CMS shows it only once. It is a service key: it reads, prepares drafts and saves results, but never publishes. The address must start with https://; http:// is only accepted with localhost, in development.

FieldWhat it does
Credential (required)The NappAI-CMS credential. It fills in CMS Address and NappAI-CMS Key for you.
ResourceWhat you work with: Media, Images or Alt Text Proposals. Default: Media.
OperationWhat you do. The list changes with the chosen Resource. See Resources and operations.
Idempotency Key (advanced)Optional, for Save Alt Text Proposals. With the same key, sending again does not save twice. Empty: runId:alt-suggestions is used, so a retry never saves twice.

The CMS’s error messages come in Spanish and are shown as they arrive.

Resources and operations

Media

OperationWhat it doesFields
List MediaLists the media library, optionally only the images without alt text.Optional: Limit, Page, Sort, Filter (JSON), Only Without Alt Text and Depth.
Upload Media (Draft)Uploads an image, SVG or video from a public URL or base64.Public URL or Base64 Content. Optional: File Name, File Type and Alt Text.
  • Limit is how many media items to bring, 1 to 100. Empty: 10. Page is the results page (1 by default).
  • Sort is the field to sort by; with - in front, highest first, for example -createdAt.
  • Filter (JSON) is a Payload filter, for example {"mimeType": {"contains": "image"}}.
  • Only Without Alt Text brings only the media items with no alt text. It is combined with the filter if there is one.
  • Depth is the level of related items to resolve, 0 to 10. Empty: 0.
  • Public URL is the file’s public address and must start with http:// or https://. Base64 Content is the file in base64 (a data: prefix is accepted). Use one of the two.
  • File Name is its name in the library. File Type is the type, for example image/png, image/jpeg, image/webp or image/svg+xml; worked out if missing.
  • Alt Text describes the image. Leave it empty only if it is decorative.

Images

OperationWhat it doesFields
Read Image BytesReads a CMS image and returns it as base64 with its type.Image URL

Image URL is the media item’s url (for example /api/media/file/photo.png) or its full address on the same CMS. The read is public: the key is not sent. An address on another server is refused.

Alt Text Proposals

OperationWhat it doesFields
Save Alt Text ProposalsSaves the alt text proposals for images, after checking them against the CMS contract.Run ID or Chat Input, Proposals (JSON).
  • Run ID is the runId the CMS sends. Optional if you connect to Chat Input the flow’s input message, the JSON {"runId", "task", "contract"} the CMS sends.
  • Proposals (JSON) is the JSON {"suggestions": [{"mediaId", "altSuggestion", "skipped"}]} or just the list. altSuggestion is 1 to 300 characters; skipped is the reason when an image is not described.

If the data breaks the contract, the component names the field that fails and sends nothing.

Output

The Data output returns:

  • With List Media: one item per media item (id, filename, url, alt, mimeType…). With no results, {items: [], count: 0}.
  • With Upload Media (Draft): id, url and reused (the CMS reuses a file with the same name and size).
  • With Read Image Bytes: base64, mimeType, bytes and url.
  • With Save Alt Text Proposals: run, saved (what was saved) and duplicate (whether an earlier send with the same key had already saved it).

The component can be connected to an Agent as a tool. See Tools.

Example

The flow the CMS launches to describe the website’s images:

  1. The flow starts with Chat Input and NappAI CMS Run with Get Run Input, which returns the images to describe.
  2. Add NappAI CMS Media with Images and Read Image Bytes, with the image’s url in Image URL.
  3. Pass the image to a vision model and ask it for a short alt text.
  4. Save the descriptions with Save Alt Text Proposals and finish with NappAI CMS Run and Set Run Status set to done.

Good practices

  • Don’t try to overwrite alt texts: the flow only proposes and the CMS keeps what a person wrote.
  • Give Read Image Bytes the media item’s url the CMS returns, not addresses from other websites.

Security and limitations

  • Uploaded files stay as drafts and the CMS key never publishes.
  • Read Image Bytes only reads files of the credential’s CMS, doesn’t follow redirects and refuses files larger than 20 MB.