From 976f4f16a3526b251b53d264a3b2208c22b684ac Mon Sep 17 00:00:00 2001 From: SMKRV Date: Tue, 19 Nov 2024 16:40:56 +0300 Subject: [PATCH] translation fixes --- custom_components/ha_text_ai/manifest.json | 2 +- .../ha_text_ai/translations/en.json | 237 ++++------------- .../ha_text_ai/translations/ru.json | 242 ++++-------------- hacs.json | 2 +- 4 files changed, 107 insertions(+), 376 deletions(-) diff --git a/custom_components/ha_text_ai/manifest.json b/custom_components/ha_text_ai/manifest.json index 4dd3841..33b2ebd 100644 --- a/custom_components/ha_text_ai/manifest.json +++ b/custom_components/ha_text_ai/manifest.json @@ -9,6 +9,6 @@ "issue_tracker": "https://github.com/smkrv/ha-text-ai/issues", "requirements": ["openai>=1.0.0"], "ssdp": [], - "version": "1.0.5", + "version": "1.0.7", "zeroconf": [] } diff --git a/custom_components/ha_text_ai/translations/en.json b/custom_components/ha_text_ai/translations/en.json index ba9c8fd..b64ace3 100644 --- a/custom_components/ha_text_ai/translations/en.json +++ b/custom_components/ha_text_ai/translations/en.json @@ -1,192 +1,61 @@ { - "config": { - "step": { - "user": { - "title": "Set up HA Text AI", - "description": "Configure your OpenAI integration for smart home interactions. You'll need an OpenAI API key from platform.openai.com to proceed.", - "data": { - "api_key": { - "name": "OpenAI API Key", - "description": "Your OpenAI API key from platform.openai.com. Keep this secure and never share it." - }, - "model": { - "name": "AI Model", - "description": "Select the AI model to use. GPT-3.5-Turbo is recommended for most uses as it offers the best balance of capabilities and cost." - }, - "temperature": { - "name": "Temperature", - "description": "Controls response creativity (0-2). Low values (0.1-0.3) for focused responses, high values (0.8-2.0) for creative ones." - }, - "max_tokens": { - "name": "Max Tokens", - "description": "Maximum length of responses. Higher values allow longer responses but consume more API tokens. Recommended: 512-1024." - }, - "api_endpoint": { - "name": "API Endpoint", - "description": "OpenAI API endpoint URL. Leave default unless using a custom endpoint or proxy." - }, - "request_interval": { - "name": "Request Interval", - "description": "Minimum time between API requests in seconds. Increase if experiencing rate limits." - } + "config": { + "option": { + "api_key": { + "name": "API Key", + "description": "Your OpenAI API key" + }, + "model": { + "name": "Model", + "description": "AI model to use for responses" + }, + "temperature": { + "name": "Temperature", + "description": "Temperature for response generation (0-2)" + }, + "max_tokens": { + "name": "Max Tokens", + "description": "Maximum tokens in response (1-4096)" + }, + "api_endpoint": { + "name": "API Endpoint", + "description": "API endpoint URL" + }, + "request_interval": { + "name": "Request Interval", + "description": "Minimum time between API requests (seconds)" + } } - } + }, + "options": { + "temperature": "Temperature", + "max_tokens": "Max Tokens", + "request_interval": "Request Interval" }, "error": { - "invalid_auth": "Invalid API key. Please check your OpenAI API key and try again.", - "cannot_connect": "Failed to connect to API. Please check your internet connection and API endpoint.", - "unknown": "Unexpected error occurred. Please check the logs for more details.", - "already_exists": "This API key is already configured in another integration.", - "invalid_model": "Selected model is not available. Please choose a different model.", - "rate_limit": "API rate limit exceeded. Please try again later or increase the request interval.", - "context_length": "Input too long for selected model. Try reducing max tokens or using a model with larger context.", - "api_error": "OpenAI API error. Please check the logs for details.", - "timeout": "API response timeout. Request took too long to complete.", - "queue_full": "Request queue is full. Please try again later." + "invalid_api_key": "Invalid API key", + "cannot_connect": "Cannot connect to the API", + "unknown_error": "Unknown error", + "invalid_model": "Invalid model", + "rate_limit_exceeded": "Rate limit exceeded", + "context_length_exceeded": "Context length exceeded", + "api_error": "API error", + "timeout_error": "Timeout error", + "queue_full": "Queue full", + "invalid_prompt": "Invalid prompt" }, - "abort": { - "already_configured": "This OpenAI integration is already configured", - "auth_failed": "Authentication failed. Please verify your API key.", - "invalid_endpoint": "Invalid API endpoint URL provided" - } - }, - "options": { - "step": { - "init": { - "title": "HA Text AI Options", - "description": "Adjust your OpenAI integration settings. Changes will apply to future requests only.", - "data": { - "temperature": { - "name": "Temperature", - "description": "Controls response creativity (0-2). Low values for focused responses, high for creative ones." - }, - "max_tokens": { - "name": "Max Tokens", - "description": "Maximum length of responses. Higher values allow longer responses but consume more API tokens." - }, - "request_interval": { - "name": "Request Interval", - "description": "Minimum time between API requests in seconds. Increase if experiencing rate limits." - } - } - } - } - }, - "entity": { - "sensor": { - "last_response": { - "name": "Last Response", - "state_attributes": { - "last_updated": { - "name": "Last Updated", - "description": "Timestamp of the last AI response" - }, - "question": { - "name": "Last Question", - "description": "Most recent question asked" - }, - "response": { - "name": "AI Response", - "description": "Latest response from the AI" - }, - "model": { - "name": "Current Model", - "description": "AI model currently in use" - }, - "temperature": { - "name": "Temperature Setting", - "description": "Current temperature parameter" - }, - "max_tokens": { - "name": "Max Tokens Setting", - "description": "Current maximum tokens limit" - }, - "total_responses": { - "name": "Total Responses", - "description": "Number of responses since last reset" - }, - "system_prompt": { - "name": "System Prompt", - "description": "Current system instructions for the AI" - }, - "response_time": { - "name": "Response Time", - "description": "Time taken to generate last response" - }, - "queue_size": { - "name": "Queue Size", - "description": "Current size of request queue" - }, - "api_status": { - "name": "API Status", - "description": "Current API connection status" - }, - "error_count": { - "name": "Error Count", - "description": "Number of errors since last reset" - }, - "last_error": { - "name": "Last Error", - "description": "Description of the last error encountered" - } - } - } - } - }, - "services": { - "ask_question": { - "name": "Ask Question", - "description": "Send a question to the AI model and receive a detailed response. The response will be stored in conversation history.", - "fields": { - "question": { - "name": "Question", - "description": "Your question or prompt for the AI. Be specific for better results." - }, - "model": { - "name": "Model", - "description": "AI model to use (optional, overrides default settings)." - }, - "temperature": { - "name": "Temperature", - "description": "Response creativity level (0-2, optional)." - }, - "max_tokens": { - "name": "Max Tokens", - "description": "Maximum response length (optional)." - } - } + "state": { + "ready": "Ready", + "processing": "Processing", + "error": "Error", + "disconnected": "Disconnected", + "rate_limited": "Rate limited", + "initializing": "Initializing" }, - "clear_history": { - "name": "Clear History", - "description": "Delete all stored conversation history. This action cannot be undone." - }, - "get_history": { - "name": "Get History", - "description": "Retrieve conversation history, including questions, responses, and timestamps.", - "fields": { - "limit": { - "name": "Limit", - "description": "Number of recent conversations to return (default 10)." - }, - "filter_model": { - "name": "Filter by Model", - "description": "Retrieve only conversations using a specific AI model." - } - } - }, - "set_system_prompt": { - "name": "Set System Prompt", - "description": "Configure AI behavior by setting a system prompt.", - "fields": { - "prompt": { - "name": "Prompt", - "description": "Instructions defining AI behavior and response style." - }, - "clear_prompt": { - "name": "Clear Prompt", - "description": "Remove current system prompt before setting new one." - } - } + "services": { + "ask_question": "Ask Question", + "clear_history": "Clear History", + "get_history": "Get History", + "set_system_prompt": "Set System Prompt" } - } } diff --git a/custom_components/ha_text_ai/translations/ru.json b/custom_components/ha_text_ai/translations/ru.json index 4f4c9dc..9876f2d 100644 --- a/custom_components/ha_text_ai/translations/ru.json +++ b/custom_components/ha_text_ai/translations/ru.json @@ -1,199 +1,61 @@ { - "config": { - "step": { - "user": { - "title": "Настройка HA Text AI", - "description": "Настройте интеграцию OpenAI для умного дома. Требуется API ключ OpenAI. Подробнее о получении ключа на platform.openai.com", - "data": { - "api_key": { - "name": "API ключ OpenAI", - "description": "Ваш API ключ с platform.openai.com. Храните его в безопасности." - }, - "model": { - "name": "AI Модель", - "description": "Выберите модель AI. GPT-3.5-Turbo рекомендуется для большинства задач как оптимальное сочетание возможностей и стоимости." - }, - "temperature": { - "name": "Температура", - "description": "Контролирует креативность ответов (0-2). Низкие значения (0.1-0.3) для точных ответов, высокие (0.8-2.0) для творческих." - }, - "max_tokens": { - "name": "Максимум токенов", - "description": "Максимальная длина ответов. Больше токенов = длиннее ответы, но выше расход API токенов. Рекомендуется: 512-1024." - }, - "api_endpoint": { - "name": "API Endpoint", - "description": "URL API OpenAI. Оставьте значение по умолчанию, если не используете собственный endpoint." - }, - "request_interval": { - "name": "Интервал запросов", - "description": "Минимальное время между API запросами в секундах. Увеличьте при превышении лимитов запросов." + "config": { + "option": { + "api_key": { + "name": "API ключ", + "description": "Ваш API ключ OpenAI" + }, + "model": { + "name": "Модель", + "description": "Модель AI для генерации ответов" + }, + "temperature": { + "name": "Температура", + "description": "Температура для генерации ответов (0-2)" + }, + "max_tokens": { + "name": "Максимальное количество токенов", + "description": "Максимальное количество токенов в ответе (1-4096)" + }, + "api_endpoint": { + "name": "Конечная точка API", + "description": "URL конечной точки API" + }, + "request_interval": { + "name": "Интервал запросов", + "description": "Минимальное время между запросами к API в секундах" } - } } - } + }, + "options": { + "temperature": "Температура", + "max_tokens": "Максимальное количество токенов", + "request_interval": "Интервал запросов" }, "error": { - "invalid_auth": "Неверный API ключ. Проверьте ключ OpenAI и попробуйте снова.", - "cannot_connect": "Не удалось подключиться к API. Проверьте подключение к интернету и endpoint.", - "unknown": "Неожиданная ошибка. Проверьте логи для подробностей.", - "already_exists": "Этот API ключ уже используется в другой интеграции.", - "invalid_model": "Выбранная модель недоступна. Выберите другую модель.", - "rate_limit": "Превышен лимит API запросов. Попробуйте позже или увеличьте интервал запросов.", - "context_length": "Входные данные слишком длинные для выбранной модели. Уменьшите max_tokens или используйте модель с большим контекстом.", - "api_error": "Ошибка API OpenAI. Проверьте логи для подробностей.", - "timeout": "Превышено время ожидания ответа от API.", - "queue_full": "Очередь запросов переполнена. Попробуйте позже.", - "invalid_url_format": "Неверный формат URL", - "invalid_input": "Неверные входные данные", - "invalid_temperature": "Температура должна быть от 0 до 2", - "invalid_max_tokens": "Максимальное количество токенов должно быть от 1 до 4096", - "invalid_request_interval": "Интервал запросов должен быть не менее 0.1 секунды", - "unknown": "Неизвестная ошибка" + "invalid_api_key": "Неверный API ключ", + "cannot_connect": "Не удается подключиться к API", + "unknown_error": "Неизвестная ошибка", + "invalid_model": "Неверная модель", + "rate_limit_exceeded": "Превышен лимит запросов", + "context_length_exceeded": "Превышена длина контекста", + "api_error": "Ошибка API", + "timeout_error": "Время ожидания истекло", + "queue_full": "Очередь полна", + "invalid_prompt": "Неверный запрос" }, - "abort": { - "already_configured": "Эта интеграция OpenAI уже настроена", - "auth_failed": "Ошибка аутентификации. Проверьте API ключ.", - "invalid_endpoint": "Указан неверный URL API endpoint" - } - }, - "options": { - "step": { - "init": { - "title": "Настройки HA Text AI", - "description": "Измените настройки интеграции OpenAI. Изменения применятся к будущим запросам.", - "data": { - "temperature": { - "name": "Температура", - "description": "Контролирует креативность ответов (0-2). Низкие значения для точных ответов, высокие для творческих." - }, - "max_tokens": { - "name": "Максимум токенов", - "description": "Максимальная длина ответов. Больше токенов = длиннее ответы, но выше расход API токенов." - }, - "request_interval": { - "name": "Интервал запросов", - "description": "Минимальное время между API запросами в секундах. Увеличьте при превышении лимитов." - } - } - } - } - }, - "entity": { - "sensor": { - "last_response": { - "name": "Последний ответ", - "state_attributes": { - "last_updated": { - "name": "Последнее обновление", - "description": "Время последнего ответа AI" - }, - "question": { - "name": "Последний вопрос", - "description": "Последний заданный вопрос" - }, - "response": { - "name": "Ответ AI", - "description": "Последний ответ от AI" - }, - "model": { - "name": "Текущая модель", - "description": "Используемая модель AI" - }, - "temperature": { - "name": "Настройка температуры", - "description": "Текущий параметр температуры" - }, - "max_tokens": { - "name": "Лимит токенов", - "description": "Текущий лимит максимальных токенов" - }, - "total_responses": { - "name": "Всего ответов", - "description": "Количество ответов с последнего сброса" - }, - "system_prompt": { - "name": "Системный промпт", - "description": "Текущие системные инструкции для AI" - }, - "response_time": { - "name": "Время ответа", - "description": "Время генерации последнего ответа" - }, - "queue_size": { - "name": "Размер очереди", - "description": "Текущий размер очереди запросов" - }, - "api_status": { - "name": "Статус API", - "description": "Текущий статус подключения к API" - }, - "error_count": { - "name": "Счётчик ошибок", - "description": "Количество ошибок с последнего сброса" - }, - "last_error": { - "name": "Последняя ошибка", - "description": "Описание последней возникшей ошибки" - } - } - } - } - }, - "services": { - "ask_question": { - "name": "Задать вопрос", - "description": "Отправить вопрос модели AI и получить подробный ответ. Ответ сохраняется в истории.", - "fields": { - "question": { - "name": "Вопрос", - "description": "Ваш вопрос или запрос для AI. Будьте конкретны для лучших результатов." - }, - "model": { - "name": "Модель", - "description": "Модель AI для использования (необязательно, переопределяет настройки по умолчанию)." - }, - "temperature": { - "name": "Температура", - "description": "Уровень креативности ответа (0-2, необязательно)." - }, - "max_tokens": { - "name": "Максимум токенов", - "description": "Максимальная длина ответа (необязательно)." - } - } + "state": { + "ready": "Готово", + "processing": "Обработка", + "error": "Ошибка", + "disconnected": "Отключено", + "rate_limited": "Ограниченный по скорости", + "initializing": "Инициализация" }, - "clear_history": { - "name": "Очистить историю", - "description": "Удалить всю историю разговоров. Это действие нельзя отменить." - }, - "get_history": { - "name": "Получить историю", - "description": "Получить историю разговоров, включая вопросы, ответы и временные метки.", - "fields": { - "limit": { - "name": "Лимит", - "description": "Количество последних разговоров для получения (по умолчанию 10)." - }, - "filter_model": { - "name": "Фильтр по модели", - "description": "Получить только разговоры с определённой моделью AI." - } - } - }, - "set_system_prompt": { - "name": "Установить системный промпт", - "description": "Настроить поведение AI, установив системный промпт.", - "fields": { - "prompt": { - "name": "Промпт", - "description": "Инструкции, определяющие поведение и стиль ответов AI." - }, - "clear_prompt": { - "name": "Очистить промпт", - "description": "Удалить текущий системный промпт перед установкой нового." - } - } + "services": { + "ask_question": "Задать вопрос", + "clear_history": "Очистить историю", + "get_history": "Получить историю", + "set_system_prompt": "Установить системный запрос" } - } } diff --git a/hacs.json b/hacs.json index 4a486f4..1f0251b 100644 --- a/hacs.json +++ b/hacs.json @@ -4,6 +4,6 @@ "domains": ["sensor"], "homeassistant": "2024.11.0", "icon": "mdi:brain", - "version": "1.0.5", + "version": "1.0.7", "documentation": "https://github.com/smkrv/ha-text-ai" }