Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -25,6 +25,8 @@ def get_recycling_suggestions_from_groq(item, quantity):
|
|
25 |
f"You are an expert in recycling and sustainability. "
|
26 |
f"Suggest profitable and eco-friendly uses for {quantity} kg of {item}, "
|
27 |
f"including household uses, ways to monetize them, and calculate carbon footprint reduction."
|
|
|
|
|
28 |
)
|
29 |
chat_completion = client.chat.completions.create(
|
30 |
messages=[{"role": "user", "content": prompt}],
|
@@ -34,7 +36,7 @@ def get_recycling_suggestions_from_groq(item, quantity):
|
|
34 |
return chat_completion.choices[0].message.content
|
35 |
|
36 |
# App title
|
37 |
-
st.title("β»οΈ Recycle
|
38 |
st.write("Select clutter items, specify quantities, and get tailored, profitable recycling suggestions along with carbon footprint reduction scores!")
|
39 |
|
40 |
# Multi-select input for clutter items
|
@@ -79,15 +81,15 @@ if st.button("Get Recycling Suggestions"):
|
|
79 |
|
80 |
# Follow-up Q&A with Groq LLM
|
81 |
st.write("### π€ Have more questions about recycling?")
|
82 |
-
user_query = st.text_input("Ask
|
83 |
-
if st.button("Ask
|
84 |
if user_query:
|
85 |
follow_up_response = client.chat.completions.create(
|
86 |
messages=[{"role": "user", "content": user_query}],
|
87 |
model="llama-3.3-70b-versatile",
|
88 |
stream=False,
|
89 |
).choices[0].message.content
|
90 |
-
st.write("### π§
|
91 |
st.write(follow_up_response)
|
92 |
else:
|
93 |
st.error("Please enter a question.")
|
|
|
25 |
f"You are an expert in recycling and sustainability. "
|
26 |
f"Suggest profitable and eco-friendly uses for {quantity} kg of {item}, "
|
27 |
f"including household uses, ways to monetize them, and calculate carbon footprint reduction."
|
28 |
+
f"Keep your responce to maximum 5 points."
|
29 |
+
f"add emojis in your responce."
|
30 |
)
|
31 |
chat_completion = client.chat.completions.create(
|
32 |
messages=[{"role": "user", "content": prompt}],
|
|
|
36 |
return chat_completion.choices[0].message.content
|
37 |
|
38 |
# App title
|
39 |
+
st.title("β»οΈ Recycle-Smart-PK powered by LLM π")
|
40 |
st.write("Select clutter items, specify quantities, and get tailored, profitable recycling suggestions along with carbon footprint reduction scores!")
|
41 |
|
42 |
# Multi-select input for clutter items
|
|
|
81 |
|
82 |
# Follow-up Q&A with Groq LLM
|
83 |
st.write("### π€ Have more questions about recycling?")
|
84 |
+
user_query = st.text_input("Ask me about recycling:")
|
85 |
+
if st.button("Ask and you will learn"):
|
86 |
if user_query:
|
87 |
follow_up_response = client.chat.completions.create(
|
88 |
messages=[{"role": "user", "content": user_query}],
|
89 |
model="llama-3.3-70b-versatile",
|
90 |
stream=False,
|
91 |
).choices[0].message.content
|
92 |
+
st.write("### π§ LLM's Answer: Tailored for you")
|
93 |
st.write(follow_up_response)
|
94 |
else:
|
95 |
st.error("Please enter a question.")
|