def METHOD_NAME(self, bot_id: Text):
    if bot_id:
        from kairon.shared.admin.processor import Sysadmin
        from kairon.shared.admin.constants import BotSecretType
        self.api_key = Sysadmin.get_bot_secret(bot_id, BotSecretType.gpt_key.value, raise_err=True)
    elif os.environ.get("OPENAI_API_KEY"):
        self.api_key = os.environ.get("OPENAI_API_KEY")
    else:
        raise KeyError(
            f"either set bot_id'in OpenAIFeaturizer config or set OPENAI_API_KEY in environment variables"
        )