Draft
Fix nutrition photo analysis API integration and missing Anthropic config docs#31
Conversation
Co-authored-by: Eliaaazzz <204549980+Eliaaazzz@users.noreply.github.com>
Co-authored-by: Eliaaazzz <204549980+Eliaaazzz@users.noreply.github.com>
Co-authored-by: Eliaaazzz <204549980+Eliaaazzz@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix error returning nutrition card after food photo upload
Fix nutrition photo analysis API integration and missing Anthropic config docs
Dec 6, 2025
Owner
|
no, I want to disable claude and switch to gemini 2.5 flash, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Food photo upload returned 500 errors due to frontend/backend API contract mismatches. Error logs showed duplicate
/api/v1/api/v1/paths and the backend expected different parameter names and response structures than the frontend provided.Changes
API Integration Fixes
/nutrition/analyze→/api/v1/nutrition/analyzeinnutritionApi.tsfile→imageinapiClient.tsto match backend@RequestParam("image")detectedFoods/total→items/totalNutritionto match backendFoodRecognitionResponseType Safety
RecognizedFood,NutritionInfo)nutritionfield optional to match Java DTO (no@NotNullannotation)Documentation
SETUP_API_KEYS.md(backend uses Claude Vision, not Gemini).env.examplewithANTHROPIC_API_KEYconfigurationThe issue description mentioned Gemini API - note that food recognition requires Anthropic Claude API key, not Gemini.
Original prompt
This section details on the original issue you should resolve
<issue_title>no nutrition card returned after adding a photo of food</issue_title>
<issue_description>{"code":5000,"message":"An unexpected error occurred. Please try again later.","timestamp":1764982592329,"path":"/api/v1/api/v1/me"}
Failed to load resource: the server responded with a status of 500 ()Understand this error
:8080/api/v1/api/v1/nutrition/summary/daily?userId=default-user:1 Failed to load resource: the server responded with a status of 500 ()Understand this error
:8080/api/v1/api/v1/nutrition/summary/daily?userId=default-user:1 Failed to load resource: the server responded with a status of 500 ()Understand this error
:8080/api/v1/api/v1/nutrition/summary/daily?userId=default-user:1 Failed to load resource: the server responded with a status of 500 ()Understand this error
:8080/api/v1/api/v1/nutrition/summary/daily?userId=default-user:1 Failed to load resource: the server responded with a status of 500 ()Understand this error
:8080/api/v1/api/v1/nutrition/summary/daily?userId=default-user:1 Failed to load resource: the server responded with a status of 500 ()Understand this error
:8080/api/v1/api/v1/nutrition/summary/daily?userId=default-user:1 Failed to load resource: the server responded with a status of 500 ()Understand this error
:8080/api/v1/api/v1/nutrition/summary/daily?userId=default-user:1 Failed to load resource: the server responded with a status of 500 ()Understand this error
:8080/api/v1/api/v1/nutrition/analyze:1 Failed to load resource: the server responded with a status of 500 ()Understand this error
ReviewMealScreen.tsx:40 Food analysis failed: APIError: An unexpected error occurred. Please try again later.
at request (apiClient.ts:72:13)
at async Object.analyzeFoodImage (nutritionApi.ts:84:10)
at async analyze (ReviewMealScreen.tsx:36:26)
analyze @ ReviewMealScreen.tsx:40Understand this error
:8080/api/v1/api/v1/nutrition/summary/daily?userId=default-user:1 Failed to load resource: the server responded with a status of 500 ()Understand this error
:8080/api/v1/api/v1/nutrition/summary/daily?userId=default-user:1 Failed to load resource: the server responded with a status of 500 ()Understand this error
:8080/api/v1/api/v1/nutrition/summary/daily?userId=default-user:1 Failed to load resource: the server responded with a status of 500 ()Understand this error
:8080/api/v1/api/v1/nutrition/summary/daily?userId=default-user:1 Failed to load resource: the server responded with a status of 500 ()Understand this error
:8080/api/v1/api/v1/nutrition/summary/daily?userId=default-user:1 Failed to load resource: the server responded with a status of 500 ()Understand this error
:8080/api/v1/api/v1/nutrition/summary/daily?userId=default-user:1 Failed to load resource: the server responded with a status of 500 ()Understand this error
:8080/api/v1/api/v1/nutrition/summary/daily?userId=default-user:1 Failed to load resource: the server responded with a status of 500 ()Understand this error
:8080/api/v1/api/v1/nutrition/summary/daily?userId=default-user:1 Failed to load resource: the server responded with a status of 500 ()Understand this error
:8080/api/v1/api/v1/nutrition/summary/daily?userId=default-user:1 Failed to load resource: the server responded with a status of 500 ()Understand this error
:8080/api/v1/api/v1/nutrition/summary/daily?userId=default-user:1 Failed to load resource: the server responded with a status of 500 ()Understand this error
:8080/api/v1/api/v1/nutrition/summary/daily?userId=default-user:1 Failed to load resource: the server responded with a status of 500 ()Understand this error
:8080/api/v1/api/v1/nutrition/summary/daily?userId=default-user:1 Failed to load resource: the server responded with a status of 500 ()Understand this error
:8080/api/v1/api/v1/nutrition/summary/daily?userId=default-user:1 Failed to load resource: the server responded with a status of 500 ()Understand this error
:8080/api/v1/api/v1/nutrition/analyze:1 Failed to load resource: the server responded with a status of 500 ()Understand this error
ReviewMealScreen.tsx:40 Food analysis failed: APIError: An unexpected error occurred. Please try again later.
at request (apiClient.ts:72:13)
at async Object.analyzeFoodImage (nutritionApi.ts:84:10)
at async analyze (ReviewMealScreen.tsx:36:26)
analyze @ ReviewMealScreen.tsx:40Understand this error
:8080/api/v1/api/v1/nutrition/summary/daily?userId=default-user:1 Failed to load resource: the server responded with a status of 500 ()Understand this error
:8080/api/v1/api/v1/me:1 Failed to load resource: the server responded with a status of 500 ()Understand this error
:8080/api/v1/api/v1/me:1 Failed to load resource: the server responded with a status of 500 ()Understand this error
is it because i didn't activate my google cloud account though gemini api key is provided</issue_description>
<agent_instructions>please review fronted an...
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.