File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
custom_components/ha_text_ai Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change 6
6
@github: https://github.com/smkrv/ha-text-ai
7
7
@source: https://github.com/smkrv/ha-text-ai
8
8
"""
9
+ import os
9
10
from typing import Final
10
11
import voluptuous as vol
11
12
from homeassistant .const import Platform , CONF_API_KEY , CONF_NAME
25
26
API_PROVIDER_ANTHROPIC
26
27
]
27
28
29
+ # Read version from manifest.json
30
+ MANIFEST_PATH = os .path .join (os .path .dirname (__file__ ), "manifest.json" )
31
+ try :
32
+ with open (MANIFEST_PATH ) as manifest_file :
33
+ manifest = json .load (manifest_file )
34
+ VERSION = manifest .get ("version" , "unknown" )
35
+ except Exception :
36
+ VERSION = "unknown"
37
+
28
38
# Default endpoints
29
39
DEFAULT_OPENAI_ENDPOINT : Final = "https://api.openai.com/v1"
30
40
DEFAULT_ANTHROPIC_ENDPOINT : Final = "https://api.anthropic.com"
You can’t perform that action at this time.
0 commit comments