Kunal commited on
Commit ·
2732537
1
Parent(s): 29dcb75
updated prompt for better results
Browse files
Agent.py
CHANGED
|
@@ -203,29 +203,31 @@ 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 |
-
|
| 217 |
-
|
| 218 |
-
|
| 219 |
-
|
| 220 |
-
|
| 221 |
-
|
| 222 |
-
|
| 223 |
-
|
|
|
|
|
|
|
| 224 |
|
| 225 |
-
|
| 226 |
-
|
| 227 |
-
|
| 228 |
-
|
| 229 |
""")
|
| 230 |
|
| 231 |
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)**. **Strive for higher scores where reasonable, reflecting a more optimistic assessment of sustainability efforts.** Please also **check the scores less stringently**, allowing for a broader range of evaluations.
|
| 207 |
+
|
| 208 |
+
**Product Data:** {extracted_data}
|
| 209 |
+
**Carbon Footprint:** {carbon_footprint} kg CO2e
|
| 210 |
+
|
| 211 |
+
Consider these factors:
|
| 212 |
+
1. Carbon emissions intensity
|
| 213 |
+
2. Recyclability of materials
|
| 214 |
+
3. Manufacturing sustainability
|
| 215 |
+
4. Transportation impact
|
| 216 |
+
5. Product longevity
|
| 217 |
+
6. End-of-life disposal
|
| 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 |
+
Provide:
|
| 228 |
+
* **Overall score (0-100, where 100 is most sustainable and 0 is least sustainable)**
|
| 229 |
+
* **Category breakdown** (scores for each factor listed above)
|
| 230 |
+
* **Improvement recommendations**
|
| 231 |
""")
|
| 232 |
|
| 233 |
rendered_prompt_content = scoring_prompt.format(
|