Azure OpenAI Conversation Custom Integration for Home Assistant
This custom integration adds a conversation agent powered by Azure OpenAI in Home Assistant, it's based on the original OpenAI Conversation integration for 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.
Supported Azure OpenAI API Versions:
Home Assistant versions supported: Due to the breaking changes introduced by Home Assistant Core for custom assistants, the Azure OpenAI Conversation integration is compatible with the following Home Assistant versions:
Azure OpenAI Conversation Version | Home Assistant Version |
---|---|
0.x.y | 2023.4.x |
1.x.y | 2023.5+ |
configuration.yaml
:conversation:
API Key
, API Base
and API Version
used following the example below and hit submit:
- API Key: 1234567890abcdef1234567890abcdef
- API Base: https://iotlabopenai.openai.azure.com/
- API Version: 2023-03-15-preview
The custom assistant needs to be added from Settings -> Voice assistants. Once it's added, you can select the custom assistant as favorite to be used by default:
Options for Azure OpenAI Conversation can be set via the user interface, by taking the following steps:
Options available:
Prompt Template: 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: The name of the GPT language model deployed for text generation (i.e.- my-gpt35-model
). You can find more details on the available models in the Azure OpenAI Documentation.
Maximum Tokens to Return in Response The maximum number of words or "tokens" that the AI model should generate in its completion of the prompt. For more information, see the Azure OpenAI Completion Documentation.
Temperature: 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 Azure OpenAI Completion Documentation for more information.
Top P: 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 Azure OpenAI Completion Documentation.
Please reference the release history.
While it'd be nice to have more developers, you can contribute without knowing how to code. You can file bugs/feature requests, or you can help with other tasks like UI Translations and updating the README.
More languages can be added here, contributions are welcome :)
Languages available:
The README file will be used for Documentation, if it's expanded in the future with automations or other tweaks, we can think on a wiki for that purpose.
Disclaimer: Don't worry about making mistakes as we can revert using the history ?.
GitHub | Buy me a coffee |
---|---|
MIT - By providing a contribution, you agree the contribution is licensed under MIT.