mirror of
https://github.com/smkrv/ha-text-ai.git
synced 2026-07-27 09:34:01 +08:00
Release v2.0.0
This commit is contained in:
@@ -1,35 +1,24 @@
|
|||||||
"""Data coordinator for HA text AI."""
|
"""Data coordinator for HA text AI."""
|
||||||
import asyncio
|
|
||||||
import logging
|
import logging
|
||||||
from datetime import timedelta, datetime
|
import asyncio
|
||||||
from typing import Any, Dict, Optional, List
|
from datetime import timedelta
|
||||||
import time
|
from typing import Any, Dict, Optional
|
||||||
import ssl
|
|
||||||
import uuid
|
|
||||||
import certifi
|
|
||||||
import aiohttp
|
|
||||||
import httpx
|
|
||||||
|
|
||||||
import voluptuous as vol
|
|
||||||
from homeassistant import config_entries
|
|
||||||
from homeassistant.helpers import aiohttp_client
|
|
||||||
from homeassistant.exceptions import HomeAssistantError
|
|
||||||
from openai import AsyncOpenAI, APIError, AuthenticationError, RateLimitError
|
|
||||||
from anthropic import AsyncAnthropic
|
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator
|
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator
|
||||||
from homeassistant.util import dt as dt_util
|
from homeassistant.exceptions import HomeAssistantError
|
||||||
import async_timeout
|
from openai import AsyncOpenAI, APIError, RateLimitError
|
||||||
|
from anthropic import AsyncAnthropic
|
||||||
|
|
||||||
from .const import (
|
from .const import (
|
||||||
DOMAIN,
|
DOMAIN,
|
||||||
DEFAULT_TIMEOUT,
|
|
||||||
QUEUE_MAX_SIZE,
|
QUEUE_MAX_SIZE,
|
||||||
|
DEFAULT_TIMEOUT,
|
||||||
MAX_RETRIES,
|
MAX_RETRIES,
|
||||||
RETRY_DELAY,
|
RETRY_DELAY,
|
||||||
)
|
)
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
class HATextAICoordinator(DataUpdateCoordinator):
|
class HATextAICoordinator(DataUpdateCoordinator):
|
||||||
"""Class to manage fetching data from the API."""
|
"""Class to manage fetching data from the API."""
|
||||||
|
|||||||
Reference in New Issue
Block a user