Hi all
I’m trying to analyze a local image with ai_task.generate_data but I’m not able to do it
I have a jpg file in /config/www/llm/vialetto_snap.jpg and I would like to use it as source to be analyzed.
The automation is this
alias: ollama new telegram
description: ""
triggers:
- entity_id: input_boolean.attiva_llm
from: "off"
to: "on"
trigger: state
enabled: true
- trigger: event
event_type: folder_watcher
event_data:
file: /config/www/llm/vialetto_snap.jpg
enabled: false
conditions: []
actions:
- data:
entity_id: ai_task.ollama_ai_task_llava_7b
task_name: AI camera vialetto - media camera
instructions: >
Analizza la snapshot della telecamera e descrivi quello che vedi
concentrandoti su persona, animale, auto o moto.
Non descrivere l'ambiente, tipo l'asfalto, il muretto, le piante e così
via.
attachments:
media_content_id: "{{ media_local_uri }}"
media_content_type: image/jpeg
metadata:
title: Vialetto
thumbnail: "{{ media_local_uri }}"
media_class: image
response_variable: ai_response_a
action: ai_task.generate_data
- delay: "00:00:01"
- variables:
analysis_text: |-
{% if ai_response_a is defined and ai_response_a.data | default('') %}
{{ ai_response_a.data }}
{% elif ai_response_b is defined and ai_response_b.data | default('') %}
{{ ai_response_b.data }}
{% else %}
Nessuna analisi disponibile
{% endif %}
- data:
title: Vialetto - analisi
message: "{{ analysis_text }}"
action: persistent_notification.create
- data:
config_entry_id: XXXXXXXXXXX
file: "{{ snapshot_file }}"
caption: "{{ analysis_text }}"
parse_mode: plain_text
action: telegram_bot.send_photo
mode: single
variables:
filename: vialetto_snap.jpg
snapshot_file: /config/www/llm/{{ filename }}
media_local_uri: media-source://media_source/local/llm/{{ filename }}
The error I’m getting is
Error: Unknown source directory.
What am I doing wrong?
Thanks