From 9feba669cecabb84b436f029918f927f598152d6 Mon Sep 17 00:00:00 2001 From: fahad_shaikh Date: Fri, 13 Dec 2024 09:10:08 +0530 Subject: [PATCH] secret mapping corrected --- 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: