mirror of
https://github.com/won-ktds/smarketing-backend.git
synced 2025-12-06 07:06:24 +00:00
Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
a34a80a41f
@ -1450,8 +1450,8 @@ class SnsContentService:
|
|||||||
|
|
||||||
# 네이버 블로그인 경우 이미지 배치 계획 생성
|
# 네이버 블로그인 경우 이미지 배치 계획 생성
|
||||||
image_placement_plan = None
|
image_placement_plan = None
|
||||||
# if request.platform == '네이버 블로그':
|
if request.platform == '네이버 블로그':
|
||||||
# image_placement_plan = self._create_image_placement_plan(image_analysis, request)
|
image_placement_plan = self._create_image_placement_plan(image_analysis, request)
|
||||||
|
|
||||||
# 플랫폼별 특화 프롬프트 생성
|
# 플랫폼별 특화 프롬프트 생성
|
||||||
prompt = self._create_platform_specific_prompt(request, image_analysis, image_placement_plan)
|
prompt = self._create_platform_specific_prompt(request, image_analysis, image_placement_plan)
|
||||||
@ -1551,98 +1551,98 @@ class SnsContentService:
|
|||||||
|
|
||||||
return '기타'
|
return '기타'
|
||||||
|
|
||||||
# def _create_image_placement_plan(self, image_analysis: Dict[str, Any], request: SnsContentGetRequest) -> Dict[
|
def _create_image_placement_plan(self, image_analysis: Dict[str, Any], request: SnsContentGetRequest) -> Dict[
|
||||||
# str, Any]:
|
str, Any]:
|
||||||
# """
|
"""
|
||||||
# 네이버 블로그용 이미지 배치 계획 생성
|
네이버 블로그용 이미지 배치 계획 생성
|
||||||
# """
|
"""
|
||||||
# images = image_analysis.get('results', [])
|
images = image_analysis.get('results', [])
|
||||||
# if not images:
|
if not images:
|
||||||
# return None
|
return None
|
||||||
#
|
|
||||||
# # 이미지 타입별 분류
|
# 이미지 타입별 분류
|
||||||
# categorized_images = {
|
categorized_images = {
|
||||||
# '매장외관': [],
|
'매장외관': [],
|
||||||
# '인테리어': [],
|
'인테리어': [],
|
||||||
# '메뉴판': [],
|
'메뉴판': [],
|
||||||
# '음식': [],
|
'음식': [],
|
||||||
# '사람': [],
|
'사람': [],
|
||||||
# '기타': []
|
'기타': []
|
||||||
# }
|
}
|
||||||
#
|
|
||||||
# for img in images:
|
for img in images:
|
||||||
# img_type = img.get('type', '기타')
|
img_type = img.get('type', '기타')
|
||||||
# categorized_images[img_type].append(img)
|
categorized_images[img_type].append(img)
|
||||||
#
|
|
||||||
# # 블로그 구조에 따른 이미지 배치 계획
|
# 블로그 구조에 따른 이미지 배치 계획
|
||||||
# #placement_plan = {
|
placement_plan = {
|
||||||
# # 'structure': [
|
'structure': [
|
||||||
# # {
|
{
|
||||||
# # 'section': '인트로',
|
'section': '인트로',
|
||||||
# # 'description': '첫인상과 방문 동기',
|
'description': '첫인상과 방문 동기',
|
||||||
# # 'recommended_images': [],
|
'recommended_images': [],
|
||||||
# # 'placement_guide': '매장 외관이나 대표적인 음식 사진으로 시작'
|
'placement_guide': '매장 외관이나 대표적인 음식 사진으로 시작'
|
||||||
# # },
|
},
|
||||||
# # {
|
{
|
||||||
# # 'section': '매장 정보',
|
'section': '매장 정보',
|
||||||
# # 'description': '위치, 분위기, 인테리어 소개',
|
'description': '위치, 분위기, 인테리어 소개',
|
||||||
# # 'recommended_images': [],
|
'recommended_images': [],
|
||||||
# # 'placement_guide': '매장 외관 → 내부 인테리어 순서로 배치'
|
'placement_guide': '매장 외관 → 내부 인테리어 순서로 배치'
|
||||||
# # },
|
},
|
||||||
# # {
|
{
|
||||||
# # 'section': '메뉴 소개',
|
'section': '메뉴 소개',
|
||||||
# # 'description': '주문한 메뉴와 상세 후기',
|
'description': '주문한 메뉴와 상세 후기',
|
||||||
# # 'recommended_images': [],
|
'recommended_images': [],
|
||||||
# # 'placement_guide': '메뉴판 → 실제 음식 사진 순서로 배치'
|
'placement_guide': '메뉴판 → 실제 음식 사진 순서로 배치'
|
||||||
# # },
|
},
|
||||||
# # {
|
{
|
||||||
# # 'section': '총평',
|
'section': '총평',
|
||||||
# # 'description': '재방문 의향과 추천 이유',
|
'description': '재방문 의향과 추천 이유',
|
||||||
# # 'recommended_images': [],
|
'recommended_images': [],
|
||||||
# # 'placement_guide': '가장 매력적인 음식 사진이나 전체 분위기 사진'
|
'placement_guide': '가장 매력적인 음식 사진이나 전체 분위기 사진'
|
||||||
# # }
|
}
|
||||||
# # ],
|
],
|
||||||
# # 'image_sequence': [],
|
'image_sequence': [],
|
||||||
# # 'usage_guide': []
|
'usage_guide': []
|
||||||
# # }
|
}
|
||||||
#
|
|
||||||
# # 각 섹션에 적절한 이미지 배정
|
# 각 섹션에 적절한 이미지 배정
|
||||||
# # 인트로: 매장외관 또는 대표 음식
|
# 인트로: 매장외관 또는 대표 음식
|
||||||
# if categorized_images['매장외관']:
|
if categorized_images['매장외관']:
|
||||||
# placement_plan['structure'][0]['recommended_images'].extend(categorized_images['매장외관'][:1])
|
placement_plan['structure'][0]['recommended_images'].extend(categorized_images['매장외관'][:1])
|
||||||
# elif categorized_images['음식']:
|
elif categorized_images['음식']:
|
||||||
# placement_plan['structure'][0]['recommended_images'].extend(categorized_images['음식'][:1])
|
placement_plan['structure'][0]['recommended_images'].extend(categorized_images['음식'][:1])
|
||||||
#
|
|
||||||
# # 매장 정보: 외관 + 인테리어
|
# 매장 정보: 외관 + 인테리어
|
||||||
# placement_plan['structure'][1]['recommended_images'].extend(categorized_images['매장외관'])
|
placement_plan['structure'][1]['recommended_images'].extend(categorized_images['매장외관'])
|
||||||
# placement_plan['structure'][1]['recommended_images'].extend(categorized_images['인테리어'])
|
placement_plan['structure'][1]['recommended_images'].extend(categorized_images['인테리어'])
|
||||||
#
|
|
||||||
# # 메뉴 소개: 메뉴판 + 음식
|
# 메뉴 소개: 메뉴판 + 음식
|
||||||
# placement_plan['structure'][2]['recommended_images'].extend(categorized_images['메뉴판'])
|
placement_plan['structure'][2]['recommended_images'].extend(categorized_images['메뉴판'])
|
||||||
# placement_plan['structure'][2]['recommended_images'].extend(categorized_images['음식'])
|
placement_plan['structure'][2]['recommended_images'].extend(categorized_images['음식'])
|
||||||
#
|
|
||||||
# # 총평: 남은 음식 사진 또는 기타
|
# 총평: 남은 음식 사진 또는 기타
|
||||||
# remaining_food = [img for img in categorized_images['음식']
|
remaining_food = [img for img in categorized_images['음식']
|
||||||
# if img not in placement_plan['structure'][2]['recommended_images']]
|
if img not in placement_plan['structure'][2]['recommended_images']]
|
||||||
# placement_plan['structure'][3]['recommended_images'].extend(remaining_food[:1])
|
placement_plan['structure'][3]['recommended_images'].extend(remaining_food[:1])
|
||||||
# placement_plan['structure'][3]['recommended_images'].extend(categorized_images['기타'][:1])
|
placement_plan['structure'][3]['recommended_images'].extend(categorized_images['기타'][:1])
|
||||||
#
|
|
||||||
# # 전체 이미지 순서 생성
|
# 전체 이미지 순서 생성
|
||||||
# for section in placement_plan['structure']:
|
for section in placement_plan['structure']:
|
||||||
# for img in section['recommended_images']:
|
for img in section['recommended_images']:
|
||||||
# if img not in placement_plan['image_sequence']:
|
if img not in placement_plan['image_sequence']:
|
||||||
# placement_plan['image_sequence'].append(img)
|
placement_plan['image_sequence'].append(img)
|
||||||
#
|
|
||||||
# # 사용 가이드 생성
|
# 사용 가이드 생성
|
||||||
# placement_plan['usage_guide'] = [
|
placement_plan['usage_guide'] = [
|
||||||
# "📸 이미지 배치 가이드라인:",
|
"📸 이미지 배치 가이드라인:",
|
||||||
# "1. 각 섹션마다 2-3문장의 설명 후 이미지 삽입",
|
"1. 각 섹션마다 2-3문장의 설명 후 이미지 삽입",
|
||||||
# "2. 이미지마다 간단한 설명 텍스트 추가",
|
"2. 이미지마다 간단한 설명 텍스트 추가",
|
||||||
# "3. 음식 사진은 가장 맛있어 보이는 각도로 배치",
|
"3. 음식 사진은 가장 맛있어 보이는 각도로 배치",
|
||||||
# "4. 마지막에 전체적인 분위기를 보여주는 사진으로 마무리"
|
"4. 마지막에 전체적인 분위기를 보여주는 사진으로 마무리"
|
||||||
# ]
|
]
|
||||||
#
|
|
||||||
# return placement_plan
|
return placement_plan
|
||||||
|
|
||||||
def _create_platform_specific_prompt(self, request: SnsContentGetRequest, image_analysis: Dict[str, Any],
|
def _create_platform_specific_prompt(self, request: SnsContentGetRequest, image_analysis: Dict[str, Any],
|
||||||
image_placement_plan: Dict[str, Any] = None) -> str:
|
image_placement_plan: Dict[str, Any] = None) -> str:
|
||||||
@ -1777,9 +1777,8 @@ class SnsContentService:
|
|||||||
1. 검색자의 궁금증을 해결하는 정보 중심 작성
|
1. 검색자의 궁금증을 해결하는 정보 중심 작성
|
||||||
2. 구체적인 가격, 위치, 운영시간 등 실용 정보 포함
|
2. 구체적인 가격, 위치, 운영시간 등 실용 정보 포함
|
||||||
3. 개인적인 경험과 솔직한 후기 작성
|
3. 개인적인 경험과 솔직한 후기 작성
|
||||||
4. 각 섹션마다 적절한 위치에 [IMAGE_X] 태그로 이미지 배치 위치 표시
|
4. 이미지마다 간단한 설명 문구 추가
|
||||||
5. 이미지마다 간단한 설명 문구 추가
|
5. 지역 정보와 접근성 정보 포함
|
||||||
6. 지역 정보와 접근성 정보 포함
|
|
||||||
|
|
||||||
**이미지 태그 사용법:**
|
**이미지 태그 사용법:**
|
||||||
- [IMAGE_1]: 첫 번째 이미지 배치 위치
|
- [IMAGE_1]: 첫 번째 이미지 배치 위치
|
||||||
@ -1791,8 +1790,6 @@ class SnsContentService:
|
|||||||
|
|
||||||
네이버 검색에서 상위 노출되고, 실제로 도움이 되는 정보를 제공하는 블로그 포스트를 작성해주세요.
|
네이버 검색에서 상위 노출되고, 실제로 도움이 되는 정보를 제공하는 블로그 포스트를 작성해주세요.
|
||||||
필수 요구사항을 반드시 참고하여 작성해주세요.
|
필수 요구사항을 반드시 참고하여 작성해주세요.
|
||||||
이미지 배치 위치를 [IMAGE_X] 태그로 명확히 표시해주세요.
|
|
||||||
이미지는 제공된 것만 사용하시고, 추가하진 말아주세요.
|
|
||||||
"""
|
"""
|
||||||
return prompt
|
return prompt
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user