Repository navigation
Add search_activities and add_exercise tools - #79
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 logs exercise with /api/v2/add_exercise. It computes the calorie burn itself; here the caller passes it and calorieOverride is set, so no activity intensity data is needed. The server requires the body weight (lb), which comes from the profile. Activities come from the two catalogs the app's picker merges (get_activity_forest and all_legacy_activities). Verified against the live API with ids from both catalogs. 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
search_activitiesandadd_exercisetools to log exercise.The app logs exercise with
POST /api/v2/add_exercise:{"exercise": {"exerciseId": null, "type": "Exercise", "activityId": 1342, "activitySpecId": 370, "minutes": 15.0, "weight": 176.4, "calories": -42.0, "calorieOverride": false, "day": …, "order": …, …}, "auth": {…}, "config": {"call_version": 1}}The app works out
caloriesitself, from activity intensity data thatisn't in the activity lists. This change has the caller pass the calorie
burn and sets
calorieOverride, like entering calories by hand in the app.Verified against the live API on 1900-01-02:
activitySpecIdcan be left out (it's stored as 0)weight(body weight in lb) is required: without it the serveranswers 500. It's taken from the profile's
weightInKGpref.get_activity_forest(about 200 activities, ids 1135 and up) andall_legacy_activities(about 1100 more specific ones, ids 1-1134,e.g. "Walking 3.0 mph, moderate"). The id ranges don't overlap.
Exercises appear in
get_diaryas"type": "Exercise"entries. Deletingthem needs
delete_entriesto matchexerciseId(#74).Changes:
get_activities()merges both catalogs.add_exercise(activity_id, minutes, calories, day, diary_group)sendsthe burn as a negative number with
calorieOverride: true, plus theprofile weight.
search_activities(every query word must appear in thename) and
add_exercise. Its description asks the model to estimate theburn from the MET value when the user doesn't know it.
https://claude.ai/code/session_01MCJFDo71qoSqTRtcGfkpXJ