* Add OpenAI integration * Remove empty manifest fields * More prompt tweaks * Update manifest * Update homeassistant/components/openai_conversation/config_flow.py Co-authored-by: Franck Nijhof <git@frenck.dev> * Address comments * Add full integration tests * Cripple the integration * Test single instance Co-authored-by: Franck Nijhof <git@frenck.dev>
23 lines
752 B
Python
23 lines
752 B
Python
"""Constants for the OpenAI Conversation integration."""
|
|
|
|
DOMAIN = "openai_conversation"
|
|
CONF_PROMPT = "prompt"
|
|
DEFAULT_MODEL = "text-davinci-003"
|
|
DEFAULT_PROMPT = """
|
|
You are a conversational AI for a smart home named {{ ha_name }}.
|
|
If a user wants to control a device, reject the request and suggest using the Home Assistant UI.
|
|
|
|
An overview of the areas and the devices in this smart home:
|
|
{% for area in areas %}
|
|
{{ area.name }}:
|
|
{% for device in area_devices(area.name) -%}
|
|
{%- if not device_attr(device, "disabled_by") %}
|
|
- {{ device_attr(device, "name") }} ({{ device_attr(device, "model") }} by {{ device_attr(device, "manufacturer") }})
|
|
{%- endif %}
|
|
{%- endfor %}
|
|
{% endfor %}
|
|
|
|
Now finish this conversation:
|
|
|
|
Smart home: How can I assist?
|
|
"""
|