mirror of
https://github.com/smkrv/ha-text-ai.git
synced 2026-07-29 03:53:55 +08:00
Release v2.0.0
This commit is contained in:
@@ -4,7 +4,7 @@ from __future__ import annotations
|
|||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
from typing import Any, Dict, Optional
|
from typing import Any, Dict, Optional
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ import voluptuous as vol
|
|||||||
from homeassistant import config_entries
|
from homeassistant import config_entries
|
||||||
from homeassistant.helpers import aiohttp_client
|
from homeassistant.helpers import aiohttp_client
|
||||||
from homeassistant.exceptions import HomeAssistantError
|
from homeassistant.exceptions import HomeAssistantError
|
||||||
from homeassistant.exceptions import HomeAssistantError, ConfigUpdateFailed
|
|
||||||
from openai import AsyncOpenAI, APIError, AuthenticationError, RateLimitError
|
from openai import AsyncOpenAI, APIError, AuthenticationError, RateLimitError
|
||||||
from anthropic import AsyncAnthropic
|
from anthropic import AsyncAnthropic
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
@@ -560,7 +559,7 @@ class HATextAICoordinator(DataUpdateCoordinator):
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
self._last_error = str(e)
|
self._last_error = str(e)
|
||||||
_LOGGER.error("Error updating data: %s", str(e))
|
_LOGGER.error("Error updating data: %s", str(e))
|
||||||
raise ConfigUpdateFailed(f"Error updating data: {str(e)}")
|
raise HomeAssistantError(f"Error updating data: {str(e)}")
|
||||||
|
|
||||||
async def __aenter__(self):
|
async def __aenter__(self):
|
||||||
"""Async enter."""
|
"""Async enter."""
|
||||||
|
|||||||
Reference in New Issue
Block a user