Closed darkneo29 closed 3 months ago
What did you use as model? You can leave the parameter blank to use the default model for the selected provider. There is a known bug right now that will throw this error instead of properly stating that the model doesn't exist.
Let me know if that works.
Hey, I am using gemini-1.5-flash and Pro and error on both but when I try via image with an image it works with this models.. I tried blank as well and no luck same error
Can you please provide the service call so I can reproduce the error? This works for me:
service: llmvision.image_analyzer
data:
provider: Google
include_filename: true
target_width: 1280
max_tokens: 100
temperature: 0.5
message: Describe the image
image_entity:
- camera.entity
detail: high
service: llmvision.video_analyzer data: provider: Google model: gemini-1.5-flash interval: 3 target_width: 1280 detail: high max_tokens: 300 temperature: 0.5 video_file: /config/www/snapshots/vidgarage.mp4 message: >- Review this video Clip. You are a security guard reviewing the garage camera video, your job is to keep the home safe and let us know if any suspicious activity is detected. Keep your response short and too the point. At the end of your response type either threat=detected or threat=safe include_filename: true response_variable: response
The image works fine. It's the new video part that doesn't work when I select Google. When I select OpenAI, there are no issues. When I use the image function, everything works for Google as well.
I cannot reproduce the error. This works:
service: llmvision.video_analyzer
data:
provider: Google
model: gemini-1.5-flash
interval: 5
target_width: 1280
detail: high
max_tokens: 300
temperature: 0.5
video_file: /config/www/tmp/test.mp4
message: >-
Review this video Clip. You are a security guard reviewing the garage camera
video, your job is to keep the home safe and let us know if any suspicious
activity is detected. Keep your response short and too the point. At the end
of your response type either threat=detected or threat=safe
include_filename: true
response:
response_text: >
The man in the video appears to be a resident of the home. He is carrying
groceries and appears to be entering the home.
threat=safe
The only way I get the None
error is, if I leave the model parameter blank which Home Assistant then automatically sets to null
. These won't work:
...
model: null
model:
...
Either set the parameter to an existing model or leave the parameter out.
If the issue persists I need more logs as otherwise there is no way for me to understand what's going on.
You can enable debug logging by adding this to your configuration.yaml
:
logger:
logs:
custom_components.llmvision: debug
Here we go
2024-08-01 04:23:33.536 WARNING (MainThread) [homeassistant.helpers.frame] Detected that custom integration 'hacs' accesses hass.helpers.event. This is deprecated and will stop working in Home Assistant 2024.11, it should be updated to import functions used from event directly at custom_components/hacs/base.py, line 630: self.hass.helpers.event.async_track_time_interval(, please create a bug report at https://github.com/hacs/integration/issues
2024-08-01 04:23:36.846 ERROR (MainThread) [homeassistant.components.google_assistant.http] Request for https://homegraph.googleapis.com/v1/devices:requestSync failed: 500
2024-08-01 04:24:12.098 DEBUG (MainThread) [custom_components.llmvision.media_handlers] Processing videos: ['/config/www/snapshots/vidlivingroom.mp4']
2024-08-01 04:24:12.099 DEBUG (MainThread) [custom_components.llmvision.media_handlers] Created config/custom_components/llmvision/tmp_frames
2024-08-01 04:24:14.047 DEBUG (MainThread) [custom_components.llmvision.media_handlers] Adding frame frame0013.png
2024-08-01 04:24:14.330 DEBUG (MainThread) [custom_components.llmvision.media_handlers] Adding frame frame0006.png
2024-08-01 04:24:14.681 DEBUG (MainThread) [custom_components.llmvision.media_handlers] Adding frame frame0008.png
2024-08-01 04:24:15.044 DEBUG (MainThread) [custom_components.llmvision.media_handlers] Adding frame frame0007.png
2024-08-01 04:24:15.432 DEBUG (MainThread) [custom_components.llmvision.media_handlers] Adding frame frame0011.png
2024-08-01 04:24:15.760 DEBUG (MainThread) [custom_components.llmvision.media_handlers] Adding frame frame0009.png
2024-08-01 04:24:16.098 DEBUG (MainThread) [custom_components.llmvision.media_handlers] Adding frame frame0002.png
2024-08-01 04:24:16.438 DEBUG (MainThread) [custom_components.llmvision.media_handlers] Adding frame frame0010.png
2024-08-01 04:24:16.779 DEBUG (MainThread) [custom_components.llmvision.media_handlers] Adding frame frame0014.png
2024-08-01 04:24:17.069 DEBUG (MainThread) [custom_components.llmvision.media_handlers] Adding frame frame0004.png
2024-08-01 04:24:17.407 DEBUG (MainThread) [custom_components.llmvision.media_handlers] Adding frame frame0012.png
2024-08-01 04:24:17.690 DEBUG (MainThread) [custom_components.llmvision.media_handlers] Adding frame frame0005.png
2024-08-01 04:24:18.014 DEBUG (MainThread) [custom_components.llmvision.media_handlers] Adding frame frame0001.png
2024-08-01 04:24:18.341 DEBUG (MainThread) [custom_components.llmvision.media_handlers] Adding frame frame0003.png
2024-08-01 04:24:18.674 DEBUG (MainThread) [custom_components.llmvision.request_handlers] Base64 Images: ['
Thanks for enabling debugging. Can you try with a higher interval
so that less images are sent?
You said image_analyzer
works and since video_analyzer
and image_analyzer
share the code for requests I suspect Google might have a limit of how many images can be processed in one request.
Tried at 10 and 15 and same error
2024-08-01 04:23:33.536 WARNING (MainThread) [homeassistant.helpers.frame] Detected that custom integration 'hacs' accesses hass.helpers.event. This is deprecated and will stop working in Home Assistant 2024.11, it should be updated to import functions used from event directly at custom_components/hacs/base.py, line 630: self.hass.helpers.event.async_track_time_interval(, please create a bug report at https://github.com/hacs/integration/issues
2024-08-01 04:23:36.846 ERROR (MainThread) [homeassistant.components.google_assistant.http] Request for https://homegraph.googleapis.com/v1/devices:requestSync failed: 500
2024-08-01 04:24:12.098 DEBUG (MainThread) [custom_components.llmvision.media_handlers] Processing videos: ['/config/www/snapshots/vidlivingroom.mp4']
2024-08-01 04:24:12.099 DEBUG (MainThread) [custom_components.llmvision.media_handlers] Created config/custom_components/llmvision/tmp_frames
2024-08-01 04:24:14.047 DEBUG (MainThread) [custom_components.llmvision.media_handlers] Adding frame frame0013.png
2024-08-01 04:24:14.330 DEBUG (MainThread) [custom_components.llmvision.media_handlers] Adding frame frame0006.png
2024-08-01 04:24:14.681 DEBUG (MainThread) [custom_components.llmvision.media_handlers] Adding frame frame0008.png
2024-08-01 04:24:15.044 DEBUG (MainThread) [custom_components.llmvision.media_handlers] Adding frame frame0007.png
2024-08-01 04:24:15.432 DEBUG (MainThread) [custom_components.llmvision.media_handlers] Adding frame frame0011.png
2024-08-01 04:24:15.760 DEBUG (MainThread) [custom_components.llmvision.media_handlers] Adding frame frame0009.png
2024-08-01 04:24:16.098 DEBUG (MainThread) [custom_components.llmvision.media_handlers] Adding frame frame0002.png
2024-08-01 04:24:16.438 DEBUG (MainThread) [custom_components.llmvision.media_handlers] Adding frame frame0010.png
2024-08-01 04:24:16.779 DEBUG (MainThread) [custom_components.llmvision.media_handlers] Adding frame frame0014.png
2024-08-01 04:24:17.069 DEBUG (MainThread) [custom_components.llmvision.media_handlers] Adding frame frame0004.png
2024-08-01 04:24:17.407 DEBUG (MainThread) [custom_components.llmvision.media_handlers] Adding frame frame0012.png
2024-08-01 04:24:17.690 DEBUG (MainThread) [custom_components.llmvision.media_handlers] Adding frame frame0005.png
2024-08-01 04:24:18.014 DEBUG (MainThread) [custom_components.llmvision.media_handlers] Adding frame frame0001.png
2024-08-01 04:24:18.341 DEBUG (MainThread) [custom_components.llmvision.media_handlers] Adding frame frame0003.png
2024-08-01 04:24:18.674 DEBUG (MainThread) [custom_components.llmvision.request_handlers] Base64 Images: ['
here is a link to the video file...maybe something is going on there?? https://drive.google.com/file/d/1pEr3A1B0JS5xpNYshiE-FSCKzeV9nL8O/view?usp=drive_link
According to the logs it is still adding more than 10 images.
Try an interval of 60. If that doesn't help, downscale the images using the target_width
parameter.
Downscale to 1080 worked! Moving interval up or down doesn't seem to impact anything but this will do the job. Thank you. You have a buy me a coffee link??
Glad to hear it works! I’ll try to add an error message for when the input token limit is exceeded.
I don’t but you’re most welcome!
Describe the bug When calling the service LLM Vision: Video Analyzer and using Google as the provider I get this error Failed to call service llmvision.video_analyzer. None. When I use OPENAI it works
Version 1.0.1
Logs