fix some prompt

insta
Ubuntu 2026-01-16 06:55:48 +00:00
parent 4e15e44cbe
commit 4c47d6e0fc
7 changed files with 164 additions and 7 deletions

View File

@ -44,6 +44,7 @@ from app.utils.chatgpt_prompt import ChatgptService
from app.utils.pagination import PaginatedResponse, get_paginated from app.utils.pagination import PaginatedResponse, get_paginated
from app.utils.prompts.prompts import lyric_prompt from app.utils.prompts.prompts import lyric_prompt
import traceback as tb
router = APIRouter(prefix="/lyric", tags=["lyric"]) router = APIRouter(prefix="/lyric", tags=["lyric"])
@ -360,7 +361,7 @@ async def generate_lyric(
task_id=task_id, task_id=task_id,
lyric=None, lyric=None,
language=request_body.language, language=request_body.language,
error_message=str(e), error_message=''.join(tb.format_exception(None, e, e.__traceback__)),
) )

View File

@ -1 +1,34 @@
{"model": "gpt-5-mini", "prompt_variables": ["customer_name", "region", "detail_region_info", "marketing_intelligence_summary", "language", "promotional_expression_example", "timing_rules"], "output_format": {"format": {"type": "json_schema", "name": "lyric", "schema": {"type": "object", "properties": {"lyric": {"type": "string"}}, "required": ["lyric"], "additionalProperties": false}, "strict": true}}} {
"model": "gpt-5-mini",
"prompt_variables": [
"customer_name",
"region",
"detail_region_info",
"marketing_intelligence_summary",
"language",
"promotional_expression_example",
"timing_rules"
],
"output_format": {
"format": {
"type": "json_schema",
"name": "lyric",
"schema": {
"type": "object",
"properties": {
"lyric": {
"type": "string"
},
"suno_prompt":{
"type" : "string"
}
},
"required": [
"lyric", "suno_prompt"
],
"additionalProperties": false
},
"strict": true
}
}
}

View File

@ -34,7 +34,7 @@ Mandatory Inclusions:
- Region name - Region name
- Promotion subject - Promotion subject
- Promotional expressions including: - Promotional expressions including:
{promotional_expressions[language]} {promotional_expression_example}
Content Rules: Content Rules:
- Lyrics must be emotionally driven, not descriptive listings - Lyrics must be emotionally driven, not descriptive listings
@ -64,8 +64,6 @@ Any violation invalidates the entire output
[OUTPUT RULES STRICT] [OUTPUT RULES STRICT]
{timing_rules} {timing_rules}
812 lines
Full verse flow, immersive mood
No explanations No explanations
No headings No headings

View File

@ -1 +1,58 @@
{"model": "gpt-5-mini", "prompt_variables": ["customer_name", "region", "detail_region_info"], "output_format": {"format": {"type": "json_schema", "name": "report", "schema": {"type": "object", "properties": {"report": {"type": "string"}, "selling_points": {"type": "array", "items": {"type": "object", "properties": {"category": {"type": "string"}, "keywords": {"type": "string"}, "description": {"type": "string"}}, "required": ["category", "keywords", "description"], "additionalProperties": false}}, "tags": {"type": "array", "items": {"type": "string"}}}, "required": ["report", "selling_points", "tags"], "additionalProperties": false}, "strict": true}}} {
"model": "gpt-5.2",
"prompt_variables": [
"customer_name",
"region",
"detail_region_info"
],
"output_format": {
"format": {
"type": "json_schema",
"name": "report",
"schema": {
"type": "object",
"properties": {
"report": {
"type": "string"
},
"selling_points": {
"type": "array",
"items": {
"type": "object",
"properties": {
"category": {
"type": "string"
},
"keywords": {
"type": "string"
},
"description": {
"type": "string"
}
},
"required": [
"category",
"keywords",
"description"
],
"additionalProperties": false
}
},
"tags": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": [
"report",
"selling_points",
"tags"
],
"additionalProperties": false
},
"strict": true
}
}
}

View File

@ -11,7 +11,7 @@ The report must clearly explain what makes the property sellable, marketable, an
[Core Analysis Requirements] [Core Analysis Requirements]
Analyze the property based on: Analyze the property based on:
Location, concept, photos, online presence, and nearby environment Location, concept, and nearby environment
Target customer behavior and reservation decision factors Target customer behavior and reservation decision factors
Include: Include:
- Target customer segments & personas - Target customer segments & personas
@ -26,6 +26,7 @@ Focus only on factors that directly influence booking decisions
Each selling point must be concise and visually scannable Each selling point must be concise and visually scannable
Language must be reusable for ads, short-form videos, and listing headlines Language must be reusable for ads, short-form videos, and listing headlines
Avoid full sentences in descriptions; use short selling phrases Avoid full sentences in descriptions; use short selling phrases
Do not provide in report
Output format: Output format:
[Category] [Category]
@ -33,6 +34,7 @@ Output format:
One-line selling phrase (not a full sentence) One-line selling phrase (not a full sentence)
Limit: Limit:
5 to 8 Key Selling Points only 5 to 8 Key Selling Points only
Do not provide in report
[Content & Automation Readiness Check] [Content & Automation Readiness Check]
Ensure that: Ensure that:

View File

@ -0,0 +1,62 @@
[Role & Objective]
Act as a content marketing expert with strong domain knowledge in the Korean pension / stay-accommodation industry.
Your goal is to produce a Marketing Intelligence Report that will be shown to accommodation owners BEFORE any content is generated.
The report must clearly explain what makes the property sellable, marketable, and scalable through content.
[INPUT]
- Business Name: {customer_name}
- Region: {region}
- Region Details: {detail_region_info}
[Core Analysis Requirements]
Analyze the property based on:
Location, concept, photos, online presence, and nearby environment
Target customer behavior and reservation decision factors
Include:
- Target customer segments & personas
- Unique Selling Propositions (USPs)
- Competitive landscape (direct & indirect competitors)
- Market positioning
[Key Selling Point Structuring UI Optimized]
From the analysis above, extract the main Key Selling Points using the structure below.
Rules:
Focus only on factors that directly influence booking decisions
Each selling point must be concise and visually scannable
Language must be reusable for ads, short-form videos, and listing headlines
Avoid full sentences in descriptions; use short selling phrases
Output format:
[Category]
(Tag keyword 5~8 words, noun-based, UI oval-style)
One-line selling phrase (not a full sentence)
Limit:
5 to 8 Key Selling Points only
[Content & Automation Readiness Check]
Ensure that:
Each tag keyword can directly map to a content theme
Each selling phrase can be used as:
- Video hook
- Image headline
- Ad copy snippet
[Tag Generation Rules]
- Tags must include **only core keywords that can be directly used for viral video song lyrics**
- Each tag should be selected with **search discovery + emotional resonance + reservation conversion** in mind
- The number of tags must be **exactly 5**
- Tags must be **nouns or short keyword phrases**; full sentences are strictly prohibited
- The following categories must be **balanced and all represented**:
1) **Location / Local context** (region name, neighborhood, travel context)
2) **Accommodation positioning** (emotional stay, private stay, boutique stay, etc.)
3) **Emotion / Experience** (healing, rest, one-day escape, memory, etc.)
4) **SNS / Viral signals** (Instagram vibes, picture-perfect day, aesthetic travel, etc.)
5) **Travel & booking intent** (travel, getaway, stay, relaxation, etc.)
- If a brand name exists, **at least one tag must include the brand name or a brand-specific expression**
- Avoid overly generic keywords (e.g., “hotel”, “travel” alone); **prioritize distinctive, differentiating phrases**
- The final output must strictly follow the JSON format below, with no additional text
"tags": ["Tag1", "Tag2", "Tag3", "Tag4", "Tag5"]

View File

@ -46,6 +46,10 @@ class Prompt():
missing_variables = input_data.keys() - set(self.prompt_input) missing_variables = input_data.keys() - set(self.prompt_input)
if missing_variables: if missing_variables:
raise Exception(f"missing_variable for prompt {self.prompt_name} : {missing_variables}") raise Exception(f"missing_variable for prompt {self.prompt_name} : {missing_variables}")
flooding_variables = set(self.prompt_input) - input_data.keys()
if flooding_variables:
raise Exception(f"flooding_variables for prompt {self.prompt_name} : {flooding_variables}")
return True return True
marketing_prompt = Prompt( marketing_prompt = Prompt(