This commit is contained in:
xds
2026-02-06 14:23:12 +03:00
parent cdb09e84fc
commit 59c40524e0
3 changed files with 4 additions and 4 deletions

2
.env
View File

@@ -3,7 +3,7 @@ BOT_TOKEN=8495170789:AAHyjjhHwwVtd9_ROnjHqPHRdnmyVr1aeaY
GEMINI_API_KEY=AIzaSyAHzDYhgjOqZZnvOnOFRGaSkKu4OAN3kZE
MONGO_HOST=mongodb://admin:super_secure_password@31.59.58.220:27017/
ADMIN_ID=567047
MINIO_ENDPOINT=http://localhost:9000
MINIO_ENDPOINT=https://minio.luminic.space
MINIO_ACCESS_KEY=admin
MINIO_SECRET_KEY=SuperSecretPassword123!
MINIO_BUCKET=ai-char

View File

@@ -149,14 +149,14 @@ class GenerationService:
# 2. Получаем ассеты-референсы (если они есть)
reference_assets: List[Asset] = []
media_group_bytes: List[bytes] = []
generation_prompt = "You are creating image. "
generation_prompt = "Create image for "
if generation.linked_character_id is not None:
char_info = await self.dao.chars.get_character(generation.linked_character_id, with_image_data=True)
if char_info is None:
raise Exception(f"Character ID {generation.linked_character_id} not found")
if generation.use_profile_image:
media_group_bytes.append(char_info.character_image_data)
generation_prompt = f"""You are creating image for {char_info.character_bio}"""
generation_prompt = f"""Create image for character with bio: {char_info.character_bio}"""
reference_assets = await self.dao.assets.get_assets_by_ids(generation.assets_list)
# Извлекаем данные (bytes) из ассетов для отправки в Gemini
@@ -166,7 +166,7 @@ class GenerationService:
for asset in reference_assets
if asset.data is not None and asset.type == AssetType.IMAGE
)
generation_prompt+=f" PROMPT: {generation.prompt}"
generation_prompt+=f" User also provide prompt: {generation.prompt}"
logger.info(f"Final generation prompt assembled. Length: {len(generation_prompt)}. Media count: {len(media_group_bytes)}")
# 3. Запускаем процесс генерации и симуляцию прогресса