Skip to content

Commit

Permalink
Fix broken release 0.1.0
Browse files Browse the repository at this point in the history
- Fix requirements;
- Rename param auth_data to api_key;
  • Loading branch information
gritaro committed Feb 13, 2024
1 parent bf8ea46 commit 84f92b4
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 7 deletions.
4 changes: 2 additions & 2 deletions custom_components/gigachain/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from homeassistant.util import ulid
from .const import (
DOMAIN,
CONF_AUTH_DATA,
CONF_API_KEY,
CONF_CHAT_MODEL,
DEFAULT_CHAT_MODEL,
CONF_PROMPT,
Expand All @@ -27,7 +27,7 @@

async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Initialize GigaChain."""
client = GigaChat(credentials=entry.data[CONF_AUTH_DATA], verify_ssl_certs=False)
client = GigaChat(credentials=entry.data[CONF_API_KEY], verify_ssl_certs=False)
hass.data.setdefault(DOMAIN, {})[entry.entry_id] = client
conversation.async_set_agent(hass, entry, GigaChatAI(hass, entry))
return True
Expand Down
4 changes: 2 additions & 2 deletions custom_components/gigachain/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
TemplateSelector,
)
from .const import (
CONF_AUTH_DATA,
CONF_API_KEY,
CONF_CHAT_MODEL,
CONF_PROMPT,
DEFAULT_CHAT_MODEL,
Expand All @@ -25,7 +25,7 @@

STEP_USER_DATA_SCHEMA = vol.Schema(
{
vol.Required(CONF_AUTH_DATA): str
vol.Required(CONF_API_KEY): str
}
)

Expand Down
2 changes: 1 addition & 1 deletion custom_components/gigachain/const.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Constants for the GigaChain integration."""

DOMAIN = "gigachain"
CONF_AUTH_DATA = "auth_data"
CONF_API_KEY = "api_key"
CONF_PROMPT = "prompt"
DEFAULT_PROMPT = """Ты HAL 9000, компьютер из цикла произведений «Космическая одиссея» Артура Кларка, обладающий способностью к самообучению.
Мы находимся в умном доме под управлением системы Home Assistant.
Expand Down
2 changes: 2 additions & 0 deletions custom_components/gigachain/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
"iot_class": "cloud_polling",
"issue_tracker": "https://github.com/gritaro/gigachain/issues",
"requirements": [
"gigachat",
"langchain",
"gigachain-community==0.0.16",
"yandexcloud==0.259.0"
],
Expand Down
2 changes: 1 addition & 1 deletion custom_components/gigachain/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"user": {
"title": "GigaChain configuration",
"data": {
"auth_data": "Authorization data"
"api_key": "Authorization data"
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion custom_components/gigachain/translations/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"user": {
"title": "GigaChain конфигурация",
"data": {
"auth_data": "Авторизационные данные"
"api_key": "Авторизационные данные"
}
}
},
Expand Down

0 comments on commit 84f92b4

Please sign in to comment.