How to generate an image alt text using Umbraco AI Prompt by passing an image?

Hi, I am trying to use Umbraco AI Prompt to generate Alt text for images. I have created a new prompt in backoffice and given this instruction:

Write a concise alt text in under 50 characters for the following image:
{{umbracoFile}}
Return only the alt text, nothing else.

When I try to generate the alt text, I get this message:
‘I can see you’ve mentioned an image, but no image has actually been shared in our conversation. Could you please share the image you’d like me to write alt text for?’

Is it possible to generate alt text by passing the image?

Hey Debasish,

It certainly is possible, there is just a specific syntax that is necessary which is

{{ image:umbracoFile }}

The image: prefix tells us to embed the image into the request and send it to the LLM as binary data for it to process.

Hope that helps

1 Like

Thanks Matt! The {{ image:umbracoFile }} syntax worked perfectly.

One follow-up question — are all the available template variables (like {{image:umbracoFile}}) documented somewhere? It would be really helpful to know the full list and their syntax so I can make the most of the prompt templating

1 Like

There is some docs in the git repo here Umbraco.AI/docs/public/add-ons/prompt/template-syntax.md at dev · umbraco/Umbraco.AI · GitHub

But it’s on our sprint plan for the next sprint to move all the docs to https://docs.umbraco.com

1 Like

oh okay. This is helpful . Thanks Matt

1 Like

i needed this!! thanks matt :high-5-you-rock:

1 Like