diff --git a/guides/activities.mdx b/guides/activities.mdx index 07371a4..e9154c6 100644 --- a/guides/activities.mdx +++ b/guides/activities.mdx @@ -227,13 +227,31 @@ Response: ```json { + "activity_type": "run", "type": "run", - "confidence": 0.95 + "confidence": 0.95, + "request_id": "req_4f2a9c1e7b30" } ``` -`type` is one of the seven activity keys or `"unknown"`. Inference never fails the request: when the model is unavailable or the evidence is too thin, you get `"unknown"` with `confidence: 0`, so branch on the type rather than on an error. +`activity_type` is one of the seven activity keys or `"unknown"`, and `type` carries the same value. When the model is unavailable or the evidence is too thin, you get `"unknown"` with low or zero confidence rather than an error, so branch on the type. A `502` means the inference service itself could not be reached; it is not counted as usage, so retry with backoff. -Sending more than a title sharpens the result. The endpoint also reads `pre_activity_comment`, `workout_type` (your provider's own coarse type), `velocity` in m/s, `has_power`, and `cadence`, and those structured signals resolve most cases before the model is consulted. +Sending more than a title sharpens the result. The endpoint also reads `pre_activity_comment`, `workout_type` (your provider's own coarse type), `tss_calculation_method`, `structure_summary`, `velocity` in m/s, `has_power`, and `cadence`, and those structured signals resolve many cases before the model is consulted. The API reference names two of these differently, and both spellings work: `activity_name` is `title`, and `source_type` is `workout_type`. You can also send `device`, the recording device's name. -For multi-sport titles like "Bike/run brick", use `POST /v1/infer/brick-types`. It returns `sub_types` (for example `["bike", "run"]`) with a single `confidence`, and you create one activity per leg. +A strength session also carries `intensity`: `1` light, `2` medium, `3` heavy. Lift uses levels 1-3 of `intensity_level`, so pass the value unchanged as `intensity_level` when you create the lift activity; rescaling it onto 1-9 raises the carbohydrate ceiling. An entry that marks a day with no training, such as "Rest day", comes back with `"rest_day": true` and type `"unknown"`; it is not a workout to create. + +For multi-sport titles like "Bike/run brick", use `POST /v1/infer/brick-types`. It takes the same fields plus an optional `segments` list of the legs you already know, in order, and returns every leg in order: + +```json +{ + "segments": [ + {"activity_type": "bike", "order": 1}, + {"activity_type": "run", "order": 2} + ], + "sub_types": ["bike", "run"], + "confidence": 0.9, + "request_id": "req_8d51e0b2c7a4" +} +``` + +`sub_types` is the same list without the order numbers. Create one activity per leg.