Skip to content

Commit ef0aa62

Browse files
committed
Bump LLM Vision integration version.
1 parent 6311d09 commit ef0aa62

File tree

8 files changed

+2199
-1440
lines changed

8 files changed

+2199
-1440
lines changed

custom_components/llmvision/__init__.py

Lines changed: 212 additions & 144 deletions
Large diffs are not rendered by default.

custom_components/llmvision/calendar.py

Lines changed: 150 additions & 74 deletions
Large diffs are not rendered by default.

custom_components/llmvision/config_flow.py

Lines changed: 883 additions & 591 deletions
Large diffs are not rendered by default.
Lines changed: 55 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,71 @@
1-
""" Constants for llmvision component"""
1+
"""Constants for llmvision component"""
22

33
# Global constants
44
DOMAIN = "llmvision"
55

66
# CONFIGURABLE VARIABLES FOR SETUP
7-
CONF_PROVIDER = 'provider'
8-
CONF_API_KEY = 'api_key'
9-
CONF_IP_ADDRESS= 'ip_address'
10-
CONF_PORT = 'port'
11-
CONF_HTTPS = 'https'
12-
CONF_DEFAULT_MODEL = 'default_model'
13-
CONF_TEMPERATURE = 'temperature'
14-
CONF_TOP_P = 'top_p'
15-
CONF_CONTEXT_WINDOW = 'context_window' #(ollama: num_ctx)
16-
CONF_KEEP_ALIVE = 'keep_alive'
7+
CONF_PROVIDER = "provider"
8+
CONF_API_KEY = "api_key"
9+
CONF_IP_ADDRESS = "ip_address"
10+
CONF_PORT = "port"
11+
CONF_HTTPS = "https"
12+
CONF_DEFAULT_MODEL = "default_model"
13+
CONF_TEMPERATURE = "temperature"
14+
CONF_TOP_P = "top_p"
15+
CONF_CONTEXT_WINDOW = "context_window" # (ollama: num_ctx)
16+
CONF_KEEP_ALIVE = "keep_alive"
1717

1818
# Azure specific
19-
CONF_AZURE_BASE_URL = 'azure_base_url'
20-
CONF_AZURE_DEPLOYMENT = 'azure_deployment'
21-
CONF_AZURE_VERSION = 'azure_version'
19+
CONF_AZURE_BASE_URL = "azure_base_url"
20+
CONF_AZURE_DEPLOYMENT = "azure_deployment"
21+
CONF_AZURE_VERSION = "azure_version"
2222

2323
# AWS specific
24-
CONF_AWS_ACCESS_KEY_ID = 'aws_access_key_id'
25-
CONF_AWS_SECRET_ACCESS_KEY = 'aws_secret_access_key'
26-
CONF_AWS_REGION_NAME = 'aws_region_name'
24+
CONF_AWS_ACCESS_KEY_ID = "aws_access_key_id"
25+
CONF_AWS_SECRET_ACCESS_KEY = "aws_secret_access_key"
26+
CONF_AWS_REGION_NAME = "aws_region_name"
2727

2828
# Custom OpenAI specific
29-
CONF_CUSTOM_OPENAI_ENDPOINT = 'custom_openai_endpoint'
29+
CONF_CUSTOM_OPENAI_ENDPOINT = "custom_openai_endpoint"
3030

3131
# Timeline
32-
CONF_RETENTION_TIME = 'retention_time'
32+
CONF_RETENTION_TIME = "retention_time"
3333

3434
# Settings
35-
CONF_FALLBACK_PROVIDER = 'fallback_provider'
36-
CONF_TIMELINE_TODAY_SUMMARY = 'timeline_today_summary'
37-
CONF_TIMELINE_SUMMARY_PROMPT = 'timeline_summary_prompt'
38-
CONF_MEMORY_PATHS = 'memory_paths'
39-
CONG_MEMORY_IMAGES_ENCODED = 'memory_images_encoded'
40-
CONF_MEMORY_STRINGS = 'memory_strings'
41-
CONF_SYSTEM_PROMPT = 'system_prompt'
42-
CONF_TITLE_PROMPT = 'title_prompt'
43-
CONF_MEMORY_PATHS = 'memory_paths'
44-
CONF_MEMORY_IMAGES_ENCODED = 'memory_images_encoded'
45-
CONF_MEMORY_STRINGS = 'memory_strings'
35+
CONF_FALLBACK_PROVIDER = "fallback_provider"
36+
CONF_TIMELINE_TODAY_SUMMARY = "timeline_today_summary"
37+
CONF_TIMELINE_SUMMARY_PROMPT = "timeline_summary_prompt"
38+
CONF_MEMORY_PATHS = "memory_paths"
39+
CONG_MEMORY_IMAGES_ENCODED = "memory_images_encoded"
40+
CONF_MEMORY_STRINGS = "memory_strings"
41+
CONF_SYSTEM_PROMPT = "system_prompt"
42+
CONF_TITLE_PROMPT = "title_prompt"
43+
CONF_MEMORY_PATHS = "memory_paths"
44+
CONF_MEMORY_IMAGES_ENCODED = "memory_images_encoded"
45+
CONF_MEMORY_STRINGS = "memory_strings"
4646

4747

4848
# SERVICE CALL CONSTANTS
49-
MESSAGE = 'message'
50-
REMEMBER = 'remember'
51-
USE_MEMORY = 'use_memory'
52-
PROVIDER = 'provider'
53-
MAXTOKENS = 'max_tokens'
54-
TARGET_WIDTH = 'target_width'
55-
MODEL = 'model'
56-
IMAGE_FILE = 'image_file'
57-
IMAGE_ENTITY = 'image_entity'
58-
VIDEO_FILE = 'video_file'
59-
EVENT_ID = 'event_id'
60-
INTERVAL = 'interval'
61-
DURATION = 'duration'
62-
FRIGATE_RETRY_ATTEMPTS = 'frigate_retry_attempts'
63-
FRIGATE_RETRY_SECONDS = 'frigate_retry_seconds'
64-
MAX_FRAMES = 'max_frames'
65-
INCLUDE_FILENAME = 'include_filename'
66-
EXPOSE_IMAGES = 'expose_images'
67-
GENERATE_TITLE = 'generate_title'
68-
SENSOR_ENTITY = 'sensor_entity'
49+
MESSAGE = "message"
50+
REMEMBER = "remember"
51+
USE_MEMORY = "use_memory"
52+
PROVIDER = "provider"
53+
MAXTOKENS = "max_tokens"
54+
TARGET_WIDTH = "target_width"
55+
MODEL = "model"
56+
IMAGE_FILE = "image_file"
57+
IMAGE_ENTITY = "image_entity"
58+
VIDEO_FILE = "video_file"
59+
EVENT_ID = "event_id"
60+
INTERVAL = "interval"
61+
DURATION = "duration"
62+
FRIGATE_RETRY_ATTEMPTS = "frigate_retry_attempts"
63+
FRIGATE_RETRY_SECONDS = "frigate_retry_seconds"
64+
MAX_FRAMES = "max_frames"
65+
INCLUDE_FILENAME = "include_filename"
66+
EXPOSE_IMAGES = "expose_images"
67+
GENERATE_TITLE = "generate_title"
68+
SENSOR_ENTITY = "sensor_entity"
6969

7070
# Error messages
7171
ERROR_NOT_CONFIGURED = "{provider} is not configured"
@@ -74,8 +74,8 @@
7474
ERROR_HANDSHAKE_FAILED = "Connection could not be established"
7575

7676
# Versions
77-
# https://docs.anthropic.com/en/api/versioning
78-
VERSION_ANTHROPIC = "2023-06-01"
77+
VERSION_ANTHROPIC = "2023-06-01" # https://docs.anthropic.com/en/api/versioning
78+
VERSION_AZURE = "2025-04-01-preview" # https://learn.microsoft.com/en-us/azure/ai-foundry/openai/api-version-lifecycle?tabs=key
7979

8080
# Defaults
8181
DEFAULT_SYSTEM_PROMPT = "Your task is to analyze a series of images and provide a concise event description based on user instructions. Focus on identifying and describing the actions of people, pet and dynamic objects (e.g., vehicles) rather than static background details. When multiple images are provided, track and summarize movements or changes over time (e.g., 'A person walks to the front door' or 'A car pulls out of the driveway'). Keep responses brief objective, and aligned with the user's prompt. Avoid speculation and prioritize observable activity. The length of the summary must be less than 255 characters, so you must summarise it to the best readability within 255 chaaracters."
@@ -87,12 +87,13 @@
8787
DEFAULT_ANTHROPIC_MODEL = "claude-3-5-sonnet-latest"
8888
DEFAULT_AZURE_MODEL = "gpt-4o-mini"
8989
DEFAULT_GOOGLE_MODEL = "gemini-2.0-flash"
90-
DEFAULT_GROQ_MODEL = "llama-3.2-11b-vision-preview"
90+
DEFAULT_GROQ_MODEL = "meta-llama/llama-4-scout-17b-16e-instruct"
9191
DEFAULT_LOCALAI_MODEL = "llava"
9292
DEFAULT_OLLAMA_MODEL = "gemma3:4b"
9393
DEFAULT_CUSTOM_OPENAI_MODEL = "gpt-4o-mini"
9494
DEFAULT_AWS_MODEL = "us.amazon.nova-pro-v1:0"
9595
DEFAULT_OPENWEBUI_MODEL = "gemma3:4b"
96+
DEFAULT_OPENROUTER_MODEL = "openai/gpt-4o-mini"
9697

9798
DEFAULT_SUMMARY_PROMPT = "Provide a brief summary for the following titles. Focus on the key actions or changes that occurred over time and avoid unnecessary details or subjective interpretations. The summary should be concise, objective, and relevant to the content of the images. Keep the summary under 50 words and ensure it captures the main events or activities described in the descriptions. Here are the descriptions:\n "
9899

@@ -105,3 +106,4 @@
105106
ENDPOINT_OLLAMA = "{protocol}://{ip_address}:{port}/api/chat"
106107
ENDPOINT_OPENWEBUI = "{protocol}://{ip_address}:{port}/api/chat/completions"
107108
ENDPOINT_AZURE = "{base_url}openai/deployments/{deployment}/chat/completions?api-version={api_version}"
109+
ENDPOINT_OPENROUTER = "https://openrouter.ai/api/v1/chat/completions"

0 commit comments

Comments
 (0)