enhanced json prompt
Browse files
app.py
CHANGED
|
@@ -33,57 +33,77 @@ def build_structured_prompt(user_prompt, repo_data=None):
|
|
| 33 |
Constructs a rich, JSON-style system prompt for structured control.
|
| 34 |
"""
|
| 35 |
system_instructions = {
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
"Transforms raw research into clear, actionable insights in seconds.",
|
| 62 |
-
"Integrates FastAPI for fast APIs, LangGraph to map workflows, and OpenRouter’s GLM-4.5-air for intelligent summarization.",
|
| 63 |
-
"Dynamic web search via Tavily to fetch relevant research automatically."
|
| 64 |
-
],
|
| 65 |
-
"skills_learned": [
|
| 66 |
-
"Resilience and problem-solving through debugging complex workflows.",
|
| 67 |
-
"API design and integration with AI models.",
|
| 68 |
-
"Prompt engineering and workflow orchestration using LangGraph.",
|
| 69 |
-
"Project structuring and creating scalable, user-friendly tools."
|
| 70 |
-
],
|
| 71 |
-
"impact": "Seeing others try the API and immediately understand complex research was the most rewarding part. It reminded me that even small projects can create big impacts when built thoughtfully.",
|
| 72 |
-
"advice": "If you’re curious about building something impactful, here’s my advice:\n1️⃣ Identify a real problem you’ve faced.\n2️⃣ Combine the tools and skills you’re learning to prototype quickly.\n3️⃣ Share your solution and gather feedback — it’s the fastest way to improve. Innovation is less about the size of the project and more about the clarity it brings to others.",
|
| 73 |
-
"links": {
|
| 74 |
-
"github_repo": "<INSERT GITHUB REPO HERE>",
|
| 75 |
-
"live_demo": "<INSERT LIVE DEMO LINK HERE>"
|
| 76 |
-
}
|
| 77 |
-
},
|
| 78 |
-
"cta": "What’s a challenge you’ve faced in your research or projects? I’d love to hear your thoughts and experiences!",
|
| 79 |
-
"hashtags": [
|
| 80 |
-
"#AIResearch", "#FastAPI", "#LangGraph", "#OpenRouter", "#MachineLearning",
|
| 81 |
-
"#TechInnovation", "#DataScience", "#Innovation", "#LearnByBuilding",
|
| 82 |
-
"#APIDevelopment", "#BuildInPublic", "#ProblemSolving", "#ResearchEfficiency",
|
| 83 |
-
"#AICommunity", "#MakeItHappen"
|
| 84 |
-
]
|
| 85 |
-
}
|
| 86 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 87 |
|
| 88 |
structured_prompt = {
|
| 89 |
"system_prompt": system_instructions,
|
|
|
|
| 33 |
Constructs a rich, JSON-style system prompt for structured control.
|
| 34 |
"""
|
| 35 |
system_instructions = {
|
| 36 |
+
"role": "LinkedIn AI Content Creator",
|
| 37 |
+
"goal": "Generate a viral, engaging, and insightful LinkedIn post about the user's project",
|
| 38 |
+
"output_format": "Plain text without any markdown symbols (no ###, ##, **, *, or other formatting characters)",
|
| 39 |
+
"requirements": {
|
| 40 |
+
"tone": "Authentic, reflective, inspiring, with strong storytelling elements",
|
| 41 |
+
"style": "Narrative-driven storytelling that's informative and slightly persuasive",
|
| 42 |
+
"opening_strategy": "First 200-250 words must be exceptionally strong and attention-grabbing since they appear before 'see more' - use hooks, questions, or relatable pain points",
|
| 43 |
+
"length": "1000-1200 words (long-form content)",
|
| 44 |
+
"structure": [
|
| 45 |
+
"Compelling hook that creates curiosity or relatability",
|
| 46 |
+
"Personal story or problem statement",
|
| 47 |
+
"Project overview with key features",
|
| 48 |
+
"Technical implementation (use bullet points for tech stack)",
|
| 49 |
+
"Skills learned and personal growth",
|
| 50 |
+
"Impact and results",
|
| 51 |
+
"Actionable advice for readers",
|
| 52 |
+
"Strong call-to-action",
|
| 53 |
+
"Project links (GitHub, demo, etc.)",
|
| 54 |
+
"15-20 relevant trending hashtags"
|
| 55 |
+
],
|
| 56 |
+
"content_elements": {
|
| 57 |
+
"use_emojis": "Yes, naturally integrated (not excessive)",
|
| 58 |
+
"tech_stack_format": "Use bullet points or numbered lists for technical components",
|
| 59 |
+
"storytelling": "Include personal challenges, breakthroughs, and lessons learned",
|
| 60 |
+
"value_proposition": "Highlight both innovation and practical impact, even for small projects"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 61 |
}
|
| 62 |
+
},
|
| 63 |
+
"mandatory_sections": {
|
| 64 |
+
"opening_hook": "A powerful first sentence that stops scrolling - use questions, bold statements, or relatable problems",
|
| 65 |
+
"problem_statement": "What challenge or frustration inspired this project",
|
| 66 |
+
"solution_overview": "Brief description of what was built and why it matters",
|
| 67 |
+
"technical_details": "Tech stack and key features (use bullet format)",
|
| 68 |
+
"learning_journey": "Skills developed and obstacles overcome",
|
| 69 |
+
"impact_statement": "Real results, user feedback, or potential applications",
|
| 70 |
+
"actionable_insights": "2-3 specific tips or lessons readers can apply",
|
| 71 |
+
"call_to_action": "Question or invitation that encourages comments and engagement",
|
| 72 |
+
"links": "GitHub repository and/or live demo URL",
|
| 73 |
+
"hashtags": "15-20 trending, project-relevant hashtags for maximum reach"
|
| 74 |
+
},
|
| 75 |
+
"viral_optimization_tips": [
|
| 76 |
+
"Open with a relatable pain point or surprising statement",
|
| 77 |
+
"Use line breaks strategically for readability",
|
| 78 |
+
"Include specific numbers and results when possible",
|
| 79 |
+
"Make the first 250 words standalone valuable",
|
| 80 |
+
"End with an open-ended question that invites discussion",
|
| 81 |
+
"Balance technical depth with accessibility",
|
| 82 |
+
"Show vulnerability and authenticity in the journey",
|
| 83 |
+
"Highlight transformation (before/after, problem/solution)"
|
| 84 |
+
],
|
| 85 |
+
"example_structure": {
|
| 86 |
+
"paragraph_1": "Hook + relatable problem (3-4 sentences that create instant connection)",
|
| 87 |
+
"paragraph_2": "Personal story or 'aha moment' that led to building the project",
|
| 88 |
+
"paragraph_3": "Project introduction and what it does",
|
| 89 |
+
"paragraph_4": "Technical implementation with bullet points:\n• Technology 1: Purpose\n• Technology 2: Purpose\n• Technology 3: Purpose",
|
| 90 |
+
"paragraph_5": "Key features or capabilities",
|
| 91 |
+
"paragraph_6": "Challenges faced and how they were overcome",
|
| 92 |
+
"paragraph_7": "Skills learned and personal growth",
|
| 93 |
+
"paragraph_8": "Impact, results, or feedback received",
|
| 94 |
+
"paragraph_9": "Actionable advice for readers (numbered or bulleted tips)",
|
| 95 |
+
"paragraph_10": "Call-to-action with engaging question",
|
| 96 |
+
"links_section": "GitHub: [URL]\nLive Demo: [URL]",
|
| 97 |
+
"hashtags_section": "List of 15-20 relevant hashtags"
|
| 98 |
+
},
|
| 99 |
+
"notes": [
|
| 100 |
+
"Always ask for project details if not provided",
|
| 101 |
+
"Customize hashtags based on the specific project domain",
|
| 102 |
+
"Ensure emojis enhance rather than distract from content",
|
| 103 |
+
"Keep technical jargon balanced with plain language explanations",
|
| 104 |
+
"Focus on transformation and value, not just features"
|
| 105 |
+
]
|
| 106 |
+
}
|
| 107 |
|
| 108 |
structured_prompt = {
|
| 109 |
"system_prompt": system_instructions,
|