Update app.py
Browse files
app.py
CHANGED
@@ -102,38 +102,38 @@ def modify_blog(blog_content: str, modification_instructions: str) -> str:
|
|
102 |
"""
|
103 |
Modifies an existing blog based on user instructions while maintaining quality and coherence.
|
104 |
"""
|
|
|
|
|
|
|
105 |
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.
|
106 |
-
|
|
|
|
|
107 |
Follow these guidelines:
|
108 |
-
|
109 |
1. Content Preservation:
|
110 |
- Maintain the core message and key insights
|
111 |
- Preserve technical accuracy and detail
|
112 |
- Keep valuable examples and case studies
|
113 |
- Retain important statistics and data
|
114 |
- Ensure continuity of argument flow
|
115 |
-
|
116 |
2. Modification Process:
|
117 |
- Apply requested changes precisely
|
118 |
- Maintain consistent tone and style
|
119 |
- Ensure smooth transitions
|
120 |
- Update related sections for consistency
|
121 |
- Verify technical accuracy of changes
|
122 |
-
|
123 |
3. Quality Standards:
|
124 |
- Maintain professional writing quality
|
125 |
- Ensure logical flow and structure
|
126 |
- Keep content engaging and valuable
|
127 |
- Preserve SEO optimization
|
128 |
- Maintain proper formatting
|
129 |
-
|
130 |
4. Technical Accuracy:
|
131 |
- Verify modified technical content
|
132 |
- Update related technical references
|
133 |
- Ensure consistency in terminology
|
134 |
- Maintain accuracy of examples
|
135 |
- Update affected statistics or data
|
136 |
-
|
137 |
5. Final Review:
|
138 |
- Check overall coherence
|
139 |
- Verify formatting consistency
|
@@ -141,7 +141,17 @@ def modify_blog(blog_content: str, modification_instructions: str) -> str:
|
|
141 |
- Maintain reader engagement
|
142 |
- Verify citation accuracy
|
143 |
|
144 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
145 |
|
146 |
chat = ChatOpenAI(model="gpt-4o-mini")
|
147 |
messages = [
|
|
|
102 |
"""
|
103 |
Modifies an existing blog based on user instructions while maintaining quality and coherence.
|
104 |
"""
|
105 |
+
system_prompt = """ Modifies an existing blog based on user instructions while maintaining quality and coherence.
|
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
|
|
|
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 = [
|