mirror of
https://github.com/smkrv/ha-text-ai.git
synced 2026-07-28 18:43:52 +08:00
Release v2.0.0
This commit is contained in:
@@ -44,38 +44,28 @@ from .const import (
|
|||||||
import logging
|
import logging
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
STEP_USER_DATA_SCHEMA = vol.Schema({
|
STEP_USER_DATA_SCHEMA = vol.Schema(
|
||||||
vol.Required(CONF_API_KEY): cv.string,
|
{
|
||||||
vol.Optional(CONF_MODEL, default=DEFAULT_MODEL): cv.string,
|
vol.Required(CONF_API_KEY): cv.string,
|
||||||
vol.Optional(
|
vol.Optional(CONF_MODEL, default=DEFAULT_MODEL): cv.string,
|
||||||
CONF_TEMPERATURE,
|
vol.Optional(CONF_TEMPERATURE, default=DEFAULT_TEMPERATURE): vol.All(
|
||||||
default=DEFAULT_TEMPERATURE
|
vol.Coerce(float),
|
||||||
): vol.All(
|
vol.Range(min=MIN_TEMPERATURE, max=MAX_TEMPERATURE)
|
||||||
vol.Coerce(float),
|
),
|
||||||
vol.Range(min=MIN_TEMPERATURE, max=MAX_TEMPERATURE)
|
vol.Optional(CONF_MAX_TOKENS, default=DEFAULT_MAX_TOKENS): vol.All(
|
||||||
),
|
vol.Coerce(int),
|
||||||
vol.Optional(
|
vol.Range(min=MIN_MAX_TOKENS, max=MAX_MAX_TOKENS)
|
||||||
CONF_MAX_TOKENS,
|
),
|
||||||
default=DEFAULT_MAX_TOKENS
|
vol.Optional(CONF_API_ENDPOINT, default=DEFAULT_API_ENDPOINT): vol.All(
|
||||||
): vol.All(
|
cv.string,
|
||||||
vol.Coerce(int),
|
vol.Match(r'^https?://.+', msg="Must be a valid HTTP(S) URL")
|
||||||
vol.Range(min=MIN_MAX_TOKENS, max=MAX_MAX_TOKENS)
|
),
|
||||||
),
|
vol.Optional(CONF_REQUEST_INTERVAL, default=DEFAULT_REQUEST_INTERVAL): vol.All(
|
||||||
vol.Optional(
|
vol.Coerce(float),
|
||||||
CONF_API_ENDPOINT,
|
vol.Range(min=MIN_REQUEST_INTERVAL)
|
||||||
default=DEFAULT_API_ENDPOINT
|
)
|
||||||
): vol.All(
|
}
|
||||||
cv.string,
|
)
|
||||||
vol.Match(r'^https?://.+', msg="Must be a valid HTTP(S) URL")
|
|
||||||
),
|
|
||||||
vol.Optional(
|
|
||||||
CONF_REQUEST_INTERVAL,
|
|
||||||
default=DEFAULT_REQUEST_INTERVAL
|
|
||||||
): vol.All(
|
|
||||||
vol.Coerce(float),
|
|
||||||
vol.Range(min=MIN_REQUEST_INTERVAL)
|
|
||||||
)
|
|
||||||
})
|
|
||||||
|
|
||||||
async def validate_api_connection(
|
async def validate_api_connection(
|
||||||
hass,
|
hass,
|
||||||
|
|||||||
Reference in New Issue
Block a user