Skip to content

Commit

Permalink
Cleanup code and fix requirements versions
Browse files Browse the repository at this point in the history
  • Loading branch information
gritaro committed Feb 13, 2024
1 parent c434390 commit bf8ea46
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 20 deletions.
13 changes: 1 addition & 12 deletions custom_components/gigachain/__init__.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,16 @@
"""The GigaChain integration."""
from __future__ import annotations
from abc import abstractmethod
import re
from homeassistant.components import conversation
from homeassistant.components.conversation.const import HOME_ASSISTANT_AGENT
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import MATCH_ALL
from homeassistant.core import HomeAssistant
from homeassistant.helpers import (
config_validation as cv,
intent,
template,
)
from homeassistant.components.conversation import AgentManager, agent
from typing import Literal
from langchain.chat_models import GigaChat
from langchain.prompts.chat import (
AIMessagePromptTemplate,
ChatPromptTemplate,
HumanMessagePromptTemplate,
SystemMessagePromptTemplate,
)
from langchain_community.chat_models import GigaChat
from langchain.schema import AIMessage, HumanMessage, SystemMessage
from homeassistant.util import ulid
from .const import (
Expand All @@ -38,7 +28,6 @@
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Initialize GigaChain."""
client = GigaChat(credentials=entry.data[CONF_AUTH_DATA], verify_ssl_certs=False)
models = client.get_models()
hass.data.setdefault(DOMAIN, {})[entry.entry_id] = client
conversation.async_set_agent(hass, entry, GigaChatAI(hass, entry))
return True
Expand Down
12 changes: 4 additions & 8 deletions custom_components/gigachain/manifest.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
{
"domain": "gigachain",
"name": "GigaChain",
"codeowners": [
"@gritaro"
],
"codeowners": ["@gritaro"],
"config_flow": true,
"dependencies": [
"conversation"
],
"dependencies": ["conversation"],
"documentation": "https://github.com/gritaro/gigachain",
"homekit": {},
"integration_type": "service",
"iot_class": "cloud_polling",
"issue_tracker": "https://github.com/gritaro/gigachain/issues",
"requirements": [
"gigachain",
"yandexcloud"
"gigachain-community==0.0.16",
"yandexcloud==0.259.0"
],
"version": "0.1.0"
}

0 comments on commit bf8ea46

Please sign in to comment.