home-assistant.io/source/voice_control/assist_create_open_ai_personality.markdown
c0ffeeca7 e51af72cbe
AI personality, Mario tutorial: update to reflect current SW (#33112)
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2024-06-10 08:34:00 +02:00

4.6 KiB

title, related
title related
Create a personality with AI
docs title
/voice_control/voice_remote_cloud_assistant/ Cloud assistant pipeline
docs title
/voice_control/voice_remote_local_assistant/ Local assistant pipeline
url title
https://www.nabucasa.com Home Assistant Cloud
docs title
/integrations/google_generative_ai_conversation/ Google Generative AI integration
docs title
/integrations/openai_conversation/ OpenAI Conversation integration
docs title
/voice_control/voice_remote_expose_devices/ Exposing entities to Assist

You can give your voice assistant personality by using an AI conversation agent. Currently, this works with the OpenAI Conversation or the Google Generative AI integration.

For this tutorial, we will work with OpenAI. This requires an OpenAI account. For what we do here, the free trial option is sufficient.

Demos

Interview with an AI Mario personality

Using Assist with AI to control your smart home

An 1-minute clip showing how Assist is using AI to control a smart home.

Prerequisites

This tutorial assumes you have a few things set up already:

Creating an OpenAI voice assistant personality

Using OpenAI requires an OpenAI account. For this tutorial, the free trial option is sufficient. No need to leave your credit card information.

  1. Set up an OpenAI account and install the OpenAI conversation integration.

  2. Create a Mario personality.

    • Once you installed the OpenAI Conversation integration, go to {% my integrations title="Settings > Devices & Services" %}. In the OpenAI Conversation integration, select Configure.

      Configure the OpenAI integration

    • In the Prompt template field, enter the following text:

      You are Super Mario from Mario Bros. Be funny.

    • Define if the OpenAI voice assistant is allowed to control the devices in your home.

      • No control: you can talk to Mario, but it cannot control devices.
      • Assist: you can talk to it and it can control devices. For example, it could turn on the lights.
        • Assist can only control {% term entities %} that are exposed to it.
    • Define the Model:

      • If you have a paid OpenAI subscription that supports GPT4.0, you can select Submit.
      • If you use the free trial version, deselect the Recommended model settings checkbox and select Submit.
      • Then, under Model, enter gpt-3.5-turbo and select Submit.

      Add prompt for Mario personality

  3. Give your personality a name:

    • Select Rename and change the name to OpenAI Mario.

      Give your Mario personality a name

  4. Create a Mario assistant:

    • Under {% my voice_assistants title="Settings > Voice assistants" %}, select Add assistant.
    • Give it a name, select a language, and under Conversation agent, select the Mario OpenAI Conversation integration. Add a new assistant
    • Leave the other settings unchanged and select Create.
  5. You can repeat this with other OpenAI personalities. You can add as many OpenAI Conversation integrations as you would like.

    • To add a new personality, you need to create a new API key. Then, add a new OpenAI Conversation integration with that API key.

Tutorial: Setting up Assist with OpenAI

Step-by-step tutorial with some background information, from the Home Assistant Release Party 2024.6 live stream.

Using the AI voice assistant on your devices

To learn how to use the AI assistant with your devices, refer to one of the following tutorials, depending on the hardware you want to use to interact with it: