diff --git a/smarketing-ai/services/sns_content_service.py b/smarketing-ai/services/sns_content_service.py index c62baad..8067403 100644 --- a/smarketing-ai/services/sns_content_service.py +++ b/smarketing-ai/services/sns_content_service.py @@ -1560,6 +1560,9 @@ class SnsContentService: if not images: return None + # ๐Ÿ”ฅ ํ•ต์‹ฌ ์ˆ˜์ •: ์‹ค์ œ ์ด๋ฏธ์ง€ ๊ฐœ์ˆ˜ ๊ณ„์‚ฐ + actual_image_count = len(request.images) if request.images else 0 + # ์ด๋ฏธ์ง€ ํƒ€์ž…๋ณ„ ๋ถ„๋ฅ˜ categorized_images = { '๋งค์žฅ์™ธ๊ด€': [], @@ -1603,7 +1606,8 @@ class SnsContentService: } ], 'image_sequence': [], - 'usage_guide': [] + 'usage_guide': [], + 'actual_image_count': actual_image_count # ๐Ÿ”ฅ ์‹ค์ œ ์ด๋ฏธ์ง€ ์ˆ˜ ์ถ”๊ฐ€ } # ๊ฐ ์„น์…˜์— ์ ์ ˆํ•œ ์ด๋ฏธ์ง€ ๋ฐฐ์ • @@ -1633,6 +1637,9 @@ class SnsContentService: if img not in placement_plan['image_sequence']: placement_plan['image_sequence'].append(img) + # ๐Ÿ”ฅ ํ•ต์‹ฌ ์ˆ˜์ •: ์‹ค์ œ ์ด๋ฏธ์ง€ ์ˆ˜๋งŒํผ๋งŒ ์œ ์ง€ + placement_plan['image_sequence'] = placement_plan['image_sequence'][:actual_image_count] + # ์‚ฌ์šฉ ๊ฐ€์ด๋“œ ์ƒ์„ฑ placement_plan['usage_guide'] = [ "๐Ÿ“ธ ์ด๋ฏธ์ง€ ๋ฐฐ์น˜ ๊ฐ€์ด๋“œ๋ผ์ธ:", @@ -1735,6 +1742,9 @@ class SnsContentService: category_keywords = self.category_keywords.get(request.category, {}).get('๋„ค์ด๋ฒ„ ๋ธ”๋กœ๊ทธ', []) seo_keywords = platform_spec['seo_keywords'] + # ๐Ÿ”ฅ ํ•ต์‹ฌ: ์‹ค์ œ ์ด๋ฏธ์ง€ ๊ฐœ์ˆ˜ ๊ณ„์‚ฐ + actual_image_count = len(request.images) if request.images else 0 + # ์ด๋ฏธ์ง€ ๋ฐฐ์น˜ ์ •๋ณด ์ถ”๊ฐ€ image_placement_info = "" if image_placement_plan: @@ -1786,12 +1796,18 @@ class SnsContentService: 4. ์ด๋ฏธ์ง€๋งˆ๋‹ค ๊ฐ„๋‹จํ•œ ์„ค๋ช… ๋ฌธ๊ตฌ ์ถ”๊ฐ€ 5. ์ง€์—ญ ์ •๋ณด์™€ ์ ‘๊ทผ์„ฑ ์ •๋ณด ํฌํ•จ +**โš ๏ธ ์ค‘์š”ํ•œ ์ œ์•ฝ์‚ฌํ•ญ:** +- ๋ฐ˜๋“œ์‹œ ์ œ๊ณต๋œ {actual_image_count}๊ฐœ์˜ ์ด๋ฏธ์ง€ ๊ฐœ์ˆ˜๋ฅผ ์ดˆ๊ณผํ•˜์ง€ ๋งˆ์„ธ์š” +- [IMAGE_{actual_image_count}]๊นŒ์ง€๋งŒ ์‚ฌ์šฉํ•˜์„ธ์š” +- {actual_image_count}๊ฐœ๋ฅผ ์ดˆ๊ณผํ•˜๋Š” [IMAGE_X] ํƒœ๊ทธ๋Š” ์ ˆ๋Œ€ ์‚ฌ์šฉ ๊ธˆ์ง€ + **ํ•„์ˆ˜ ์š”๊ตฌ์‚ฌํ•ญ:** {request.requirement} or '์œ ์šฉํ•œ ์ •๋ณด๋ฅผ ์ œ๊ณตํ•˜์—ฌ ๋ฐฉ๋ฌธ์„ ์œ ๋„ํ•˜๋Š” ์‹ ๋ขฐ์„ฑ ์žˆ๋Š” ํ›„๊ธฐ' ๋„ค์ด๋ฒ„ ๊ฒ€์ƒ‰์—์„œ ์ƒ์œ„ ๋…ธ์ถœ๋˜๊ณ , ์‹ค์ œ๋กœ ๋„์›€์ด ๋˜๋Š” ์ •๋ณด๋ฅผ ์ œ๊ณตํ•˜๋Š” ๋ธ”๋กœ๊ทธ ํฌ์ŠคํŠธ๋ฅผ ์ž‘์„ฑํ•ด์ฃผ์„ธ์š”. ํ•„์ˆ˜ ์š”๊ตฌ์‚ฌํ•ญ์„ ๋ฐ˜๋“œ์‹œ ์ฐธ๊ณ ํ•˜์—ฌ ์ž‘์„ฑํ•ด์ฃผ์„ธ์š”. ์ด๋ฏธ์ง€ ๋ฐฐ์น˜ ์œ„์น˜๋ฅผ [IMAGE_X] ํƒœ๊ทธ๋กœ ๋ช…ํ™•ํžˆ ํ‘œ์‹œํ•ด์ฃผ์„ธ์š”. + """ return prompt