From 799fc8d5c181eb7d4c5bc034eaa04cd6f66b8883 Mon Sep 17 00:00:00 2001 From: Fahad Ali Shaikh Date: Fri, 13 Dec 2024 10:19:25 +0530 Subject: [PATCH] secret mapping corrected (#1654) --- kairon/nlu/classifiers/llm.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kairon/nlu/classifiers/llm.py b/kairon/nlu/classifiers/llm.py index 39cec4b8c..501b59361 100644 --- a/kairon/nlu/classifiers/llm.py +++ b/kairon/nlu/classifiers/llm.py @@ -48,6 +48,7 @@ def __init__( data: Optional[Dict[Text, Any]] = None, ) -> None: """Construct a new intent classifiers using the OpenAI Completion framework.""" + self.secret = {} self.component_config = config self._model_storage = model_storage self._resource = resource @@ -82,7 +83,7 @@ def load_api_key(self, bot_id: Text): if bot_id: from kairon.shared.admin.processor import Sysadmin llm_secret = Sysadmin.get_llm_secret("openai", bot_id) - self.secret = llm_secret.get('api_key') + self.secret = llm_secret elif os.environ.get("LLM_API_KEY"): self.secret = {'api_key': os.environ.get("LLM_API_KEY")} else: