From f15bebf5254e456731dfce90865d5f3f0aad682a Mon Sep 17 00:00:00 2001 From: IRedDragonICY Date: Tue, 8 Oct 2024 17:00:50 +0800 Subject: [PATCH] refactor(Chatbot): make _mask_api_key a static method - Converted _mask_api_key to a static method for better utility. - Removed unnecessary comment in main.py regarding pyngrok import. --- src/Chatbot.py | 3 ++- src/main.py | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Chatbot.py b/src/Chatbot.py index 0a56bfd..1af898b 100644 --- a/src/Chatbot.py +++ b/src/Chatbot.py @@ -50,7 +50,8 @@ def _model_config(self): self.config.HARM_CATEGORIES] return generation_config, safety_settings - def _mask_api_key(self, key): + @staticmethod + def _mask_api_key(key): if len(key) > 6: return key[:-6] + '*' * 6 return '*' * len(key) diff --git a/src/main.py b/src/main.py index 8703eba..11c964c 100644 --- a/src/main.py +++ b/src/main.py @@ -11,7 +11,6 @@ import numpy as np import uvicorn -# Perbaikan import pyngrok from pyngrok import ngrok logging.disable(logging.CRITICAL)