Pratik333 commited on
Commit
1a0aefb
·
verified ·
1 Parent(s): 38fab13

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -45
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
- Understand user requirement and modify blog accordingly.
110
- If user asks to shorten the content, make it concise while preserving key points.
111
-
112
- Follow these guidelines:
113
- 1. Content Preservation:
114
- - Maintain the core message and key insights
115
- - Preserve technical accuracy and detail
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
- IMPORTANT: To make your changes visibly apparent, please add a "## MODIFICATIONS SUMMARY" section at the very end of the blog that briefly lists the key changes you made. For example:
147
-
148
- ## MODIFICATIONS SUMMARY
149
- - Shortened introduction by 30%
150
- - Added section on ethical implications
151
- - Updated statistics to include latest research
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 = [