From abf95938572211b243d7ce3e4d61b36c94322c18 Mon Sep 17 00:00:00 2001 From: Piotr Oleszczyk Date: Sat, 28 Feb 2026 13:17:22 +0100 Subject: [PATCH] fix: correct Part.from_text() call and increase max_output_tokens for skin analysis Pass `text=` as keyword arg to Part.from_text() and raise max_output_tokens from 1024 to 2048 to prevent JSON truncation in the notes field. Co-Authored-By: Claude Sonnet 4.6 --- backend/innercontext/api/skincare.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/innercontext/api/skincare.py b/backend/innercontext/api/skincare.py index 49231fe..1606cce 100644 --- a/backend/innercontext/api/skincare.py +++ b/backend/innercontext/api/skincare.py @@ -138,7 +138,7 @@ async def analyze_skin_photos( parts.append(genai_types.Part.from_bytes(data=data, mime_type=photo.content_type)) parts.append( genai_types.Part.from_text( - "Analyze the skin condition visible in the above photo(s) and return the JSON assessment." + text="Analyze the skin condition visible in the above photo(s) and return the JSON assessment." ) ) @@ -149,7 +149,7 @@ async def analyze_skin_photos( config=genai_types.GenerateContentConfig( system_instruction=_skin_photo_system_prompt(), response_mime_type="application/json", - max_output_tokens=1024, + max_output_tokens=2048, temperature=0.0, ), )