Kunal commited on
Commit
2732537
·
1 Parent(s): 29dcb75

updated prompt for better results

Browse files
Files changed (1) hide show
  1. Agent.py +24 -22
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), 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(
 
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(