from fastapi import FastAPI from transformers import pipeline # NOTE - we configure docs_url to serve the interactive Docs at the root path # of the app. This way, we can use the docs as a landing page for the app on Spaces. app = FastAPI(docs_url="/") @app.get("/food") def food_endpoint(breed: str): """ Using the text2text-generation pipeline from `transformers`, generate text from the given input text. The model used is `google/flan-t5-small`, which can be found [here](https://huggingface.co/google/flan-t5-small). """ if breed == 'Australian Shepherd': return "1. For active Australian Shepherds, opt for dog food labeled for active breeds with higher protein, fat, and calories. 2. Prioritize quality animal-based protein for digestibility and essential amino acids. 3. Ensure moderate-to-high fat content to sustain your active Aussie's energy. 4. Include nutritious carbs like whole grains, veggies, and fruits for overall health and endurance." elif breed == 'Basset Hound': return "1. Prevent obesity: Opt for low-calorie dog food to maintain a healthy weight in Basset Hounds. 2. Support joints: Choose food with glucosamine and chondroitin for joint health. 3. Aid digestion: Pick easily digestible ingredients for a comfortable digestive system. 4. Tailor nutrition: Prioritize breed-specific diets for Basset Hounds' unique needs." elif breed == 'Bernedoodles': return "1. Opt for dog food with real meat as the main ingredient to provide essential nutrients. 2. Prioritize high-quality dog food rich in animal protein to support your Bernedoodle's energetic nature. 3. Ensure the inclusion of healthy fats, particularly omega-3 and omega-6 fatty acids, for their coat and overall well-being. 4. Select a formula that suits your Bernedoodle's life stage as their nutritional needs change with age." elif breed == 'Bichon Frise': return "1. Opt for limited ingredient dog food with novel proteins (fish, venison, duck, rabbit) for Bichons prone to allergies. 2. Ensure constant access to fresh water to prevent urolithiasis in your Bichon. 3. Be vigilant for allergy signs (skin irritation, digestive issues) and adjust their diet accordingly. 4. Regular vet check-ups help create a personalized diet plan to keep your Bichon healthy and allergy-free." elif breed == 'Boston Terrier': return "1. Enhance joint health with glucosamine and chondroitin being included in the diet. 2. Opt for animal-based proteins like chicken, turkey, or fish for muscle strength. 3. Be mindful of potential allergies in Boston Terriers and adjust the diet according to that. 4. Ensure a well-rounded diet to promote their overall health and well-being. Avoid diet containing more proportion of fillers." elif breed == 'Boxer': return "1. Opt for dog food rich in meat (like chicken, beef, or fish) to meet Boxers' protein requirements for their active lifestyle. 2. Steer clear of plant-based proteins as Boxers thrive on animal-derived protein sources. 3. Ensure your Boxer's weight is in check to prevent health issues; choose a formula that supports healthy weight management. 4. Approach grain-free options with care as some Boxers may be prone to taurine-related heart issues; consult a vet for dietary guidance." elif breed == 'Boykin Spaniel': return "1. For active Boykin Spaniels, pick food matching energy needs to prevent weight issues. 2. Prioritize balanced nutrition with proteins, fats, carbs, vitamins, and minerals. 3. Opt for animal-based proteins (chicken, beef, fish) for muscle health. 4. Choose quality ingredients, avoid fillers and artificial additives." elif breed == 'Cairn Terrier': return "1. Control calories: Choose proper food portions for your Cairn Terrier to maintain a healthy weight. 2. Omega-3 for coat: Feed fish oil or flaxseed for better skin and coat health. 3. Balanced diet: Ensure their food meets energy needs and provides essential nutrients. 4. Exercise: Keep them active for physical and mental well-being with ample amount of exercise." elif breed == 'Cane Corso': return "1. Since Cane Corsos have High-energy, larger size, watch portion sizes to avoid obesity. 2. Protein: Include 25-30% of protein for muscle health and active lifestyle. 3. Fat: 10-15% should be included for obtaining energy without excess calories. 4. Carbohydrates: Opt for whole grains or veggies to acquire nutrients and for better digestion to be included in the diet." elif breed == 'Catahoula Leopards': return "1. Pick medium-large breed dog food containing high protein for energy, taurine & vitamin A for eyes . 2. Choose quality animal proteins (chicken, beef, fish) for vitality and to fulfill protein requirement. 3. Bone health with balanced calcium/phosphorus and glucosamine/chondroitin. 4. Balanced nutrition for overall well-being of your pet should be considered." elif breed == 'Chihuahua': return "1. Puppies, adults, and seniors have unique nutritional requirements for their long-term health. 2. Chihuahua puppies require 1.0% arginine to support their rapid growth and development. 3. Adult Chihuahuas thrive on dog food with 0.51% arginine and a well-balanced combination of protein and calories. 4. Senior Chihuahuas benefit from dog food options that offer increased protein content and fewer calories." elif breed == 'Corgi': return "1. To ensure optimal health, make real animal-based proteins a dietary priority. 2. When selecting kibble, consider mouth size, ensuring it's comfortable for them to chew and digest their meals effectively. 3. Manage calorie intake and portion sizes to maintain their healthy weight and preventing overfeeding. 4. Enhance well-being by choosing dog food with added glucosamine and chondroitin for joint support." elif breed == 'Dachshund': return "1. Match Dachshund's food to their life stage (puppy, adult, or senior) for optimal nutrition. 2. Growing Dachshund puppies require 0.71% isoleucine and balanced nutrients. 3. Adult Dachshunds need 0.38% isoleucine and appropriate protein and calories. 4. Senior Dachshunds benefit from 50% more protein tailored to their age-specific needs. Choose the right nutrients!" elif breed == 'Doberman Pinscher': return "1. Prioritize joint health: Due to Doberman Pinschers' susceptibility to hip dysplasia, select a dog food rich in ingredients like glucosamine and chondroitin to support their joint health and mobility. 2. Opt for digestible ingredients: Choose a dog food that emphasizes easily digestible components, including high-quality proteins and fibers, to aid in efficient digestion and reduce the risk of digestive issues. 3. Avoid excessive fillers and additives: Steer clear of foods with excessive fillers or artificial additives, as these can lead to digestive problems and may not provide the necessary nutrition for your Doberman. 4. Emphasize animal-based proteins: Look for dog food that features high-quality animal-based proteins like chicken, turkey, or fish as the primary ingredients to ensure your Doberman receives the protein and nutrients they require for their muscular physique and overall well-being." elif breed == 'French Bulldog': return "1. Prioritize protein quality: Opt for dog foods featuring high-quality protein sources like chicken, beef, or fish as the main ingredient. Avoid options with excessive fillers like corn, soy, and wheat to ensure a nutritious diet for your French Bulldog. 2. Manage weight: Recognize the breed's susceptibility to obesity and select dog food with a moderate fat content. This can aid in weight management and overall health for your French Bulldog. 3. Support skin, coat, and joints: Look for dog food enriched with omega-3 fatty acids to promote healthy skin, a glossy coat, and joint health in your French Bulldog. 4. Consider kibble size: Choose dog food with small kibble size to prevent choking hazards and make mealtime more convenient and safe for your French Bulldog." elif breed == 'German Shepherd': return "1. Prioritize real meat as the main ingredient: Opt for dog foods featuring chicken, beef, or fish as the primary ingredient, providing essential protein sources for your German Shepherd. 2. Support joint health with glucosamine and chondroitin: German Shepherds are susceptible to hip and joint issues; select dog foods with added glucosamine and chondroitin to promote their joint well-being. 3. Seek omega-3 fatty acids: Look for omega-3s, often found in fish oil, as they can benefit your dog's coat and skin health, among other advantages. 4. Avoid excessive fillers like corn, soy, and wheat: To ensure your German Shepherd receives optimal nutrition, steer clear of dog foods containing excessive fillers and select options tailored to their specific life stage, be it puppy, adult, or senior." elif breed == 'Golden Retriever': return "1. Age-appropriate nutrition matters: Consider your golden retriever's age when selecting their food. While adults thrive on quality brands, it's crucial to choose the right food for puppies, as they face a higher risk of hip disease if their diet contains excessive calcium. 2. Specialized puppy food: Golden retriever puppies should consume a diet tailored for large breed puppies to reduce the risk of hip disease. These formulas are designed to support their growth without overloading them with excess calcium. 3. Avoid early switches: To minimize the risk of diet-related hip disease, refrain from transitioning your golden retriever puppy to an adult dog food too soon. Allow them to grow and develop properly on the appropriate puppy diet. 4. Prioritize your puppy's health: Your puppy's diet plays a significant role in their long-term well-being, so make informed choices to ensure they have the best chance for a healthy, happy life." elif breed == 'Goldendoodle': return "1. Tailored Nutrition for Goldendoodles: Goldendoodle puppies, adults, and seniors have distinct dietary requirements. It's essential to provide a diet that aligns with their specific life stages to ensure their health and well-being. 2. Puppy Nutrition for Hip Health: Goldendoodle puppies are at risk of developing hip disease if they consume excessive calcium during growth. To safeguard their joint health, it's crucial to offer a diet that is appropriately balanced in calcium content. 3. Adult Goldendoodle Diet: Adult goldendoodles need a balanced diet with moderate calcium levels and an appropriate balance of protein and calories to maintain their overall health and vitality. 4. Senior Goldendoodle Nutrition: Senior goldendoodles benefit from diets with increased protein content and reduced calorie intake to support their aging bodies while preventing excessive weight gain, which can strain their joints." elif breed == 'Havanese': return "1. Watch their weight: Havanese dogs are prone to obesity, so choose a dog food that meets their energy needs without excessive calories. This will help maintain a healthy weight and overall well-being. 2. Joint health matters: Due to their susceptibility to joint issues, like legg-calve-perthes disease and patella luxation, look for dog food containing glucosamine and chondroitin. These ingredients can support joint health and mobility. 3. Protein source is key: Opt for dog food with high-quality animal-based proteins as the main ingredients, such as chicken, turkey, or fish. This ensures they receive the essential nutrients they need for muscle and overall health. 4. Balance is essential: Strive for a balanced diet that meets their specific needs, considering their weight management, joint health, and protein sources to keep your Havanese happy and healthy." elif breed == 'Jack Russels': return "1. Consider life stage: Ensure your Jack Russell Terrier's food matches its age, whether it's a puppy, adult, or a senior dog. Tailoring the diet to the life stage provides the right nutrition for their changing needs. 2. Prioritize high-quality proteins: Jack Russell Terriers are active dogs, so opt for foods rich in animal-based proteins like chicken, turkey, or fish. These proteins provide essential nutrients for their energy and muscle maintenance. 3. Avoid heavy plant-based proteins: Choose dog foods that minimize plant-based protein sources in their ingredients. While some plant proteins are fine, animal-based proteins are crucial for your Jack Russell's well-being. 4. Seek beneficial fats: Look for recipes with omega-3 fatty acids from sources like fish oil or flaxseed. These fats promote a healthy coat and support your Jack Russell Terrier's overall health, ensuring they stay active and happy." elif breed == 'Labradoodle': return "1. Prioritize high-quality protein: Opt for dog food with main ingredients like chicken, beef, or fish to provide Labradoodles with essential amino acids for muscle and overall health. 2. Emphasize digestibility: Labradoodles may have sensitive stomachs, so choose easily digestible dog food to minimize the risk of digestive issues and promote overall well-being. 3. Quality carbohydrates: Look for formulas containing carbohydrates like sweet potatoes or brown rice to provide a steady source of energy and dietary fiber for proper digestion. 4. Support coat and skin health: Labradoodles often have curly coats, so select dog food with omega-3 fatty acids from sources like fish oil or flaxseed to help maintain their coat's health and overall skin condition." elif breed == 'Labrador Retrievers': return "1. Age-appropriate nutrition critical for Labs: Tailoring food to a Lab's age is crucial, especially due to their large breed size. Unlike adult Labs, puppies face a higher risk of hip disease if overexposed to excessive calcium in their diet. 2. Caution with adult Labs: Unlike puppies, adult Labs don't face the same risk related to breed size. However, it's still important to provide them with balanced nutrition suitable for their stage of life. 3. Prioritize puppy diet: For Lab puppies, avoiding an excess of calcium is paramount. This prevents the potential development of a debilitating and permanent form of hip disease, given their larger breed size. 4. Focus on lifelong health: Considering the specific dietary needs of Labs throughout their life stages contributes significantly to their overall health and well-being. This tailored approach ensures they receive the right nutrients at the right times." elif breed == 'Maltese': return "1. Balanced diet for Maltese dogs: Maltese dogs require a well-rounded diet with approximately 18-30% protein content to maintain their lean muscle mass and overall health. It's vital to choose a high-quality protein source for optimal nutrition. 2. Healthy fats for energy and coat health: Providing a moderate amount of healthy fats (around 8-20% of their diet) is important for Maltese dogs. These fats help support their energy levels and play a key role in maintaining their skin and coat health. 3. Watch portion control: Due to their small size and tendency to gain weight easily, Maltese dogs require careful portion control. Feeding them appropriate portion sizes is essential to prevent overeating and obesity, which can lead to various health issues. 4. Prioritize overall health: To ensure the well-being of your Maltese, focus on a balanced diet that considers their protein and fat needs while being mindful of portion sizes. This approach will help your Maltese stay healthy and maintain an ideal weight." elif breed == 'Miniature Schnauzer': return "1. Consider Kibble Size and Nutrient Balance: When choosing a dog food for Miniature Schnauzers, it's important to opt for kibble with a smaller size that suits their smaller mouths. Additionally, prioritize dog foods that provide a well-balanced mix of nutrients tailored to their specific needs, ensuring they get the right vitamins and minerals for overall health. 2. High-Quality Animal Proteins: Look for dog foods that list high-quality animal-based proteins like chicken, turkey, or fish as their main ingredients. These protein sources are not only delicious for Miniature Schnauzers but also provide essential amino acids to support their muscle development and overall well-being. 3. Weight Management: Miniature Schnauzers can be prone to weight gain, which can lead to health issues. To address this concern, select a dog food formulated to help them maintain a healthy body weight. Such foods often have controlled calorie levels and can aid in preventing obesity. 4. Dental Health and Skin Care: Miniature Schnauzers are known to have dental issues, so it's beneficial to choose a dog food that supports their dental health. These foods often contain ingredients that help reduce plaque and tartar buildup." elif breed == 'Pitbull': return "1. Prioritize Protein: Pitbulls are highly active dogs that need a substantial amount of protein in their diet. Aim for dog foods containing at least 20-30% protein, with high-quality sources like chicken, beef, or fish listed as the first ingredient. Adequate protein intake helps maintain their muscle mass and overall health. 2. Balanced Fats: To provide energy and support skin and coat health, it's essential to include a moderate amount of healthy fats in their diet, typically around 10-20%. These fats can come from sources like chicken fat, fish oil, or flaxseed, helping to ensure your Pitbull remains active and maintains a shiny, healthy coat. 3. Avoid Fillers: It's important to steer clear of dog foods that use fillers such as corn, wheat, and soy. These ingredients provide little nutritional value for your Pitbull and can lead to digestive issues or allergies. Opt for products that have a more substantial and protein-rich ingredient list. 4. Consult with a Vet: Every dog's nutritional needs can vary, and it's advisable to consult with a veterinarian to create a diet plan tailored to your Pitbull's specific requirements. They can provide guidance on portion sizes, special dietary considerations, and any potential allergies or sensitivities your dog may have." elif breed == 'Pomeranian': return "1. Choose dog food with real meat as the first ingredient, such as chicken, turkey, or lamb. Pomeranians thrive on a diet rich in high-quality protein, and real meat sources provide the essential amino acids they need for muscle maintenance and overall health. 2. Prioritize healthy fats like chicken fat or fish oil in your Pomeranian's diet to support their energy levels and maintain a shiny coat. These fats are excellent sources of omega-3 fatty acids, which are essential for skin and coat health. 3. Opt for small-sized kibbles if you're feeding your Pomeranian dry food. Their small mouths can struggle with larger kibbles, so choosing smaller ones makes it easier for them to chew and digest their food comfortably. 4. Ensure that your Pomeranian's diet is well-balanced and tailored to their specific needs, as their size and activity level can vary. Consulting with a veterinarian for personalized dietary recommendations is always a wise choice to ensure your Pomeranian's overall well-being." elif breed == 'Rottweiler': return "1. Prioritize High-Quality Animal Protein: When choosing a diet for your Rottweiler, it's essential to opt for dog foods with high-quality animal protein sources like chicken, beef, or fish listed at the top of the ingredient list. This ensures that your large breed gets the necessary protein for muscle maintenance and growth. 2. Include Healthy Fats: Rottweilers require healthy fats to maintain optimal skin and coat health. Look for dog foods that incorporate sources of omega-3 and omega-6 fatty acids, such as fish oil, flaxseed, or chicken fat. These fats support overall well-being and help prevent skin and coat issues. 3. Avoid Artificial Additives: To promote your Rottweiler's health, steer clear of dog foods containing artificial colors, flavors, or preservatives. These additives can lead to allergies or digestive problems. Instead, choose natural and minimally processed options for a safer and more nutritious diet. 4. Consult a Veterinarian: It's essential to consult with your veterinarian when selecting the best diet for your Rottweiler. They can provide personalized recommendations based on your dog's specific needs, age, and activity level, ensuring that your pet receives the most appropriate nutrition for a healthy and happy life." elif breed == 'Shiba Inu': return "1. Protein-Rich Ingredients: When selecting a dog food for your Shiba Inu, prioritize options that feature real animal-based protein sources as the primary ingredients. Opt for choices that include proteins like chicken, beef, fish, or lamb, as these are excellent sources of essential nutrients for your Shiba's health and vitality. 2. Appropriate Kibble Size: Considering the small to medium size of Shiba Inus, it's crucial to choose a dog food with kibble that matches their mouth size. Smaller kibble is easier for them to chew and digest, ensuring they can comfortably enjoy their meals. 3. Omega-3 Fatty Acids: Look for dog food that includes sources of omega-3 fatty acids, such as fish oil or flaxseed. These fatty acids are beneficial for your Shiba Inu's skin, coat, and overall health. Omega-3s can help reduce inflammation and support a glossy, healthy coat. 4. Balanced Nutritional Content: Ensure the dog food you choose provides a balanced nutritional profile, meeting the specific dietary needs of Shiba Inus. This means a well-rounded mix of protein, carbohydrates, vitamins, and minerals to keep your Shiba Inu active and thriving in good health." elif breed == 'Siberian Husky': return "1. Age-Appropriate Nutrition: The nutritional needs of huskies vary with their age. For adult huskies, a well-balanced, high-quality dog food is generally sufficient. However, it's crucial to pay special attention to the diet of husky puppies, as they have a 2.2% higher risk of developing a permanent form of hip disease. Feeding them a diet with excessive calcium content during their growth phase can exacerbate this risk. 2. Puppy Dietary Caution: Husky puppies require a careful balance of nutrients to support their growth. Providing a diet that matches their specific needs is essential to reduce the risk of hip problems. It's advisable to consult with a veterinarian or canine nutritionist to ensure the right calcium levels and other essential nutrients in their diet during this critical phase. 3. Senior Huskies' Dietary Requirements: As huskies age, their nutritional requirements change. Senior huskies generally need a diet with higher protein content and fewer calories compared to younger huskies. Adjusting their food to meet these requirements can help maintain their health and vitality as they enter their golden years. 4. Regular Veterinary Consultation: To ensure your husky's diet aligns with their age and health, it's important to have regular check-ups with a veterinarian. " elif breed == 'Weimaraners': return "1. Weimaraner dogs are susceptible to skeletal problems like hip dysplasia, so it's essential to select a dog food with the right balance of calcium and phosphorus to promote healthy bone development. Additionally, seek dog food recipes that include glucosamine and chondroitin to support joint health in these active dogs. 2. To maintain your Weimaraner's well-being, avoid strenuous exercise for at least an hour before and after meals. This precaution can help prevent issues like bloat, which is a potential concern in this breed due to their deep chest. 3. When choosing a diet for your Weimaraner, opt for formulations designed for large-sized breeds with high energy levels and exercise requirements. These dogs thrive on nutrition that provides the energy and nutrients needed to sustain their active lifestyle and maintain their overall health. 4. Keeping a close eye on your Weimaraner's diet and exercise routine is crucial for their long-term health and well-being. Providing the right nutrition and following proper mealtime practices can help your Weimaraner lead a healthy and happy life." elif breed == 'Vizsla': return "1. Importance of Glucosamine and Chondroitin: Vizslas are predisposed to skeletal issues like hip dysplasia, making it crucial to choose dog food recipes that include glucosamine and chondroitin. These compounds support joint health and can alleviate potential problems as your Vizsla ages. 2. Essential Healthy Fats: Healthy fats are a concentrated source of energy and play a vital role in maintaining a Vizsla's healthy coat and skin. Opt for dog food with moderate levels of omega-3 and omega-6 fatty acids, which are key components of a well-rounded canine diet. 3. High-Quality Animal Protein: Vizslas thrive on a diet rich in high-quality animal protein sources such as chicken, beef, or fish. Ensure that the dog food you select lists named meat protein sources at the top of the ingredient list to meet their protein needs, which contribute to their overall health and well-being. 4. Balanced Nutrient Profile: To keep your Vizsla in prime condition, aim for a dog food formula that offers a well-balanced nutrient profile, combining the mentioned components and avoiding excessive fillers or additives. This will help your Vizsla maintain optimal health, mobility, and a lustrous coat." elif breed == 'Yorkie': return "1. Age-Appropriate Nutrition: The best food for a Yorkie depends on their age and life stage. For puppies, it's crucial to choose a dog food with a higher leucine content, around 1.29%, to support their growth and development. In contrast, adult Yorkies require a lower leucine content, approximately 0.68%, to maintain their health and prevent excessive calorie intake. 2. Avoiding Nutritional Imbalance: Feeding an adult Yorkie food formulated for puppies can lead to problems like excess calcium, which may impact their bone development. Additionally, the higher protein and calorie content in puppy food can be detrimental for less active older dogs. Ensuring the right balance is vital for Yorkies at different life stages. 3. Senior Dog Considerations: Senior Yorkies have unique dietary needs. They benefit from dog food with increased protein content to support muscle maintenance and fewer calories to prevent weight gain, as older dogs are often less active. Choosing food specifically designed for seniors can help maintain their health and vitality. 4. Regular Check-Ups: Regardless of age, it's essential to consult with a veterinarian to determine the most appropriate food for your Yorkie. Regular check-ups and dietary adjustments as they age can ensure your furry companion receives the right nutrition to lead a happy and healthy life." else: return "Nutritional info currently not available for your breed. Will be updated soon!"