feat(api): expand routines tool-calling to reduce prompt load

Keep the /routines/suggest base context lean by sending only active names and fetching detailed safety, actives, usage notes, and INCI on demand. Add a conservative fallback when tool roundtrip limits are hit to preserve safe outputs instead of failing the request.
This commit is contained in:
Piotr Oleszczyk 2026-03-04 11:52:07 +01:00
parent cfd2485b7e
commit 558708653c
3 changed files with 329 additions and 47 deletions

View file

@ -250,6 +250,9 @@ def test_suggest_routine(client, session):
kwargs = mock_gemini.call_args.kwargs
assert "function_handlers" in kwargs
assert "get_product_inci" in kwargs["function_handlers"]
assert "get_product_safety_rules" in kwargs["function_handlers"]
assert "get_product_actives" in kwargs["function_handlers"]
assert "get_product_usage_notes" in kwargs["function_handlers"]
def test_suggest_batch(client, session):