home-assistant.io/source/_integrations/openai_conversation.markdown
2023-06-05 13:04:30 +02:00

3.6 KiB

title description ha_category ha_release ha_iot_class ha_config_flow ha_codeowners ha_domain ha_integration_type
OpenAI Conversation Instructions on how to integrate OpenAI as a conversation agent
Voice
2023.2 Cloud Polling true
@balloob
openai_conversation service

The OpenAI integration adds a conversation agent powered by OpenAI in Home Assistant.

This conversation agent is unable to control your house. It can only query information that has been provided by Home Assistant. To be able to answer questions about your house, Home Assistant will need to provide OpenAI with the details of your house, which include areas, devices and their states.

This integration requires an API key to use, which you can generate here.. This is a paid service, we advise you to monitor your costs in the OpenAI portal closely and configure usage limits to avoid unwanted costs associated with using the service.

{% include integrations/config_flow.md %}

Generate an API Key

The OpenAI key is used to authenticate requests to the OpenAI API. To generate an API key take the following steps:

  • Log in to the OpenAI portal or sign up for an account.
  • Enable billing with a valid credit card
  • Configure usage limits.
  • Visit the API Keys page to retrieve the API key you'll use to configure the integration.

{% include integrations/option_flow.md %} {% configuration_basic %} Prompt Template: description: The starting text for the AI language model to generate new text from. This text can include information about your Home Assistant instance, devices, and areas and is written using Home Assistant Templating.

Completion Model: description: The GPT-3 language model is used for text generation. You can find more details on the available models in the OpenAI GPT-3 Documentation.

Maximum Tokens to Return in Response: description: The maximum number of words or "tokens" that the AI model should generate in its completion of the prompt. For more information, see the OpenAI Completion Documentation.

Temperature: description: A value that determines the level of creativity and risk-taking the model should use when generating text. A higher temperature means the model is more likely to generate unexpected results, while a lower temperature results in more deterministic results. See the OpenAI Completion Documentation for more information.

Top P: description: An alternative to temperature, top_p determines the proportion of the most likely word choices the model should consider when generating text. A higher top_p means the model will only consider the most likely words, while a lower top_p means a wider range of words, including less likely ones, will be considered. For more information, see the OpenAI Completion API Reference.

{% endconfiguration_basic %}

Talking to Super Mario over the phone

You can use an OpenAI Conversation integration to talk to Super Mario over a classic landline phone.