mirror of
https://github.com/smkrv/ha-text-ai.git
synced 2026-07-28 01:54:00 +08:00
Release v2.0.0
This commit is contained in:
@@ -15,7 +15,7 @@ import async_timeout
|
|||||||
from .const import (
|
from .const import (
|
||||||
DOMAIN,
|
DOMAIN,
|
||||||
DEFAULT_TIMEOUT,
|
DEFAULT_TIMEOUT,
|
||||||
MAX_QUEUE_SIZE,
|
QUEUE_MAX_SIZE,
|
||||||
MAX_RETRIES,
|
MAX_RETRIES,
|
||||||
RETRY_DELAY,
|
RETRY_DELAY,
|
||||||
SUPPORTED_MODELS,
|
SUPPORTED_MODELS,
|
||||||
@@ -65,7 +65,7 @@ class HATextAICoordinator(DataUpdateCoordinator):
|
|||||||
self.model = model
|
self.model = model
|
||||||
self.temperature = float(temperature)
|
self.temperature = float(temperature)
|
||||||
self.max_tokens = int(max_tokens)
|
self.max_tokens = int(max_tokens)
|
||||||
self._question_queue = asyncio.PriorityQueue(maxsize=MAX_QUEUE_SIZE)
|
self._question_queue = asyncio.PriorityQueue(maxsize=QUEUE_MAX_SIZE)
|
||||||
self._responses: Dict[str, Any] = {}
|
self._responses: Dict[str, Any] = {}
|
||||||
self.system_prompt: Optional[str] = None
|
self.system_prompt: Optional[str] = None
|
||||||
self._is_ready = False
|
self._is_ready = False
|
||||||
@@ -600,7 +600,7 @@ class HATextAICoordinator(DataUpdateCoordinator):
|
|||||||
return
|
return
|
||||||
|
|
||||||
seen_questions = set()
|
seen_questions = set()
|
||||||
optimized_queue = asyncio.PriorityQueue(maxsize=MAX_QUEUE_SIZE)
|
optimized_queue = asyncio.PriorityQueue(maxsize=QUEUE_MAX_SIZE)
|
||||||
|
|
||||||
while not self._question_queue.empty():
|
while not self._question_queue.empty():
|
||||||
try:
|
try:
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user