Carousel config with age-appropriate starting index - #619
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e220cf3afc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| resolved = self.runtime.substitute_variables(val, session_state) | ||
| try: | ||
| resolved_config[key] = int(resolved) | ||
| except (ValueError, TypeError): |
There was a problem hiding this comment.
Preserve typed carousel config values during substitution
The new carousel_config resolver uses substitute_variables, which always returns strings, and then only coerces integers; this means templated non-integer values (for example show_navigation: "{{temp.show_navigation}}") are emitted as string values like "True"/"False" instead of booleans. That breaks type fidelity for carousel settings and can cause clients to apply incorrect behavior when they expect native JSON types. Prefer substitute_object (or equivalent type-aware substitution) for each config value so booleans/lists/dicts remain correctly typed.
Useful? React with 👍 / 👎.
Add carousel to the input types that match user responses against full option objects and use option-index routing. Without this, carousel selections were stored as raw strings instead of the full option object, breaking downstream variable access like ability_key.
- Pass carousel_config through _build_input_request to frontend - Resolve template variables in carousel_config (e.g. default_index) - Store carousel options in _current_options for option matching - Flow fixture: add set_reading_start action using CEL ternary to map age ranges to starting book indices - Add author names to reading level option descriptions
Match the Landbot flow's age bounds to capture kids outside the 5-13 range.
91576b6 to
f81ca4a
Compare
Summary
Follow-up to #618. Adds carousel_config support so the reading level carousel starts at an age-appropriate book:
Changes
carousel_configthrough_build_input_request, resolve template variables, store carousel options in_current_optionsset_reading_startaction node using CEL ternary expression, add author names to option descriptions, update question textTest plan
default_indexfor all ages (verified programmatically)ability_key