I’m trying to pass a image file to Google AI.
I’m running homeassistant (non-supervised) in a docker container. The path to home assistant is /home/username/homeassistant. The image file is stored in /home/username/homeassistant/www/image.jpg
The relevant part from my configuration.yaml:
homeassistant:
allowlist_external_dirs:
- "/tmp"
- "www"
My automation yaml:
action: google_generative_ai_conversation.generate_content
metadata: {}
data:
prompt: >-
This is the latest weather radar animation for the monitored area. The
monitored area is Bemidji, MN. The AI should analyze precipitation
patterns, storm intensity, and movement. Dark greens, yellows, and reds
indicate stronger precipitation.
If storms are present, assess their movement and potential impact on the
area. When describing weather, use cautious language like "it is likely
raining" rather than making definitive statements unless radar data is
conclusive. Consider storm progression over time and estimate when
precipitation may begin or end based on timestamps in the radar animation.
Provide a clear, concise summary of current conditions based on the radar
and local weather sensor input.
filenames:
- www/inmasirmn_.gif
response_variable: radar_visual_analysis
If I run this it says:
Error generating content: 400 INVALID_ARGUMENT. {'error': {'code': 400, 'message': 'Request contains an invalid argument.', 'status': 'INVALID_ARGUMENT'}}
I’m sure it has to do with passing the file as, when I take the filenames out of the automation, it executes (I haven’t looked at the response variable to see what it says but I don’t expect it to make much sense).
I can see the file at https://my.url/local/image.jpg
I’m struggling with how to pass the image file to the AI. I also don’t quite understand how my www folder is mapped to “/local” when I look it up on a browser?
Thank you.