* Add AI Task integration * Remove GenTextTaskType * Add AI Task prefs * Add action to LLM task * Remove WS command * Rename result to text for GenTextTaskResult * Apply suggestions from code review Co-authored-by: Allen Porter <allen.porter@gmail.com> * Add supported feature for generate text * Update const.py Co-authored-by: HarvsG <11440490+HarvsG@users.noreply.github.com> * Update homeassistant/components/ai_task/services.yaml Co-authored-by: HarvsG <11440490+HarvsG@users.noreply.github.com> * Use WS API to set preferences * Simplify pref storage * Simplify pref test * Update homeassistant/components/ai_task/services.yaml Co-authored-by: Allen Porter <allen.porter@gmail.com> --------- Co-authored-by: Allen Porter <allen.porter@gmail.com> Co-authored-by: HarvsG <11440490+HarvsG@users.noreply.github.com>
30 lines
787 B
Python
30 lines
787 B
Python
"""Constants for the AI Task integration."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from enum import IntFlag
|
|
from typing import TYPE_CHECKING
|
|
|
|
from homeassistant.util.hass_dict import HassKey
|
|
|
|
if TYPE_CHECKING:
|
|
from homeassistant.helpers.entity_component import EntityComponent
|
|
|
|
from . import AITaskPreferences
|
|
from .entity import AITaskEntity
|
|
|
|
DOMAIN = "ai_task"
|
|
DATA_COMPONENT: HassKey[EntityComponent[AITaskEntity]] = HassKey(DOMAIN)
|
|
DATA_PREFERENCES: HassKey[AITaskPreferences] = HassKey(f"{DOMAIN}_preferences")
|
|
|
|
DEFAULT_SYSTEM_PROMPT = (
|
|
"You are a Home Assistant expert and help users with their tasks."
|
|
)
|
|
|
|
|
|
class AITaskEntityFeature(IntFlag):
|
|
"""Supported features of the AI task entity."""
|
|
|
|
GENERATE_TEXT = 1
|
|
"""Generate text based on instructions."""
|