2023-01-25 16:30:13 +00:00
|
|
|
"""Constants for the OpenAI Conversation integration."""
|
|
|
|
|
|
|
|
DOMAIN = "openai_conversation"
|
|
|
|
CONF_PROMPT = "prompt"
|
2023-01-26 03:17:19 +00:00
|
|
|
DEFAULT_PROMPT = """This smart home is controlled by Home Assistant.
|
2023-01-25 16:30:13 +00:00
|
|
|
|
|
|
|
An overview of the areas and the devices in this smart home:
|
2023-01-26 03:17:19 +00:00
|
|
|
{%- for area in areas %}
|
2023-01-26 10:04:15 +00:00
|
|
|
{%- set area_info = namespace(printed=false) %}
|
|
|
|
{%- for device in area_devices(area.name) -%}
|
2023-02-07 04:57:08 +00:00
|
|
|
{%- if not device_attr(device, "disabled_by") and not device_attr(device, "entry_type") and device_attr(device, "name") %}
|
2023-01-26 10:04:15 +00:00
|
|
|
{%- if not area_info.printed %}
|
2023-01-26 03:17:19 +00:00
|
|
|
|
2023-01-25 16:30:13 +00:00
|
|
|
{{ area.name }}:
|
2023-01-26 10:04:15 +00:00
|
|
|
{%- set area_info.printed = true %}
|
|
|
|
{%- endif %}
|
2023-02-14 10:45:27 +00:00
|
|
|
- {{ device_attr(device, "name") }}{% if device_attr(device, "model") and (device_attr(device, "model") | string) not in (device_attr(device, "name") | string) %} ({{ device_attr(device, "model") }}){% endif %}
|
2023-01-26 10:04:15 +00:00
|
|
|
{%- endif %}
|
|
|
|
{%- endfor %}
|
2023-01-26 03:17:19 +00:00
|
|
|
{%- endfor %}
|
|
|
|
|
2023-02-15 01:33:58 +00:00
|
|
|
Answer the user's questions about the world truthfully.
|
2023-01-26 03:17:19 +00:00
|
|
|
|
2023-01-26 22:25:02 +00:00
|
|
|
If the user wants to control a device, reject the request and suggest using the Home Assistant app.
|
2023-01-25 16:30:13 +00:00
|
|
|
|
|
|
|
Now finish this conversation:
|
|
|
|
|
|
|
|
Smart home: How can I assist?
|
|
|
|
"""
|
2023-01-30 13:24:11 +00:00
|
|
|
CONF_MODEL = "model"
|
|
|
|
DEFAULT_MODEL = "text-davinci-003"
|
|
|
|
CONF_MAX_TOKENS = "max_tokens"
|
|
|
|
DEFAULT_MAX_TOKENS = 150
|
|
|
|
CONF_TOP_P = "top_p"
|
|
|
|
DEFAULT_TOP_P = 1
|
|
|
|
CONF_TEMPERATURE = "temperature"
|
|
|
|
DEFAULT_TEMPERATURE = 0.5
|