Kunal commited on
Commit ·
22fd7fd
1
Parent(s): c40fc50
updated prompt for better results
Browse files
Agent.py
CHANGED
|
@@ -203,10 +203,26 @@ 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
|
|
|
|
|
|
|
| 207 |
|
| 208 |
-
|
| 209 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 210 |
|
| 211 |
Consider these factors:
|
| 212 |
1. Carbon emissions intensity
|
|
@@ -218,13 +234,13 @@ def generate_environmental_score(state: EnvironmentalAnalysisState):
|
|
| 218 |
|
| 219 |
Here are some examples of products and their potential scores to guide your assessment, aiming for higher scores where appropriate:
|
| 220 |
|
| 221 |
-
|
| 222 |
-
|
| 223 |
-
|
| 224 |
|
| 225 |
Provide:
|
| 226 |
-
|
| 227 |
-
|
| 228 |
""")
|
| 229 |
|
| 230 |
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).
|
| 207 |
+
|
| 208 |
+
Aim to score products fairly, recognizing positive efforts and current industry sustainability trends. Be **generous where any notable sustainable practices are observed**, reflecting a positive outlook on efforts towards environmental responsibility. Focus on a **broader assessment rather than scrutinizing every minor detail**, aiming for an overall, balanced sustainability score.
|
| 209 |
|
| 210 |
+
Product Data: {extracted_data}
|
| 211 |
+
Carbon Footprint: {carbon_footprint} kg CO2e
|
| 212 |
+
|
| 213 |
+
Scoring Guide:
|
| 214 |
+
- 90-100 (Excellent/Leader): Demonstrates exceptional environmental stewardship, innovative green practices, and minimal negative impact across all factors. A true leader in sustainability.
|
| 215 |
+
- 70-89 (Good/Above Average): Shows strong environmental practices with notable positive attributes and efforts to reduce impact. Generally a good choice for sustainability.
|
| 216 |
+
- 40-69 (Average/Acceptable): Meets basic environmental considerations but has significant areas for improvement. Represents typical industry practices without outstanding sustainable features.
|
| 217 |
+
- 0-39 (Poor/Concerning): Significant environmental concerns, unsustainable practices, or a clear lack of attention to environmental impact.
|
| 218 |
+
|
| 219 |
+
Examples to guide scoring perspective:
|
| 220 |
+
- Product: "Electronic smartphone with aluminum body, manufactured in China, typical global distribution for sales in Europe."
|
| 221 |
+
Typical Score Range: 50-65 (Reasonable for modern electronics with some recyclable components and efforts, but significant global transport, energy consumption during use, and complex end-of-life disposal.)
|
| 222 |
+
- Product: "Local handmade wooden furniture using sustainably harvested, certified wood, finished with non-toxic oil, sold within 50km of production."
|
| 223 |
+
Typical Score Range: 85-95 (Excellent material choice, minimal transport, durable product designed for longevity, non-toxic finish, often supports local economy.)
|
| 224 |
+
- Product: "Single-use disposable coffee cup made from virgin paper with a plastic lining, widely distributed via international shipping."
|
| 225 |
+
Typical Score Range: 20-35 (Poor due to single-use nature, material composite making recycling difficult, high transport, and significant waste contribution.)
|
| 226 |
|
| 227 |
Consider these factors:
|
| 228 |
1. Carbon emissions intensity
|
|
|
|
| 234 |
|
| 235 |
Here are some examples of products and their potential scores to guide your assessment, aiming for higher scores where appropriate:
|
| 236 |
|
| 237 |
+
- "Electronic smartphone with aluminum body, manufactured in China": Likely score in the range of 50-65. While it has some recyclable materials, manufacturing and transportation in a global supply chain contribute to a moderate footprint.
|
| 238 |
+
- "Local handmade wooden furniture using sustainable forest wood": Likely score in the range of 85-95. This product benefits from local production, renewable resources, and often a longer lifespan.
|
| 239 |
+
- "Single-use plastic water bottle produced with virgin plastics": Likely score in the range of 10-25. High environmental impact due to non-renewable materials, single-use nature, and pollution potential.
|
| 240 |
|
| 241 |
Provide:
|
| 242 |
+
- Overall score (0-100, where 100 is most sustainable and 0 is least sustainable)
|
| 243 |
+
- Improvement recommendations
|
| 244 |
""")
|
| 245 |
|
| 246 |
rendered_prompt_content = scoring_prompt.format(
|