If/then actions depending on the answer from Gemini (Google Generative AI)

Hi

Is there a possibility, to do an action with a condition like this:

  • if the answer from Google Gemini is yes, then do the following action XY
  • if the answer from Google Gemini is no, do nothing

Thanks & Best Regards
Stefan

you must exploit the response of your prompt with response_variable which contains the response of your prompt

response_variable: response

action: system_log.write
metadata: {}
data:
level: error
message: log the {{ response.response_text }}
enabled: true

Thanks @Jcarlier . Can you (or someone else) make this a bit more specific or tell me how exactly I have to do this? I am still relatively new in HA and accordingly I do not know everything from HA.

Best Regards,
Stefan

Your question is a bit general.

to analyze the response of a question to an AI is done via a prompt.

you can obviously analyze his response.

an example that I use:

at any movement in front of a camera, I ask gemini to analyze the image (snapshot) via a prompt.

I’ll give you the YouTube URL:

https://www.youtube.com/watch?v=SOjaOq25hgg&t=298s&ab_channel=MichaelLeen