baconnier commited on
Commit
4738f1b
1 Parent(s): 5626857

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -88
app.py CHANGED
@@ -142,94 +142,7 @@ Only provide the output in the following JSON format enclosed in <json> tags:
142
  </json>
143
  """
144
 
145
- echo_prompt_refiner = '''You are an AI assistant implementing the ECHO (Self-Harmonized Chain of Thought) method to refine an initial prompt into a more relevant and comprehensive one. Given an initial prompt, follow these steps:
146
 
147
- 1. Prompt Analysis:
148
- - Analyze the initial prompt
149
- - Identify key concepts, objectives, and constraints within the prompt
150
- - Determine the prompt type (e.g., task-oriented, creative, analytical)
151
-
152
- 2. Prompt Expansion:
153
- - Generate at least 8-10 alternative versions of the prompt that explore different aspects or phrasings
154
- - Ensure these versions cover various perspectives and potential interpretations
155
- - Include a mix of more specific, more general, and differently focused versions
156
-
157
- 3. Prompt Clustering:
158
- - Group the generated prompts into at least 5-7 thematic clusters
159
- - Identify the core themes or objectives represented by each cluster
160
-
161
- 4. Demonstration Generation:
162
- - For each cluster, outline how an AI might interpret and approach that prompt version
163
- - Include potential reasoning steps and areas of focus, without generating actual responses
164
-
165
- 5. Prompt Refinement:
166
- - Review the demonstration outlines and identify strengths and weaknesses of each prompt version
167
- - Refine each version, addressing potential misinterpretations and improving clarity
168
- - Ensure each refined version maintains the original intent while enhancing specificity or broadening scope as needed
169
- - Aim to create at least 7-10 refined versions
170
-
171
- 6. Cross-Pollination:
172
- - Identify effective elements from each refined version
173
- - Integrate these elements to create a synthesized, improved prompt
174
-
175
- 7. Final Prompt Synthesis:
176
- - Combine the most effective elements from all refined and synthesized versions
177
- - Construct a final, comprehensive prompt that captures the essence of the original while incorporating improvements from multiple refined versions
178
- - Ensure the final prompt is detailed, clear, and addresses multiple aspects identified in the refinement process
179
- - The final prompt should be substantially longer and more detailed than any individual refined prompt, typically 3-8 times the length of the original prompt
180
- - Include specific instructions, key areas to cover, and guidance on approach and structure
181
-
182
- Ensure each step of your process is thorough and well-documented in the JSON output. Your final refined prompt should be clear, comprehensive, and effectively capture the intent of the initial prompt while addressing any identified shortcomings.
183
-
184
- Initial prompt: [Insert initial prompt here]
185
-
186
- Please provide your response in the following JSON format, enclosed in <json> tags:
187
-
188
- <json>
189
- {
190
- "initial_prompt": "The original prompt provided",
191
- "initial_prompt_evaluation": "Your evaluation of the initial prompt with Strengths and Weaknesses in a string as bullet points format",
192
- "prompt_analysis": {
193
- "key_concepts": ["concept1", "concept2", "concept3", "..."],
194
- "objectives": "String describing the objectives",
195
- "constraints": "String describing any constraints",
196
- "prompt_type": "Type of prompt (e.g., task-oriented, creative, analytical)"
197
- },
198
- "expanded_prompts": [
199
- "First alternative prompt version",
200
- "Second alternative prompt version",
201
- "...",
202
- "Last alternative prompt version"
203
- ],
204
- "prompt_clusters": {
205
- "cluster1_name": [
206
- "First prompt in this cluster",
207
- "Second prompt in this cluster",
208
- "..."
209
- ],
210
- "cluster2_name": [
211
- "First prompt in this cluster",
212
- "Second prompt in this cluster",
213
- "..."
214
- ],
215
- "...": "Additional clusters if needed"
216
- },
217
- "demonstration_outlines": {
218
- "cluster1_name": "Approach outline for this cluster",
219
- "cluster2_name": "Approach outline for this cluster",
220
- "...": "Additional outlines if needed"
221
- },
222
- "list_of_prompts_refined": [
223
- "First refined prompt version",
224
- "Second refined prompt version",
225
- "...",
226
- "Last refined prompt version"
227
- ],
228
- "refined_prompt": "The final, synthesized prompt as a single string",
229
- "explanation_of_refinements": "Explanation of how the final prompt improves upon the initial one and Any potential limitations or considerations for the refined prompt as a single string"
230
- }
231
- </json>
232
- '''
233
 
234
  echo_prompt_refiner = '''You are an AI assistant implementing an advanced version of the ECHO (Enhanced Chain of Harmonized Optimization) method to refine an initial prompt into a more relevant, comprehensive, and effective one. Given an initial prompt, meticulously follow these steps:
235
 
@@ -337,7 +250,7 @@ Please provide your response in the following JSON format, enclosed in <json> ta
337
  "refined_prompt": "The final, synthesized prompt from prompts_refined as a single comprehensive string",
338
  "explanation_of_refinements": "Detailed explanation of techniques used, improvements made, and rationale behind the final synthesized prompt. Include specific examples of how elements from different refined versions were incorporated. Provide this explanation in a bullet-point format for clarity. Add
339
  discussion of any potential limitations or considerations for the refined prompt, including areas that may require further refinement or attention in future iterations.
340
- as as a single comprehensive string"
341
  }
342
  </json>
343
  '''
 
142
  </json>
143
  """
144
 
 
145
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
146
 
147
  echo_prompt_refiner = '''You are an AI assistant implementing an advanced version of the ECHO (Enhanced Chain of Harmonized Optimization) method to refine an initial prompt into a more relevant, comprehensive, and effective one. Given an initial prompt, meticulously follow these steps:
148
 
 
250
  "refined_prompt": "The final, synthesized prompt from prompts_refined as a single comprehensive string",
251
  "explanation_of_refinements": "Detailed explanation of techniques used, improvements made, and rationale behind the final synthesized prompt. Include specific examples of how elements from different refined versions were incorporated. Provide this explanation in a bullet-point format for clarity. Add
252
  discussion of any potential limitations or considerations for the refined prompt, including areas that may require further refinement or attention in future iterations.
253
+ as a single comprehensive string"
254
  }
255
  </json>
256
  '''