Expose collection freshness in school bot endpoint#591
Merged
Conversation
Add collection_updated_at and collection_book_count to the
/v1/school/{id}/bot response. The chatflow uses this to warn
schools with stale (>3 years old) collection data.
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request adds collection freshness tracking to the school bot endpoint to help detect stale book collections in the Huey Bookbot chatflow. The endpoint now returns collection_updated_at (ISO datetime or null) and collection_book_count (int) to enable the chatflow to prompt librarians when their book collection data is more than 3 years old.
Changes:
- Modified
/v1/school/{id}/botendpoint to include collection metadata (updated_at, book_count) - Added conditional logic to return collection info when present, null/0 when absent
- No breaking changes - two new optional fields added to existing response
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
- Add Huey Jokes sub-flow with randomized precursor/bridge messages
using new random_choice() CEL function
- Add Huey Spelling sub-flow with 3-round pick-the-correct-spelling
game, difficulty matched to reading ability
- Add CMS content loaders for jokes (from CSV) and spelling questions
- Fix composite sub-flows not blocking on questions when entered via
condition auto-chain (questions were dumped as messages instead of
pausing for user input)
- Add days_since() CEL function for date comparisons
- Update Huey Bookbot flow to v3.0.0 with jokes, spelling composites
and stale collection warning
- Make /school/{id}/bot endpoint public (no auth required)
- Fix KeyError on missing experiments key in school info
Use <strong> tags on the correct word in spelling wrong-answer messages so frontends that support rich_text rendering show it emphasized.
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.
Summary
collection_updated_at(ISO datetime or null) andcollection_book_count(int) to the/v1/school/{id}/botresponseContext
The Huey Bookbot chatflow needs to warn schools when their book collection data is outdated, so recommendations are based on current stock. The
collection_updated_atfield lets the flow's condition nodes check staleness.The
experimentsfield already contains"no-jokes": falseper-school, which will be used to gate the upcoming joke sub-flow.Test plan
ruff check)/v1/school/{id}/botreturns new fields for schools with/without collections