Repository navigation
Add set_macro_split tool and report the split in get_macro_targets - #80
Open
paultristanwagner wants to merge 2 commits into
Open
paultristanwagner wants to merge 2 commits into
paultristanwagner wants to merge 2 commits into
Conversation
The app stores the macro split as three profile prefs (macroProtein, macroCarbs, macroLipids, percent of energy) and changes them with /api/v2/set_pref. Verified against the live API: a split set this way reads back unchanged from get_profile. Claude-Session: https://claude.ai/code/session_01MCJFDo71qoSqTRtcGfkpXJ
9 tasks
This branch has not been deployed
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.
Part of #73.
Adds a
set_macro_splittool, andget_macro_targetsnow reports thecurrent split. On accounts without macro schedules or templates (the
free tier),
get_macro_targetsreturned two empty lists.The app stores the split as three profile prefs (percent of energy). It
changes them with
POST /api/v2/set_pref, one call per changed macro:{"key": "macroProtein", "val": "30.0", "auth": {…}, "config": {"call_version": 1}}The keys are
macroProtein,macroCarbsandmacroLipids. Current valuesare in
get_profile→prefs, a list of one-key objects. Verified againstthe live API: a split written this way reads back unchanged, and the
per-nutrient targets (
GET /api/v3/user/{id}/targets) were unchangedafterwards.
Changes:
get_macro_split()reads the prefs.set_macro_split(protein, carbs, fat)checks that each share is 0-100and that they add up to 100, then writes all three.
set_macro_splittool. Its description tells the model toconfirm with the user and to read the old split first.
get_macro_targetsgains a
macro_splitfield.https://claude.ai/code/session_01MCJFDo71qoSqTRtcGfkpXJ