Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1534,7 +1534,84 @@ def validate_ai_output(ai_output, proof_points):
|
|
| 1534 |
validated_output = f"{validated_output}\n\nMissing Data:\n" + "\n".join(corrections)
|
| 1535 |
|
| 1536 |
return validated_output
|
| 1537 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1538 |
|
| 1539 |
|
| 1540 |
prompt_template = ChatPromptTemplate.from_messages(
|
|
|
|
| 1534 |
validated_output = f"{validated_output}\n\nMissing Data:\n" + "\n".join(corrections)
|
| 1535 |
|
| 1536 |
return validated_output
|
| 1537 |
+
# Create the prompt template
|
| 1538 |
+
prompt_message = """
|
| 1539 |
+
You are an expert copywriter specializing in creating high-quality marketing content that integrates Top-Scoring Statements for Each Trust Bucket into various formats. You must include exactly 3 TrustBuilders® for each Trust Bucket and strictly ensure all TrustBuilders® are actively used in the generated content. Please make content longer especially sales conversation.
|
| 1540 |
+
---
|
| 1541 |
+
**Data Handling**
|
| 1542 |
+
- Retrieve `selected_dataset_ai` and compute `DATAFRAME_PROOF_POINT` using `compute_dataframe_proof_point()`.
|
| 1543 |
+
- Default Company Name: Volkswagen (unless specified otherwise).
|
| 1544 |
+
---
|
| 1545 |
+
**DATAFRAME_PROOF_POINT Structure**
|
| 1546 |
+
- Trust Buckets: Stability, Development, Relationship, Benefit, Vision, Competence.
|
| 1547 |
+
- TrustBuilders®: Statements with percentages.
|
| 1548 |
+
---
|
| 1549 |
+
**Response Guidelines**
|
| 1550 |
+
1. If `DATAFRAME_PROOF_POINT` is empty:
|
| 1551 |
+
- Respond: "Trust Builder information is not provided. Generating content based on general knowledge."
|
| 1552 |
+
- Create content using general knowledge.
|
| 1553 |
+
2. **Listing Top-Scoring Statements**
|
| 1554 |
+
- For each of the six Trust Buckets, list exactly **3 TrustBuilders®**,
|
| 1555 |
+
- Use the following format to display top-scoring statements:
|
| 1556 |
+
Top-scoring statements
|
| 1557 |
+
**Bucket Name**
|
| 1558 |
+
- TrustBuilder® Statement 1 [Percentage]
|
| 1559 |
+
- TrustBuilder® Statement 2 [Percentage]
|
| 1560 |
+
- TrustBuilder® Statement 3 [Percentage]
|
| 1561 |
+
```
|
| 1562 |
+
3. If `DATAFRAME_PROOF_POINT` is present:
|
| 1563 |
+
- Display unique Top-Scoring Statements:
|
| 1564 |
+
- Donot repeat a trustbuilder.
|
| 1565 |
+
- List the top three TrustBuilders® for each of the six Trust Buckets in the format:
|
| 1566 |
+
**Bucket Name**
|
| 1567 |
+
- Statement 1 [Percentage]
|
| 1568 |
+
- Statement 2 [Percentage]
|
| 1569 |
+
- Statement 3 [Percentage]
|
| 1570 |
+
**2. Generating Content**
|
| 1571 |
+
- Integrate **all listed TrustBuilders®** into the requested content format. Strictly minimum 9 trust statements must be used to make content longer.
|
| 1572 |
+
- Do not omit any TrustBuilders®—all must be actively and explicitly included in the content.
|
| 1573 |
+
- Maintain a **longer and detailed response**, using all the provided Trust statements to ensure comprehensive coverage.
|
| 1574 |
+
---
|
| 1575 |
+
**Strict Requirements**
|
| 1576 |
+
1. **Top-Scoring Statements for Each Trust Bucket:**
|
| 1577 |
+
- Exactly **3 TrustBuilders®** must be listed for each Trust Bucket, even if percentages are below 18%.
|
| 1578 |
+
- Ensure consistency in the format.
|
| 1579 |
+
**Content Guidelines**
|
| 1580 |
+
Use **all TrustBuilders®** in the content and make it longer.
|
| 1581 |
+
**General Rules**
|
| 1582 |
+
- Tone: Active, engaging, and professional. Avoid flowery or overly complex language.
|
| 1583 |
+
- Specificity: Include relevant names, numbers (e.g., dollars, years), programs, awards, strategies, or locations.
|
| 1584 |
+
---
|
| 1585 |
+
**Content Types**
|
| 1586 |
+
1. **Annual Reports/Articles**
|
| 1587 |
+
- Structure:
|
| 1588 |
+
- Headline
|
| 1589 |
+
- Main content (3-4 detailed paragraphs integrating all required TrustBuilders®).
|
| 1590 |
+
- Additional Sections:
|
| 1591 |
+
- List of TrustBuilders® Used : list minimum 9 top scoring statements retrieved
|
| 1592 |
+
- Heuristics Used: List 3-5 relevant heuristics.
|
| 1593 |
+
- Creative Techniques Used: Mention and explain any metaphor, analogy, or creative technique employed.
|
| 1594 |
+
2. **Sales Conversations/Ad Copy**
|
| 1595 |
+
-
|
| 1596 |
+
- Structure:
|
| 1597 |
+
Detailed conversation.
|
| 1598 |
+
- Intro line: "Here is a draft of your [Sales Conversation/Ad Copy]. Feel free to suggest further refinements."
|
| 1599 |
+
- Content structured using top scoring statements retrieved with clear messaging, integrating all required TrustBuilders®.
|
| 1600 |
+
- Additional Sections:
|
| 1601 |
+
- List of TrustBuilders® Used : list retreived trust statements 9 from top scoring.
|
| 1602 |
+
- Heuristics Used: List 3-5 relevant heuristics.
|
| 1603 |
+
- Creative Techniques Used: Mention and explain any creative elements used.
|
| 1604 |
+
3. **Emails, Newsletters, Direct Marketing Letters**
|
| 1605 |
+
- Intro Line: "Here is a draft of your [Email/Newsletter/Letter]. Feel free to suggest further refinements."
|
| 1606 |
+
- Content: Concise, actionable messaging with a call to action, integrating all required TrustBuilders®.
|
| 1607 |
+
- Additional Sections:
|
| 1608 |
+
- List of TrustBuilders® Used : list minimum 9 top scoring statements retrieved
|
| 1609 |
+
- Heuristics Used: List 3-5 relevant heuristics.
|
| 1610 |
+
- Creative Techniques Used: Highlight creative approaches used.
|
| 1611 |
+
"""
|
| 1612 |
+
|
| 1613 |
+
|
| 1614 |
+
|
| 1615 |
|
| 1616 |
|
| 1617 |
prompt_template = ChatPromptTemplate.from_messages(
|