From ba43ceb20d46d436d0c980f8cbb57ad52a429a99 Mon Sep 17 00:00:00 2001 From: Francesco Lana Date: Mon, 19 Aug 2024 11:22:16 +0200 Subject: [PATCH] Added Azure API Management Support --- README.md | 2 +- custom_components/extended_openai_conversation/helpers.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0d43234..1080358 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ Since "gpt-3.5-turbo" model already knows how to call service of Home Assistant 4. In the bottom right corner, select the Add Integration button. 5. Follow the instructions on screen to complete the setup (API Key is required). - [Generating an API Key](https://www.home-assistant.io/integrations/openai_conversation/#generate-an-api-key) - - Specify "Base Url" if using OpenAI compatible servers like LocalAI, otherwise leave as it is. + - Specify "Base Url" if using OpenAI compatible servers like Azure OpenAI (also with APIM), LocalAI, otherwise leave as it is. 6. Go to Settings > [Voice Assistants](https://my.home-assistant.io/redirect/voice_assistants/). 7. Click to edit Assistant (named "Home Assistant" by default). 8. Select "Extended OpenAI Conversation" from "Conversation agent" tab. diff --git a/custom_components/extended_openai_conversation/helpers.py b/custom_components/extended_openai_conversation/helpers.py index 7f9bc23..ab0bfc4 100644 --- a/custom_components/extended_openai_conversation/helpers.py +++ b/custom_components/extended_openai_conversation/helpers.py @@ -56,7 +56,7 @@ _LOGGER = logging.getLogger(__name__) -AZURE_DOMAIN_PATTERN = r"\.openai\.azure\.com" +AZURE_DOMAIN_PATTERN = r"\.(openai\.azure\.com|azure-api\.net)" def get_function_executor(value: str):