valentinfrlch / ha-llmvision

Let Home Assistant see!
Apache License 2.0
117 stars 4 forks source link

Error when trying execute Service Call Imaga Analysis #42

Closed 112-christian-112 closed 1 month ago

112-christian-112 commented 1 month ago

Hello, i get the following Error when trying execute the LLM Image Analyzer in Developer Tools

websocket_api script: Error executing script. Error for call_service at pos 1: None

Service Call: service: llmvision.image_analyzer data: provider: Google model: gpt-4o-mini include_filename: false target_width: 1280 detail: high max_tokens: 100 temperature: 0.5 message: What do you see in the picture? image_file: www/Klingel.jpg

HA Core Version: 2024.7.4 llm Vision: 1.0.1

Logs:

Logger: homeassistant.components.websocket_api.http.connection Quelle: components/websocket_api/commands.py:797 Integration: Home Assistant WebSocket API (Dokumentation, Probleme) Erstmals aufgetreten: 16:21:24 (1 Vorkommnisse) Zuletzt protokolliert: 16:21:24

[546817741952] None

Logger: homeassistant.helpers.script.websocket_api_script Quelle: helpers/script.py:2002 Erstmals aufgetreten: 16:21:24 (1 Vorkommnisse) Zuletzt protokolliert: 16:21:24

websocket_api script: Error executing script. Error for call_service at pos 1: None

valentinfrlch commented 1 month ago

What version are you on? Can you include the service call you used? Are there any logs that might be relevant?

112-christian-112 commented 1 month ago

What version are you on? Can you include the service call you used? Are there any logs that might be relevant?

I've just updated my first post with requested Information

valentinfrlch commented 1 month ago

There are two things wrong with this service call that I can see:

  1. Google doesn't serve "gpt-4o-mini". You can leave this parameter blank, it will then use the default model for your provider.
  2. I believe for image_file you actually mean /config/www/Klingel.jpg

This is still a valid bug report because the expected error message should mention that the file doesn't exist. I will check why that wasn't the case here.

Let me know if it works with the suggestions mentioned above.

112-christian-112 commented 1 month ago

There are two things wrong with this service call that I can see:

1. Google doesn't serve "gpt-4o-mini". You can leave this parameter blank, it will then use the default model for your provider.

2. I believe for image_file you actually mean `/config/www/Klingel.jpg`

This is still a valid bug report because the expected error message should mention that the file doesn't exist. I will check why that wasn't the case here.

Let me know if it works with the suggestions mentioned above.

Leaving the model parameter blank was the solution. The image path works in both variants (/config/www/Klingel.jpg and /www/Klingel.jpg

Thank you for your quick response.

valentinfrlch commented 1 month ago

You're welcome! I'll fix the confusing error message soon, thanks for letting me know.