Update app.py
Browse files
app.py
CHANGED
@@ -106,52 +106,20 @@ def modify_blog(blog_content: str, modification_instructions: str) -> str:
|
|
106 |
Makes changes visibly apparent to the user.
|
107 |
"""
|
108 |
system_prompt = """You are an expert blog editor specializing in AI and technology content. Your task is to modify the provided blog according to the user's instructions while maintaining its professional quality.
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
-
|
115 |
-
-
|
116 |
-
- Keep valuable examples and case studies
|
117 |
-
- Retain important statistics and data
|
118 |
-
- Ensure continuity of argument flow
|
119 |
-
2. Modification Process:
|
120 |
-
- Apply requested changes precisely
|
121 |
-
- Maintain consistent tone and style
|
122 |
-
- Ensure smooth transitions
|
123 |
-
- Update related sections for consistency
|
124 |
-
- Verify technical accuracy of changes
|
125 |
-
3. Quality Standards:
|
126 |
-
- Maintain professional writing quality
|
127 |
-
- Ensure logical flow and structure
|
128 |
-
- Keep content engaging and valuable
|
129 |
-
- Preserve SEO optimization
|
130 |
-
- Maintain proper formatting
|
131 |
-
4. Technical Accuracy:
|
132 |
-
- Verify modified technical content
|
133 |
-
- Update related technical references
|
134 |
-
- Ensure consistency in terminology
|
135 |
-
- Maintain accuracy of examples
|
136 |
-
- Update affected statistics or data
|
137 |
-
5. Final Review:
|
138 |
-
- Check overall coherence
|
139 |
-
- Verify formatting consistency
|
140 |
-
- Ensure smooth transitions
|
141 |
-
- Maintain reader engagement
|
142 |
-
- Verify citation accuracy
|
143 |
-
|
144 |
-
If user ask to make a big change then you'll make that big modifications of Blog.
|
145 |
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
- Improved readability by breaking up paragraphs
|
153 |
-
|
154 |
-
Return the complete modified blog with this summary section at the end."""
|
155 |
|
156 |
chat = ChatOpenAI(model="gpt-4o-mini")
|
157 |
messages = [
|
|
|
106 |
Makes changes visibly apparent to the user.
|
107 |
"""
|
108 |
system_prompt = """You are an expert blog editor specializing in AI and technology content. Your task is to modify the provided blog according to the user's instructions while maintaining its professional quality.
|
109 |
+
|
110 |
+
Follow these two key guidelines:
|
111 |
+
1. Content Modification:
|
112 |
+
- Apply requested changes precisely while preserving core message
|
113 |
+
- Maintain professional quality, technical accuracy, and readability
|
114 |
+
- Ensure smooth transitions and logical flow throughout the modified content
|
115 |
+
- Make the requested changes regardless of the type (shortening, expanding, changing tone, etc.)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
116 |
|
117 |
+
2. Visibility of Changes:
|
118 |
+
- Add a "## MODIFICATIONS SUMMARY" section at the very end of the blog
|
119 |
+
- List 2-4 bullet points that clearly explain what major changes were made
|
120 |
+
- Be specific about what was modified (e.g., "Shortened introduction by 40%", "Added new section on ethics")
|
121 |
+
|
122 |
+
Return the complete modified blog with the summary section at the end."""
|
|
|
|
|
|
|
123 |
|
124 |
chat = ChatOpenAI(model="gpt-4o-mini")
|
125 |
messages = [
|