feat(profile): add profile settings and LLM user context

This commit is contained in:
Piotr Oleszczyk 2026-03-05 15:57:21 +01:00
parent db3d9514d5
commit b99b9ed68e
25 changed files with 472 additions and 9 deletions

View file

@ -128,3 +128,33 @@ def test_delete_snapshot(client):
def test_delete_snapshot_not_found(client):
r = client.delete(f"/skincare/{uuid.uuid4()}")
assert r.status_code == 404
def test_analyze_photos_includes_user_profile_context(client, monkeypatch):
from innercontext.api import skincare as skincare_api
captured: dict[str, object] = {}
class _FakeResponse:
text = "{}"
def _fake_call_gemini(**kwargs):
captured.update(kwargs)
return _FakeResponse()
monkeypatch.setattr(skincare_api, "call_gemini", _fake_call_gemini)
profile = client.patch(
"/profile", json={"birth_date": "1991-02-10", "sex_at_birth": "female"}
)
assert profile.status_code == 200
r = client.post(
"/skincare/analyze-photos",
files={"photos": ("face.jpg", b"fake-bytes", "image/jpeg")},
)
assert r.status_code == 200
parts = captured["contents"]
assert isinstance(parts, list)
assert any("USER PROFILE:" in str(part) for part in parts)