edit : api key 파일로 관리

This commit is contained in:
2025-12-19 15:32:05 +09:00
parent 7eed2e9868
commit 113626cc5d
7 changed files with 58 additions and 6 deletions

View File

@@ -7,14 +7,18 @@ from PIL import Image
from io import BytesIO
from main_rest.app.utils.date_utils import D
from const import TEMP_FOLDER
from const import TEMP_FOLDER, API_KEY_MANAGER
def gemini_image(prompt, folder=None):
from custom_logger.main_log import main_logger as LOG
image_path = ''
client = genai.Client(api_key="AIzaSyCSw4pcPDYdAnjzBB7J9ZKXtRJJvunjWtA") # a2tec key
api_key = API_KEY_MANAGER.get_api_key()
if api_key is None:
raise Exception("API 키 세팅 필요! - 서버를 다시 구동하거나, API키 파일을 확인")
client = genai.Client(api_key=API_KEY_MANAGER.get_api_key()) # a2tec key
for i in range(3):
response = client.models.generate_content(