Spaces:
Sleeping
Sleeping
Update app.py
Browse files22 unmodified lines23242526272829303122 unmodified lines"""Generate a list of ingredients for the given food item using Google Gemini AI."""prompt = f"List the main ingredients typically used to prepare {food_name}:"response = palm.chat(messages=[{"content": prompt}])return response.last.strip() if response else "Could not generate ingredients."# Streamlit app setupst.title("Food Image Recognition with Ingredients")22 unmodified lines23242526272829303132333435363722 unmodified lines"""Generate a list of ingredients for the given food item using Google Gemini AI."""prompt = f"List the main ingredients typically used to prepare {food_name}."try:response = palm.generate_text(prompt=prompt)if response and "candidates" in response:return response["candidates"][0]["output"]else:return "No ingredients found."except Exception as e:return f"Error generating ingredients: {e}"# Streamlit app setupst.title("Food Image Recognition with Ingredients")
app.py+9-3