Kunal commited on
Commit ·
29dcb75
1
Parent(s): 0411209
updated prompt for better results
Browse files
Agent.py
CHANGED
|
@@ -203,23 +203,29 @@ def calculate_carbon_footprint(state: EnvironmentalAnalysisState):
|
|
| 203 |
|
| 204 |
def generate_environmental_score(state: EnvironmentalAnalysisState):
|
| 205 |
scoring_prompt = ChatPromptTemplate.from_template("""
|
| 206 |
-
Based on the following environmental data, generate a comprehensive environmental score (0-100)
|
| 207 |
|
| 208 |
Product Data: {extracted_data}
|
| 209 |
Carbon Footprint: {carbon_footprint} kg CO2e
|
| 210 |
|
| 211 |
-
|
| 212 |
-
|
| 213 |
-
|
| 214 |
-
|
| 215 |
-
|
| 216 |
-
5. Product longevity
|
| 217 |
-
6. End-of-life disposal
|
| 218 |
|
| 219 |
-
|
| 220 |
-
|
| 221 |
-
-
|
| 222 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 223 |
""")
|
| 224 |
|
| 225 |
rendered_prompt_content = scoring_prompt.format(
|
|
|
|
| 203 |
|
| 204 |
def generate_environmental_score(state: EnvironmentalAnalysisState):
|
| 205 |
scoring_prompt = ChatPromptTemplate.from_template("""
|
| 206 |
+
Based on the following environmental data, generate a comprehensive environmental score (0-100), aiming to reflect the product's commitment to sustainability.
|
| 207 |
|
| 208 |
Product Data: {extracted_data}
|
| 209 |
Carbon Footprint: {carbon_footprint} kg CO2e
|
| 210 |
|
| 211 |
+
**Scoring Guide:**
|
| 212 |
+
* **90-100 (Excellent/Leader):** Demonstrates exceptional environmental stewardship, innovative green practices, and minimal negative impact across all factors. A true leader in sustainability.
|
| 213 |
+
* **70-89 (Good/Above Average):** Shows strong environmental practices with notable positive attributes and efforts to reduce impact. Generally a good choice for sustainability.
|
| 214 |
+
* **40-69 (Average/Acceptable):** Meets basic environmental considerations but has significant areas for improvement. Represents typical industry practices without outstanding sustainable features.
|
| 215 |
+
* **0-39 (Poor/Concerning):** Significant environmental concerns, unsustainable practices, or a clear lack of attention to environmental impact.
|
|
|
|
|
|
|
| 216 |
|
| 217 |
+
**Consider these factors, focusing on identifying and rewarding positive environmental performance:**
|
| 218 |
+
1. **Carbon Emissions Intensity:** Evaluate how effectively greenhouse gas emissions are minimized throughout the product's lifecycle (from raw materials to disposal).
|
| 219 |
+
2. **Material Sustainability:** Assess the use of recycled, renewable, non-toxic, or sustainably sourced materials, and the efforts to reduce reliance on virgin resources.
|
| 220 |
+
3. **Manufacturing Practices:** Examine the adoption of clean production methods, energy efficiency, water conservation, and waste reduction during the manufacturing process.
|
| 221 |
+
4. **Supply Chain & Transportation Impact:** Analyze the efficiency and environmental footprint of sourcing raw materials and delivering the finished product (e.g., local sourcing, optimized logistics).
|
| 222 |
+
5. **Product Durability & Longevity:** Determine if the product is designed for an extended lifespan, repairability, and reusability, thereby reducing premature obsolescence.
|
| 223 |
+
6. **End-of-Life Management:** Review the effectiveness of strategies for recycling, composting, safe disposal, or circular economy integration once the product's useful life ends.
|
| 224 |
+
|
| 225 |
+
**Provide:**
|
| 226 |
+
- **Overall Score (0-100):** State the numerical score clearly.
|
| 227 |
+
- **Justification:** Explain the score by highlighting the product's **strengths and positive environmental attributes** that contributed to its rating. Also mention any significant weaknesses where applicable.
|
| 228 |
+
- **Improvement Recommendations:** Offer specific, actionable suggestions for how the product's environmental impact could be further reduced and its sustainability enhanced.
|
| 229 |
""")
|
| 230 |
|
| 231 |
rendered_prompt_content = scoring_prompt.format(
|