From 6eeb74e831e22f78d8a0d2303852829f6225a8e4 Mon Sep 17 00:00:00 2001 From: Marina Coelho Date: Tue, 11 Aug 2026 13:26:34 +0100 Subject: [PATCH 01/10] Create prompt-templates.md --- prompt-templates.md | 123 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 123 insertions(+) create mode 100644 prompt-templates.md diff --git a/prompt-templates.md b/prompt-templates.md new file mode 100644 index 0000000..01d758e --- /dev/null +++ b/prompt-templates.md @@ -0,0 +1,123 @@ +# FriendlyMeals – Prompt Templates + +Below you find all the [prompt templates](https://firebase.google.com/docs/ai-logic/server-prompt-templates/get-started) that you need to create in your Firebase project before you can run FriendlyMeals. + +Please note that the model names below might not be the most up to date ones. Refer to the [Firebase AI Logic documentation](https://firebase.google.com/docs/ai-logic/models) to check the latest available models. + +Don't forget to test your templates in the Firebase console before you use them in your apps. [Read the docs](https://firebase.google.com/docs/ai-logic/server-prompt-templates/get-started?api=dev#test-template) to learn how to test your templates properly. + +## Generate Ingredients Template + +This prompt template is used when the user takes a photo of their fridge or cupboard to identify the ingredients in it. + +**Configuration (frontmatter)** + + model: "gemini-3.5-flash-lite" + +**Prompt and (optional) system instructions** + + Please analyze this image: {{media type="mimeType" data="imageData"}}, and list all visible food ingredients. + Output ONLY a comma-separated list of ingredients. Do not include any introductory text, headers, or concluding remarks. + Provide the raw list only. Be specific with measurements where possible. + +## Generate Recipe Template + +This prompt template is used when the user generates a recipe from a list of ingredients and notes. + +**Configuration (frontmatter)** + + model: "gemini-3.5-flash-lite" + input: + schema: + ingredients: "string, the ingredients list" + notes?: "string, cuisine and dietary notes" + output: + format: json + schema: + title: string + instructions: string + ingredients(array, ingredients for recipe): string + prepTime: string + cookTime: string + servings: string + tags(array, relevant tags for recipe): string + +**Prompt and (optional) system instructions** + + {{role "user"}} + Create a detailed recipe based on these ingredients: {{ingredients}}. + + Format requirements: + - 'instructions': Provide the cooking steps as a clear list of instructions separated by newlines. Use bold formatting on the step numbers. Use Markdown. + - 'ingredients': List all necessary items, including quantities. + - 'prepTime', 'cookTime', 'servings': Short strings (e.g., "15 mins"). + - 'tags': Generate a list of 3-5 relevant category tags (e.g., "Healthy", "Vegan", "Gluten-Free", "Dessert", "Quick"). + + {{#if notes}} + IMPORTANT CUISINE AND DIETARY NOTES: {{notes}} + {{/if}} + +## Generate Recipe Photo Template + +This prompt template is used when the user generates a recipe photo from the recipe title. + +**Configuration (frontmatter)** + + model: "gemini-3.1-flash-image" + input: + schema: + recipeTitle: "string" + +**Prompt and (optional) system instructions** + + A professional food photography shot of this recipe: {{recipeTitle}}. + Style: High-end food photography, restaurant-quality plating, soft natural lighting, on a clean background, showing the complete plated dish. + +## Scan Meal Template + +This prompt template is used when the user scans a meal to extract the nutritional facts. + +**Configuration (frontmatter)** + + model: "gemini-3.5-flash-lite" + output: + format: json + schema: + protein: string + fat: string + carbs: string + sugar: string + ingredients(array, ingredients in the meal): string + +**Prompt and (optional) system instructions** + + Analyze this image of a meal: {{media type="mimeType" data="imageData"}}, and estimate the nutritional content. + Return the result in JSON format matching the schema: + - protein, fat, carbs, sugar (strings with units, e.g., '20g') + - ingredients (list of strings) + +## Find Stores Template + +This prompt template is used when the user needs to find stores that sell the ingredients they need. + +**Configuration (frontmatter)** + + model: "gemini-3.5-flash-lite" + tools: + - googleMaps + input: + schema: + ingredients: "string, the ingredients in the shopping list" + dayOfWeek: "string, current day of the week" + currentTime: "string, current time of the day" + +**Prompt and (optional) system instructions** + + What are the nearest grocery stores or markets near me that stock these ingredients: {{ingredients}}? + For each place, tell me their business hours, if it's open right now on {{dayOfWeek}} at {{currentTime}}, and if it's closing in less than 30 minutes. + Tell me what the parking situation is like at each place: is there a dedicated lot or should I look for street parking? + Tell the Map URL so I can open it in Google Maps. + Format your response strictly as a JSON object with a "stores" array containing store objects. + Each store object must have these EXACT keys: "name": string, "address": string, "distance": string, "openNow": boolean, "closingSoon": boolean, "hasParking": boolean, "parkingDetails": string, "mapUrl": string. + Do NOT include markdown code block formatting (like ```json). Output only the raw JSON string. + From a2c41d89a8609f750bb4e3f2bfa8c6a4b998c4a7 Mon Sep 17 00:00:00 2001 From: Marina Coelho Date: Tue, 11 Aug 2026 13:41:54 +0100 Subject: [PATCH 02/10] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9aade05..6ffefdb 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ Welcome to **FriendlyMeals**, an app that demonstrates how to integrate Firebase 1. **Enable Firebase services in the Firebase console** - Go to the [**Firebase Authentication**](https://console.firebase.google.com/project/_/authentication/?useAutoProject=true) section of the console, enable the service and choose the Anonymous authentication method. - Go to the [**Firestore**](https://console.firebase.google.com/project/_/firestore/?useAutoProject=true) section of the console and enable Firestore Enterprise edition. - - Go to the [**Firebase AI Logic**](https://console.firebase.google.com/project/_/ailogic/?useAutoProject=true) section of the console and enable the Gemini Developer API. + - Go to the [**Firebase AI Logic**](https://console.firebase.google.com/project/_/ailogic/?useAutoProject=true) section of the console and enable the Gemini Developer API. You will also need to go to the [Prompt templates tab](https://console.firebase.google.com/project/_/ailogic/templates/?useAutoProject=true) and create the prompt templates that will be fetched by the Android app. You can find the Prompt templates [inside the prompts folder](https://github.com/FirebaseExtended/FriendlyMeals-Android/tree/main/prompts). - Go to the [**App Check**](https://console.firebase.google.com/project/_/appcheck/?useAutoProject=true) section of the console, enable this service, and register your Android app using the Play Integrity provider (you'll need to provide the SHA-256 fingerprint of your app's signing certificate). - Go to the [**Remote Config**](https://console.firebase.google.com/project/_/config/?useAutoProject=true) section of the console and enable this service. - Go to the [**Firebase Storage**](https://console.firebase.google.com/project/_/storage/?useAutoProject=true) section of the console and enable this service (you'll need to set up a billing account since this service is only available on the Blaze plan). From dc1c309288ab3920fa4480896eac9d262d8fbbe2 Mon Sep 17 00:00:00 2001 From: Marina Coelho Date: Tue, 11 Aug 2026 13:50:29 +0100 Subject: [PATCH 03/10] Create prompts folder --- prompts/prompt-templates.md | 123 ++++++++++++++++++++++++++++++++++++ 1 file changed, 123 insertions(+) create mode 100644 prompts/prompt-templates.md diff --git a/prompts/prompt-templates.md b/prompts/prompt-templates.md new file mode 100644 index 0000000..01d758e --- /dev/null +++ b/prompts/prompt-templates.md @@ -0,0 +1,123 @@ +# FriendlyMeals – Prompt Templates + +Below you find all the [prompt templates](https://firebase.google.com/docs/ai-logic/server-prompt-templates/get-started) that you need to create in your Firebase project before you can run FriendlyMeals. + +Please note that the model names below might not be the most up to date ones. Refer to the [Firebase AI Logic documentation](https://firebase.google.com/docs/ai-logic/models) to check the latest available models. + +Don't forget to test your templates in the Firebase console before you use them in your apps. [Read the docs](https://firebase.google.com/docs/ai-logic/server-prompt-templates/get-started?api=dev#test-template) to learn how to test your templates properly. + +## Generate Ingredients Template + +This prompt template is used when the user takes a photo of their fridge or cupboard to identify the ingredients in it. + +**Configuration (frontmatter)** + + model: "gemini-3.5-flash-lite" + +**Prompt and (optional) system instructions** + + Please analyze this image: {{media type="mimeType" data="imageData"}}, and list all visible food ingredients. + Output ONLY a comma-separated list of ingredients. Do not include any introductory text, headers, or concluding remarks. + Provide the raw list only. Be specific with measurements where possible. + +## Generate Recipe Template + +This prompt template is used when the user generates a recipe from a list of ingredients and notes. + +**Configuration (frontmatter)** + + model: "gemini-3.5-flash-lite" + input: + schema: + ingredients: "string, the ingredients list" + notes?: "string, cuisine and dietary notes" + output: + format: json + schema: + title: string + instructions: string + ingredients(array, ingredients for recipe): string + prepTime: string + cookTime: string + servings: string + tags(array, relevant tags for recipe): string + +**Prompt and (optional) system instructions** + + {{role "user"}} + Create a detailed recipe based on these ingredients: {{ingredients}}. + + Format requirements: + - 'instructions': Provide the cooking steps as a clear list of instructions separated by newlines. Use bold formatting on the step numbers. Use Markdown. + - 'ingredients': List all necessary items, including quantities. + - 'prepTime', 'cookTime', 'servings': Short strings (e.g., "15 mins"). + - 'tags': Generate a list of 3-5 relevant category tags (e.g., "Healthy", "Vegan", "Gluten-Free", "Dessert", "Quick"). + + {{#if notes}} + IMPORTANT CUISINE AND DIETARY NOTES: {{notes}} + {{/if}} + +## Generate Recipe Photo Template + +This prompt template is used when the user generates a recipe photo from the recipe title. + +**Configuration (frontmatter)** + + model: "gemini-3.1-flash-image" + input: + schema: + recipeTitle: "string" + +**Prompt and (optional) system instructions** + + A professional food photography shot of this recipe: {{recipeTitle}}. + Style: High-end food photography, restaurant-quality plating, soft natural lighting, on a clean background, showing the complete plated dish. + +## Scan Meal Template + +This prompt template is used when the user scans a meal to extract the nutritional facts. + +**Configuration (frontmatter)** + + model: "gemini-3.5-flash-lite" + output: + format: json + schema: + protein: string + fat: string + carbs: string + sugar: string + ingredients(array, ingredients in the meal): string + +**Prompt and (optional) system instructions** + + Analyze this image of a meal: {{media type="mimeType" data="imageData"}}, and estimate the nutritional content. + Return the result in JSON format matching the schema: + - protein, fat, carbs, sugar (strings with units, e.g., '20g') + - ingredients (list of strings) + +## Find Stores Template + +This prompt template is used when the user needs to find stores that sell the ingredients they need. + +**Configuration (frontmatter)** + + model: "gemini-3.5-flash-lite" + tools: + - googleMaps + input: + schema: + ingredients: "string, the ingredients in the shopping list" + dayOfWeek: "string, current day of the week" + currentTime: "string, current time of the day" + +**Prompt and (optional) system instructions** + + What are the nearest grocery stores or markets near me that stock these ingredients: {{ingredients}}? + For each place, tell me their business hours, if it's open right now on {{dayOfWeek}} at {{currentTime}}, and if it's closing in less than 30 minutes. + Tell me what the parking situation is like at each place: is there a dedicated lot or should I look for street parking? + Tell the Map URL so I can open it in Google Maps. + Format your response strictly as a JSON object with a "stores" array containing store objects. + Each store object must have these EXACT keys: "name": string, "address": string, "distance": string, "openNow": boolean, "closingSoon": boolean, "hasParking": boolean, "parkingDetails": string, "mapUrl": string. + Do NOT include markdown code block formatting (like ```json). Output only the raw JSON string. + From 56bb43336d726862b06d32015eeab359ccc3d40b Mon Sep 17 00:00:00 2001 From: Marina Coelho Date: Tue, 11 Aug 2026 13:50:49 +0100 Subject: [PATCH 04/10] Deleted old prompts file --- prompt-templates.md | 123 -------------------------------------------- 1 file changed, 123 deletions(-) delete mode 100644 prompt-templates.md diff --git a/prompt-templates.md b/prompt-templates.md deleted file mode 100644 index 01d758e..0000000 --- a/prompt-templates.md +++ /dev/null @@ -1,123 +0,0 @@ -# FriendlyMeals – Prompt Templates - -Below you find all the [prompt templates](https://firebase.google.com/docs/ai-logic/server-prompt-templates/get-started) that you need to create in your Firebase project before you can run FriendlyMeals. - -Please note that the model names below might not be the most up to date ones. Refer to the [Firebase AI Logic documentation](https://firebase.google.com/docs/ai-logic/models) to check the latest available models. - -Don't forget to test your templates in the Firebase console before you use them in your apps. [Read the docs](https://firebase.google.com/docs/ai-logic/server-prompt-templates/get-started?api=dev#test-template) to learn how to test your templates properly. - -## Generate Ingredients Template - -This prompt template is used when the user takes a photo of their fridge or cupboard to identify the ingredients in it. - -**Configuration (frontmatter)** - - model: "gemini-3.5-flash-lite" - -**Prompt and (optional) system instructions** - - Please analyze this image: {{media type="mimeType" data="imageData"}}, and list all visible food ingredients. - Output ONLY a comma-separated list of ingredients. Do not include any introductory text, headers, or concluding remarks. - Provide the raw list only. Be specific with measurements where possible. - -## Generate Recipe Template - -This prompt template is used when the user generates a recipe from a list of ingredients and notes. - -**Configuration (frontmatter)** - - model: "gemini-3.5-flash-lite" - input: - schema: - ingredients: "string, the ingredients list" - notes?: "string, cuisine and dietary notes" - output: - format: json - schema: - title: string - instructions: string - ingredients(array, ingredients for recipe): string - prepTime: string - cookTime: string - servings: string - tags(array, relevant tags for recipe): string - -**Prompt and (optional) system instructions** - - {{role "user"}} - Create a detailed recipe based on these ingredients: {{ingredients}}. - - Format requirements: - - 'instructions': Provide the cooking steps as a clear list of instructions separated by newlines. Use bold formatting on the step numbers. Use Markdown. - - 'ingredients': List all necessary items, including quantities. - - 'prepTime', 'cookTime', 'servings': Short strings (e.g., "15 mins"). - - 'tags': Generate a list of 3-5 relevant category tags (e.g., "Healthy", "Vegan", "Gluten-Free", "Dessert", "Quick"). - - {{#if notes}} - IMPORTANT CUISINE AND DIETARY NOTES: {{notes}} - {{/if}} - -## Generate Recipe Photo Template - -This prompt template is used when the user generates a recipe photo from the recipe title. - -**Configuration (frontmatter)** - - model: "gemini-3.1-flash-image" - input: - schema: - recipeTitle: "string" - -**Prompt and (optional) system instructions** - - A professional food photography shot of this recipe: {{recipeTitle}}. - Style: High-end food photography, restaurant-quality plating, soft natural lighting, on a clean background, showing the complete plated dish. - -## Scan Meal Template - -This prompt template is used when the user scans a meal to extract the nutritional facts. - -**Configuration (frontmatter)** - - model: "gemini-3.5-flash-lite" - output: - format: json - schema: - protein: string - fat: string - carbs: string - sugar: string - ingredients(array, ingredients in the meal): string - -**Prompt and (optional) system instructions** - - Analyze this image of a meal: {{media type="mimeType" data="imageData"}}, and estimate the nutritional content. - Return the result in JSON format matching the schema: - - protein, fat, carbs, sugar (strings with units, e.g., '20g') - - ingredients (list of strings) - -## Find Stores Template - -This prompt template is used when the user needs to find stores that sell the ingredients they need. - -**Configuration (frontmatter)** - - model: "gemini-3.5-flash-lite" - tools: - - googleMaps - input: - schema: - ingredients: "string, the ingredients in the shopping list" - dayOfWeek: "string, current day of the week" - currentTime: "string, current time of the day" - -**Prompt and (optional) system instructions** - - What are the nearest grocery stores or markets near me that stock these ingredients: {{ingredients}}? - For each place, tell me their business hours, if it's open right now on {{dayOfWeek}} at {{currentTime}}, and if it's closing in less than 30 minutes. - Tell me what the parking situation is like at each place: is there a dedicated lot or should I look for street parking? - Tell the Map URL so I can open it in Google Maps. - Format your response strictly as a JSON object with a "stores" array containing store objects. - Each store object must have these EXACT keys: "name": string, "address": string, "distance": string, "openNow": boolean, "closingSoon": boolean, "hasParking": boolean, "parkingDetails": string, "mapUrl": string. - Do NOT include markdown code block formatting (like ```json). Output only the raw JSON string. - From e1520705c38b040acd57a7f9c4b91355a5da7751 Mon Sep 17 00:00:00 2001 From: Marina Coelho Date: Tue, 11 Aug 2026 13:58:20 +0100 Subject: [PATCH 05/10] Create generate-recipe-template-v1-0-0.prompt --- .../generate-recipe-template-v1-0-0.prompt | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 prompts/generate-recipe-template-v1-0-0.prompt diff --git a/prompts/generate-recipe-template-v1-0-0.prompt b/prompts/generate-recipe-template-v1-0-0.prompt new file mode 100644 index 0000000..91e6ad5 --- /dev/null +++ b/prompts/generate-recipe-template-v1-0-0.prompt @@ -0,0 +1,30 @@ +--- +model: "gemini-3.5-flash-lite" +input: + schema: + ingredients: "string, the ingredients list" + notes?: "string, cuisine and dietary notes" +output: + format: json + schema: + title: string + instructions: string + ingredients(array, ingredients for recipe): string + prepTime: string + cookTime: string + servings: string + tags(array, relevant tags for recipe): string +--- + +{{role "user"}} +Create a detailed recipe based on these ingredients: {{ingredients}}. + +Format requirements: + - 'instructions': Provide the cooking steps as a clear list of instructions separated by newlines. Use bold formatting on the step numbers. Use Markdown. + - 'ingredients': List all necessary items, including quantities. + - 'prepTime', 'cookTime', 'servings': Short strings (e.g., "15 mins"). + - 'tags': Generate a list of 3-5 relevant category tags (e.g., "Healthy", "Vegan", "Gluten-Free", "Dessert", "Quick"). + +{{#if notes}} +IMPORTANT CUISINE AND DIETARY NOTES: {{notes}} +{{/if}} From 01e9d9d441a933ee74c5f73725abb304bc9722cf Mon Sep 17 00:00:00 2001 From: Marina Coelho Date: Tue, 11 Aug 2026 13:59:25 +0100 Subject: [PATCH 06/10] Create generate-recipe-photo-gemini-template-v1-0-0.prompt --- .../generate-recipe-photo-gemini-template-v1-0-0.prompt | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 prompts/generate-recipe-photo-gemini-template-v1-0-0.prompt diff --git a/prompts/generate-recipe-photo-gemini-template-v1-0-0.prompt b/prompts/generate-recipe-photo-gemini-template-v1-0-0.prompt new file mode 100644 index 0000000..b2c81ed --- /dev/null +++ b/prompts/generate-recipe-photo-gemini-template-v1-0-0.prompt @@ -0,0 +1,9 @@ +--- +model: "gemini-3.1-flash-image" +input: + schema: + recipeTitle: "string" +--- + +A professional food photography shot of this recipe: {{recipeTitle}}. +Style: High-end food photography, restaurant-quality plating, soft natural lighting, on a clean background, showing the complete plated dish. From 7c3de3b5b16ad805100466f89d44250defae4ab2 Mon Sep 17 00:00:00 2001 From: Marina Coelho Date: Tue, 11 Aug 2026 14:00:13 +0100 Subject: [PATCH 07/10] Create scan-meal-template-v1-0-0.prompt --- prompts/scan-meal-template-v1-0-0.prompt | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 prompts/scan-meal-template-v1-0-0.prompt diff --git a/prompts/scan-meal-template-v1-0-0.prompt b/prompts/scan-meal-template-v1-0-0.prompt new file mode 100644 index 0000000..97bb625 --- /dev/null +++ b/prompts/scan-meal-template-v1-0-0.prompt @@ -0,0 +1,16 @@ +--- +model: "gemini-3.5-flash-lite" +output: + format: json + schema: + protein: string + fat: string + carbs: string + sugar: string + ingredients(array, ingredients in the meal): string +--- + +Analyze this image of a meal: {{media type="mimeType" data="imageData"}}, and estimate the nutritional content. +Return the result in JSON format matching the schema: +- protein, fat, carbs, sugar (strings with units, e.g., '20g') +- ingredients (list of strings) From 944552d3f24620ddfbf7186455bfd88c48348f06 Mon Sep 17 00:00:00 2001 From: Marina Coelho Date: Tue, 11 Aug 2026 14:00:51 +0100 Subject: [PATCH 08/10] Create find-stores-template-v1-0-0.prompt --- prompts/find-stores-template-v1-0-0.prompt | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 prompts/find-stores-template-v1-0-0.prompt diff --git a/prompts/find-stores-template-v1-0-0.prompt b/prompts/find-stores-template-v1-0-0.prompt new file mode 100644 index 0000000..43f72c8 --- /dev/null +++ b/prompts/find-stores-template-v1-0-0.prompt @@ -0,0 +1,18 @@ +--- +model: "gemini-3.5-flash-lite" +tools: + - googleMaps +input: + schema: + ingredients: "string, the ingredients in the shopping list" + dayOfWeek: "string, current day of the week" + currentTime: "string, current time of the day" +--- + +What are the nearest grocery stores or markets near me that stock these ingredients: {{ingredients}}? +For each place, tell me their business hours, if it's open right now on {{dayOfWeek}} at {{currentTime}}, and if it's closing in less than 30 minutes. +Tell me what the parking situation is like at each place: is there a dedicated lot or should I look for street parking? +Tell the Map URL so I can open it in Google Maps. +Format your response strictly as a JSON object with a "stores" array containing store objects. +Each store object must have these EXACT keys: "name": string, "address": string, "distance": string, "openNow": boolean, "closingSoon": boolean, "hasParking": boolean, "parkingDetails": string, "mapUrl": string. +Do NOT include markdown code block formatting (like ```json). Output only the raw JSON string. From 53f108985f2fdd3a3ffd9ef7d1e9c7c75a87ceec Mon Sep 17 00:00:00 2001 From: Marina Coelho Date: Tue, 11 Aug 2026 14:09:35 +0100 Subject: [PATCH 09/10] Update README.md with Prompt Templates instructions --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6ffefdb..e00b000 100644 --- a/README.md +++ b/README.md @@ -46,10 +46,16 @@ Welcome to **FriendlyMeals**, an app that demonstrates how to integrate Firebase 1. **Enable Firebase services in the Firebase console** - Go to the [**Firebase Authentication**](https://console.firebase.google.com/project/_/authentication/?useAutoProject=true) section of the console, enable the service and choose the Anonymous authentication method. - Go to the [**Firestore**](https://console.firebase.google.com/project/_/firestore/?useAutoProject=true) section of the console and enable Firestore Enterprise edition. - - Go to the [**Firebase AI Logic**](https://console.firebase.google.com/project/_/ailogic/?useAutoProject=true) section of the console and enable the Gemini Developer API. You will also need to go to the [Prompt templates tab](https://console.firebase.google.com/project/_/ailogic/templates/?useAutoProject=true) and create the prompt templates that will be fetched by the Android app. You can find the Prompt templates [inside the prompts folder](https://github.com/FirebaseExtended/FriendlyMeals-Android/tree/main/prompts). + - Go to the [**Firebase AI Logic**](https://console.firebase.google.com/project/_/ailogic/?useAutoProject=true) section of the console and enable the Gemini Developer API. - Go to the [**App Check**](https://console.firebase.google.com/project/_/appcheck/?useAutoProject=true) section of the console, enable this service, and register your Android app using the Play Integrity provider (you'll need to provide the SHA-256 fingerprint of your app's signing certificate). - Go to the [**Remote Config**](https://console.firebase.google.com/project/_/config/?useAutoProject=true) section of the console and enable this service. - Go to the [**Firebase Storage**](https://console.firebase.google.com/project/_/storage/?useAutoProject=true) section of the console and enable this service (you'll need to set up a billing account since this service is only available on the Blaze plan). + +1. **Create Firebase AI Logic Prompt Templates** + - If you're not familiar with Prompt templates, take a look at the [documentation](https://firebase.google.com/docs/ai-logic/server-prompt-templates/get-started) to learn more about it. + - Go to the [AI services > AI Logic > Prompt templates tab](https://console.firebase.google.com/project/_/ailogic/templates/?useAutoProject=true). + - Create one prompt template for each one of the four templates in the [prompts folder](https://github.com/FirebaseExtended/FriendlyMeals-Android/tree/main/prompts). Please note that the model names below might not be the most up to date ones. [Refer to the documentation](https://firebase.google.com/docs/ai-logic/models) to check the latest available models. + - Don't forget to test each one of your templates in the Firebase console before you use them in your apps. [Read the docs](https://firebase.google.com/docs/ai-logic/server-prompt-templates/get-started?api=dev#test-template) to learn how to test your templates properly. 1. **Run the app** - Build and run in Android Studio on an Android emulator or physical device. From 111002a64a3fbeb42e044aca69a96cb98b5eea98 Mon Sep 17 00:00:00 2001 From: Marina Coelho Date: Tue, 11 Aug 2026 14:10:38 +0100 Subject: [PATCH 10/10] Delete unused markdown file --- prompts/prompt-templates.md | 123 ------------------------------------ 1 file changed, 123 deletions(-) delete mode 100644 prompts/prompt-templates.md diff --git a/prompts/prompt-templates.md b/prompts/prompt-templates.md deleted file mode 100644 index 01d758e..0000000 --- a/prompts/prompt-templates.md +++ /dev/null @@ -1,123 +0,0 @@ -# FriendlyMeals – Prompt Templates - -Below you find all the [prompt templates](https://firebase.google.com/docs/ai-logic/server-prompt-templates/get-started) that you need to create in your Firebase project before you can run FriendlyMeals. - -Please note that the model names below might not be the most up to date ones. Refer to the [Firebase AI Logic documentation](https://firebase.google.com/docs/ai-logic/models) to check the latest available models. - -Don't forget to test your templates in the Firebase console before you use them in your apps. [Read the docs](https://firebase.google.com/docs/ai-logic/server-prompt-templates/get-started?api=dev#test-template) to learn how to test your templates properly. - -## Generate Ingredients Template - -This prompt template is used when the user takes a photo of their fridge or cupboard to identify the ingredients in it. - -**Configuration (frontmatter)** - - model: "gemini-3.5-flash-lite" - -**Prompt and (optional) system instructions** - - Please analyze this image: {{media type="mimeType" data="imageData"}}, and list all visible food ingredients. - Output ONLY a comma-separated list of ingredients. Do not include any introductory text, headers, or concluding remarks. - Provide the raw list only. Be specific with measurements where possible. - -## Generate Recipe Template - -This prompt template is used when the user generates a recipe from a list of ingredients and notes. - -**Configuration (frontmatter)** - - model: "gemini-3.5-flash-lite" - input: - schema: - ingredients: "string, the ingredients list" - notes?: "string, cuisine and dietary notes" - output: - format: json - schema: - title: string - instructions: string - ingredients(array, ingredients for recipe): string - prepTime: string - cookTime: string - servings: string - tags(array, relevant tags for recipe): string - -**Prompt and (optional) system instructions** - - {{role "user"}} - Create a detailed recipe based on these ingredients: {{ingredients}}. - - Format requirements: - - 'instructions': Provide the cooking steps as a clear list of instructions separated by newlines. Use bold formatting on the step numbers. Use Markdown. - - 'ingredients': List all necessary items, including quantities. - - 'prepTime', 'cookTime', 'servings': Short strings (e.g., "15 mins"). - - 'tags': Generate a list of 3-5 relevant category tags (e.g., "Healthy", "Vegan", "Gluten-Free", "Dessert", "Quick"). - - {{#if notes}} - IMPORTANT CUISINE AND DIETARY NOTES: {{notes}} - {{/if}} - -## Generate Recipe Photo Template - -This prompt template is used when the user generates a recipe photo from the recipe title. - -**Configuration (frontmatter)** - - model: "gemini-3.1-flash-image" - input: - schema: - recipeTitle: "string" - -**Prompt and (optional) system instructions** - - A professional food photography shot of this recipe: {{recipeTitle}}. - Style: High-end food photography, restaurant-quality plating, soft natural lighting, on a clean background, showing the complete plated dish. - -## Scan Meal Template - -This prompt template is used when the user scans a meal to extract the nutritional facts. - -**Configuration (frontmatter)** - - model: "gemini-3.5-flash-lite" - output: - format: json - schema: - protein: string - fat: string - carbs: string - sugar: string - ingredients(array, ingredients in the meal): string - -**Prompt and (optional) system instructions** - - Analyze this image of a meal: {{media type="mimeType" data="imageData"}}, and estimate the nutritional content. - Return the result in JSON format matching the schema: - - protein, fat, carbs, sugar (strings with units, e.g., '20g') - - ingredients (list of strings) - -## Find Stores Template - -This prompt template is used when the user needs to find stores that sell the ingredients they need. - -**Configuration (frontmatter)** - - model: "gemini-3.5-flash-lite" - tools: - - googleMaps - input: - schema: - ingredients: "string, the ingredients in the shopping list" - dayOfWeek: "string, current day of the week" - currentTime: "string, current time of the day" - -**Prompt and (optional) system instructions** - - What are the nearest grocery stores or markets near me that stock these ingredients: {{ingredients}}? - For each place, tell me their business hours, if it's open right now on {{dayOfWeek}} at {{currentTime}}, and if it's closing in less than 30 minutes. - Tell me what the parking situation is like at each place: is there a dedicated lot or should I look for street parking? - Tell the Map URL so I can open it in Google Maps. - Format your response strictly as a JSON object with a "stores" array containing store objects. - Each store object must have these EXACT keys: "name": string, "address": string, "distance": string, "openNow": boolean, "closingSoon": boolean, "hasParking": boolean, "parkingDetails": string, "mapUrl": string. - Do NOT include markdown code block formatting (like ```json). Output only the raw JSON string. -