Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -22,18 +22,19 @@ Evaluate based on the following criteria:
|
|
| 22 |
- Intent (1-5)
|
| 23 |
Also include a suggestion for improving the prompt.
|
| 24 |
Respond ONLY in this JSON format:
|
| 25 |
-
{
|
| 26 |
"prompt": "...",
|
| 27 |
-
"evaluation": {
|
| 28 |
"Clarity": ...,
|
| 29 |
"Context": ...,
|
| 30 |
"Specificity": ...,
|
| 31 |
"Intent": ...,
|
| 32 |
"suggestion": "..."
|
| 33 |
-
}
|
| 34 |
-
}
|
| 35 |
"""
|
| 36 |
|
|
|
|
| 37 |
def evaluate_prompt(user_prompt):
|
| 38 |
# Format the input prompt by inserting the user_prompt dynamically
|
| 39 |
formatted_prompt = PROMPT_TEMPLATE.format(user_prompt=user_prompt)
|
|
|
|
| 22 |
- Intent (1-5)
|
| 23 |
Also include a suggestion for improving the prompt.
|
| 24 |
Respond ONLY in this JSON format:
|
| 25 |
+
{{
|
| 26 |
"prompt": "...",
|
| 27 |
+
"evaluation": {{
|
| 28 |
"Clarity": ...,
|
| 29 |
"Context": ...,
|
| 30 |
"Specificity": ...,
|
| 31 |
"Intent": ...,
|
| 32 |
"suggestion": "..."
|
| 33 |
+
}}
|
| 34 |
+
}}
|
| 35 |
"""
|
| 36 |
|
| 37 |
+
|
| 38 |
def evaluate_prompt(user_prompt):
|
| 39 |
# Format the input prompt by inserting the user_prompt dynamically
|
| 40 |
formatted_prompt = PROMPT_TEMPLATE.format(user_prompt=user_prompt)
|