From bddc7a473c126c45386bd9d592bdf38dbcf03d44 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Erik=20Hedenstro=CC=88m?= <erik@hedenstroem.com>
Date: Wed, 26 Jun 2024 13:25:26 +0200
Subject: [PATCH] Removed unused imports

---
 openai_patch/__init__.py | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/openai_patch/__init__.py b/openai_patch/__init__.py
index b606ed2..085ef16 100644
--- a/openai_patch/__init__.py
+++ b/openai_patch/__init__.py
@@ -1,10 +1,6 @@
-import re
-import json
 import logging
 import openai
 
-from homeassistant.helpers import intent
-from homeassistant.exceptions import ServiceNotFound
 from homeassistant.components import conversation
 from homeassistant.components.openai_conversation.conversation import OpenAIConversationEntity
 
@@ -15,18 +11,12 @@ async def async_setup(hass, config):
     original = OpenAIConversationEntity.async_process
 
     async def async_process(self, user_input: conversation.ConversationInput) -> conversation.ConversationResult:
-        _LOGGER.debug("OpenAIConversationEntity.async_process")
         client: openai.AsyncClient = self.entry.runtime_data
-
         if "|" in client.api_key:
-            _LOGGER.debug(f"Modifying base_url and api_key: {client.api_key}")
             client.base_url = client.api_key.split("|")[0]
             client.api_key = client.api_key.split("|")[1]
-
-        _LOGGER.debug(dir(client))
-        _LOGGER.debug(vars(client))
-        result = await original(self, user_input)
-        return result
+            _LOGGER.debug(f"Modified Base URL: {client.base_url}")
+        return await original(self, user_input)
 
     OpenAIConversationEntity.async_process = async_process
     _LOGGER.info("Patched OpenAIConversationEntity.async_process")
-- 
GitLab