Skip to content

Commit

Permalink
refactor(Chatbot): make _mask_api_key a static method
Browse files Browse the repository at this point in the history
- Converted _mask_api_key to a static method for better utility.
- Removed unnecessary comment in main.py regarding pyngrok import.
  • Loading branch information
IRedDragonICY committed Oct 8, 2024
1 parent 5e77f61 commit f15bebf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/Chatbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 0 additions & 1 deletion src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import numpy as np
import uvicorn

# Perbaikan import pyngrok
from pyngrok import ngrok

logging.disable(logging.CRITICAL)
Expand Down

0 comments on commit f15bebf

Please sign in to comment.