Skip to content

Commit 97bb8d0

Browse files
Set search provider defaults to best ones at onboarding
Preferred food search providers for best performance are set to: Text/Voice Search: USDA FoodData Central Barcode Search: OpenFoodFacts AI Image Analysis: OpenAI (ChatGPT API)
1 parent 477ca57 commit 97bb8d0

File tree

3 files changed

+13
-11
lines changed

3 files changed

+13
-11
lines changed

Loop/Extensions/UserDefaults+Loop.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ MANDATORY REQUIREMENTS:
340340

341341
var textSearchProvider: String {
342342
get {
343-
return string(forKey: Key.textSearchProvider.rawValue) ?? "OpenFoodFacts (Default)"
343+
return string(forKey: Key.textSearchProvider.rawValue) ?? "USDA FoodData Central"
344344
}
345345
set {
346346
set(newValue, forKey: Key.textSearchProvider.rawValue)
@@ -349,7 +349,7 @@ MANDATORY REQUIREMENTS:
349349

350350
var barcodeSearchProvider: String {
351351
get {
352-
return string(forKey: Key.barcodeSearchProvider.rawValue) ?? "OpenFoodFacts (Default)"
352+
return string(forKey: Key.barcodeSearchProvider.rawValue) ?? "OpenFoodFacts"
353353
}
354354
set {
355355
set(newValue, forKey: Key.barcodeSearchProvider.rawValue)
@@ -358,7 +358,7 @@ MANDATORY REQUIREMENTS:
358358

359359
var aiImageProvider: String {
360360
get {
361-
return string(forKey: Key.aiImageProvider.rawValue) ?? "Google (Gemini API)"
361+
return string(forKey: Key.aiImageProvider.rawValue) ?? "OpenAI (ChatGPT API)"
362362
}
363363
set {
364364
set(newValue, forKey: Key.aiImageProvider.rawValue)

Loop/Services/AIFoodAnalysis.swift

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,8 @@ FOR MENU AND RECIPE ITEMS:
229229
❌ NEVER multiply nutrition values by assumed restaurant portion sizes
230230
231231
✅ ALWAYS set image_type to "menu_item" when analyzing menu text
232-
✅ ALWAYS set portion_estimate to "CANNOT DETERMINE - menu text only"
232+
✅ When analyzing a MENU, ALWAYS set portion_estimate to "CANNOT DETERMINE PORTION - menu text only"
233+
✅ When analyzing a RECIPE, ALWAYS set portion_estimate to "CANNOT DETERMINE PORTION - recipe text only"
233234
✅ ALWAYS set serving_multiplier to 1.0 for menu items (USDA standard only)
234235
✅ ALWAYS set visual_cues to "NONE - menu text analysis only"
235236
✅ ALWAYS mark assessment_notes as "ESTIMATE ONLY - Based on USDA standard serving size"
@@ -471,7 +472,7 @@ FOR MENU ITEMS:
471472
"food_items": [
472473
{
473474
"name": "menu item name as written on menu",
474-
"portion_estimate": "CANNOT DETERMINE - menu text only, no actual food visible",
475+
"portion_estimate": "CANNOT DETERMINE PORTION - menu text only, no actual food visible",
475476
"usda_serving_size": "standard USDA serving size for this food type (e.g., '3 oz for chicken breast', '1/2 cup for cooked rice')",
476477
"serving_multiplier": 1.0,
477478
"preparation_method": "method described on menu (if any)",
@@ -514,7 +515,7 @@ If menu shows "Grilled Chicken Caesar Salad", respond:
514515
"food_items": [
515516
{
516517
"name": "Grilled Chicken Caesar Salad",
517-
"portion_estimate": "CANNOT DETERMINE - menu text only, no actual food visible",
518+
"portion_estimate": "CANNOT DETERMINE PORTION - menu text only, no actual food visible",
518519
"usda_serving_size": "3 oz chicken breast + 2 cups mixed greens",
519520
"serving_multiplier": 1.0,
520521
"preparation_method": "grilled chicken as described on menu",
@@ -556,7 +557,7 @@ If menu shows "Teriyaki Chicken Bowl with White Rice", respond:
556557
"food_items": [
557558
{
558559
"name": "Teriyaki Chicken with White Rice",
559-
"portion_estimate": "CANNOT DETERMINE - menu text only, no actual food visible",
560+
"portion_estimate": "CANNOT DETERMINE PORTION - menu text only, no actual food visible",
560561
"usda_serving_size": "3 oz chicken breast + 1/2 cup cooked white rice",
561562
"serving_multiplier": 1.0,
562563
"preparation_method": "teriyaki glazed chicken with steamed white rice as described on menu",
@@ -596,7 +597,7 @@ If menu shows "Quinoa Bowl with Sweet Potato and Black Beans", respond:
596597
"food_items": [
597598
{
598599
"name": "Quinoa Bowl with Sweet Potato and Black Beans",
599-
"portion_estimate": "CANNOT DETERMINE - menu text only, no actual food visible",
600+
"portion_estimate": "CANNOT DETERMINE PORTION - menu text only, no actual food visible",
600601
"usda_serving_size": "1/2 cup cooked quinoa + 1/2 cup sweet potato + 1/2 cup black beans",
601602
"serving_multiplier": 1.0,
602603
"preparation_method": "cooked quinoa, roasted sweet potato, and seasoned black beans as described on menu",
@@ -675,7 +676,8 @@ FOR MENU AND RECIPE ITEMS:
675676
❌ NEVER multiply nutrition values by assumed restaurant portion sizes
676677
677678
✅ ALWAYS set image_type to "menu_item" when analyzing menu text
678-
✅ ALWAYS set portion_estimate to "CANNOT DETERMINE - menu text only"
679+
✅ When analyzing a MENU, ALWAYS set portion_estimate to "CANNOT DETERMINE PORTION - menu text only"
680+
✅ When analyzing a RECIPE, ALWAYS set portion_estimate to "CANNOT DETERMINE PORTION - recipe text only"
679681
✅ ALWAYS set serving_multiplier to 1.0 for menu items (USDA standard only)
680682
✅ ALWAYS set visual_cues to "NONE - menu text analysis only"
681683
✅ ALWAYS mark assessment_notes as "ESTIMATE ONLY - Based on USDA standard serving size"
@@ -915,7 +917,7 @@ enum SearchProvider: String, CaseIterable {
915917
case claude = "Anthropic (Claude API)"
916918
case googleGemini = "Google (Gemini API)"
917919
case openAI = "OpenAI (ChatGPT API)"
918-
case openFoodFacts = "OpenFoodFacts (Default)"
920+
case openFoodFacts = "OpenFoodFacts"
919921
case usdaFoodData = "USDA FoodData Central"
920922

921923

Loop/Views/AISettingsView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ struct AISettingsView: View {
361361
Text("**Text/Voice Search:**")
362362
.font(.caption)
363363
.fontWeight(.bold)
364-
Text("USDA FoodData Central → OpenFoodFacts (Default)")
364+
Text("USDA FoodData Central → OpenFoodFacts")
365365
.font(.caption)
366366
.foregroundColor(.secondary)
367367

0 commit comments

Comments
 (0)