Skip to content

Commit

Permalink
secret mapping corrected
Browse files Browse the repository at this point in the history
  • Loading branch information
sfahad1414 committed Dec 13, 2024
1 parent fc6a5e9 commit 9feba66
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion kairon/nlu/classifiers/llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 9feba66

Please sign in to comment.