Skip to content

Commit

Permalink
rc-0.1.8 remove anyscale
Browse files Browse the repository at this point in the history
remove anyscale support
  • Loading branch information
gritaro committed Jan 12, 2025
1 parent d0ee322 commit 0de97e1
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 13 deletions.
6 changes: 3 additions & 3 deletions README-ru.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* [GigaChat](#GigaChat) (<a href="https://developers.sber.ru/docs/ru/gigachat/overview">русскоязычная (но не только) нейросеть от Сбера</a>)
* [YandexGPT](#YandexGPT)
* [OpenAI](#OpenAI) ака ChatGPT (не тестируется)
* [Anyscale](#Anyscale)
* [~~Anyscale~~](#Anyscale)

## Установка
Устанавливается как и любая HACS интеграция.
Expand Down Expand Up @@ -71,8 +71,8 @@
### OpenAI
Для генерации ключа проследуйте по ссылке https://platform.openai.com/account/api-keys

### Anyscale
[Зарегистрируйтесь](https://app.endpoints.anyscale.com/welcome) и создайте API ключ [здесь](https://app.endpoints.anyscale.com/credentials)
### ~~Anyscale~~
[~~Зарегистрируйтесь~~](https://app.endpoints.anyscale.com/welcome) ~~и создайте API ключ~~ [~~здесь~~](https://app.endpoints.anyscale.com/credentials) На данный момент не поддерживается.

## Конфигурация

Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Currently supported LMMs:
* [GigaChat](#GigaChat) (<a href="https://developers.sber.ru/docs/ru/gigachat/overview">Sber LLM</a>)
* [YandexGPT](#YandexGPT)
* [OpenAI](#OpenAI) aka ChatGPT (not tested)
* [Anyscale](#Anyscale)
* [~~Anyscale~~](#Anyscale)

## Installation
Install it like any other HACS integration.
Expand Down Expand Up @@ -66,8 +66,9 @@ You can find Folder ID using this <a href="https://console.cloud.yandex.com/fold
### OpenAI
Create API key here https://platform.openai.com/account/api-keys

### Anyscale
[Register account](https://app.endpoints.anyscale.com/welcome) and create API key [here](https://app.endpoints.anyscale.com/credentials)
### ~~Anyscale~~
[~~Register account~~](https://app.endpoints.anyscale.com/welcome) ~~and create API key~~ [~~here~~](https://app.endpoints.anyscale.com/credentials)
Not supported anymore.

## Configuration

Expand Down
18 changes: 17 additions & 1 deletion custom_components/gigachain/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
ID_GIGACHAT, ID_OPENAI, ID_YANDEX_GPT, UNIQUE_ID,
CONF_PROCESS_BUILTIN_SENTENCES, DEFAULT_PROCESS_BUILTIN_SENTENCES,
CONF_CHAT_HISTORY, DEFAULT_CHAT_HISTORY,
UNIQUE_ID_GIGACHAT, ID_ANYSCALE)
UNIQUE_ID_GIGACHAT, UNIQUE_ID_ANYSCALE, ID_ANYSCALE)

LOGGER = logging.getLogger(__name__)

Expand Down Expand Up @@ -164,6 +164,11 @@ async def async_step_init(
unique_id, self.config_entry.options
)
if user_input is not None:
errors["base"] = "unsupported"
if unique_id == UNIQUE_ID_ANYSCALE:
return self.async_show_form(
step_id="init", data_schema=schema, errors=errors
)
model = user_input.get(CONF_CHAT_MODEL_USER)
if model == " " or model == "" or model is None:
model = user_input.get(CONF_CHAT_MODEL)
Expand Down Expand Up @@ -244,4 +249,15 @@ def common_config_option_schema(
default=DEFAULT_PROFANITY): bool
}
)
if unique_id == UNIQUE_ID_ANYSCALE:
schema = vol.Schema({
vol.Optional(
CONF_CHAT_MODEL,
description={
"suggested_value": "Not supported anymore, please remove this entry",
"type": "readonly",
},
default="Not supported anymore",
): str,
})
return schema
4 changes: 2 additions & 2 deletions custom_components/gigachain/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
selector.SelectOptionDict(value=ID_GIGACHAT, label=UNIQUE_ID_GIGACHAT),
selector.SelectOptionDict(value=ID_YANDEX_GPT, label=UNIQUE_ID_YANDEX_GPT),
selector.SelectOptionDict(value=ID_OPENAI, label=UNIQUE_ID_OPENAI),
selector.SelectOptionDict(value=ID_ANYSCALE, label=UNIQUE_ID_ANYSCALE),
]
MODELS_GIGACHAT = [
" ",
Expand All @@ -71,6 +70,7 @@
]
DEFAULT_MODELS_YANDEX_GPT = [" ", "YandexGPT", "YandexGPT Lite", "Summary"]
MODELS_ANYSCALE = [" ",
"meta-llama/Meta-Llama-3-8B-Instruct",
"codellama/CodeLlama-34b-Instruct-hf",
"Open-Orca/Mistral-7B-OpenOrca",
"mistralai/Mixtral-8x7B-Instruct-v0.1",
Expand Down Expand Up @@ -115,7 +115,7 @@
ID_GIGACHAT: None,
ID_OPENAI: "gpt-3.5-turbo",
ID_YANDEX_GPT: None,
ID_ANYSCALE: "meta-llama/Llama-2-7b-chat-hf"
ID_ANYSCALE: "meta-llama/Meta-Llama-3-8B-Instruct"
}

CONF_API_KEY = "api_key"
Expand Down
2 changes: 1 addition & 1 deletion custom_components/gigachain/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"home-assistant-intents",
"gigachain @ git+https://github.com/gritaro/gigachain-fork@dev#subdirectory=libs/langchain",
"gigachain-community @ git+https://github.com/gritaro/gigachain-fork@dev#subdirectory=libs/community",
"yandexcloud==0.260.0"
"yandexcloud==0.295.0"
],
"version": "0.1.8"
}
3 changes: 2 additions & 1 deletion custom_components/gigachain/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@
},
"options": {
"error": {
"model_required": "Either Model or Custom Model required"
"model_required": "Either Model or Custom Model required",
"unsupported": "Unsupported integration entry"
},
"step": {
"init": {
Expand Down
3 changes: 2 additions & 1 deletion custom_components/gigachain/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@
},
"options": {
"error": {
"model_required": "Either Model or Custom Model required"
"model_required": "Either Model or Custom Model required",
"unsupported": "Unsupported integration entry"
},
"step": {
"init": {
Expand Down
3 changes: 2 additions & 1 deletion custom_components/gigachain/translations/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@
},
"options": {
"error": {
"model_required": "Выберите модель из списка либо задайте свою"
"model_required": "Выберите модель из списка либо задайте свою",
"unsupported": "Интеграция больше не поддерживается"
},
"step": {
"init": {
Expand Down

0 comments on commit 0de97e1

Please sign in to comment.