More vector data for programs, programs-as-courses#3115
Open
More vector data for programs, programs-as-courses#3115
Conversation
OpenAPI ChangesShow/hide 2 changes: 0 error, 0 warning, 2 infoUnexpected changes? Ensure your branch is up-to-date with |
Contributor
There was a problem hiding this comment.
Pull request overview
Expands program/course vector and display metadata so downstream AI/embedding workflows can include more complete program hierarchies, including test_mode resources.
Changes:
- Allow
fetch_onlycourse/program lookups to returntest_moderesources (not just published). - Append a markdown “Program Contents” section (including child summaries) to program marketing-page content files during scraping.
- Add
program_coursesto the display-info serializer/OpenAPI spec and regenerate the frontend API types.
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| openapi/specs/v1.yaml | Adds program_courses to the v1 schema for display info responses. |
| learning_resources/utils_test.py | Adds unit tests for program-children markdown generation. |
| learning_resources/utils.py | Implements program child hierarchy collection and markdown formatting (with content summaries). |
| learning_resources/tasks.py | Appends generated program-children markdown to scraped marketing page content. |
| learning_resources/serializers_test.py | Adds tests for recursive program_courses collection behavior and depth limiting. |
| learning_resources/serializers.py | Adds program_courses field to metadata display serializer; tweaks chunk header to be resource-type aware. |
| learning_resources/etl/loaders_test.py | Updates expectation for the new warning message when fetch-only lookup fails. |
| learning_resources/etl/loaders.py | Expands fetch-only lookup to include test_mode resources and updates warning text. |
| frontends/api/src/generated/v1/api.ts | Regenerates TS types to include program_courses. |
acd49b9 to
b3fbd35
Compare
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.
What are the relevant tickets?
Part of https://github.com/mitodl/hq/issues/10677
Description (What does it do?)
LearningResourceMetadataDisplaySerializer(which ends up in a contentfile for the resource used by the syllabusbot to answer questions)How can this be tested?
You'll need both learn-ai (use the
mb/related_resourcesbranch for this related PR) and mit-learn running.####mit-learn
backend.local.env:
frontend.local.env:
####learn-ai
backend.local.env:
frontend.local.env:
shared.local.env:
docker compose upLEARN_ACCESS_TOKENabovedocker compose run --rm web python manage.py backpopulate_mitxonline_datahttp://ai.open.odl.local:8003/?rec_prompt=&tab=SyllabusGPT&syllabus_prompt=&syllabus_resource=<id of "Universal AI" program>http://open.odl.local:8062/search?resource=<id of "Universal AI" program>&syllabus=and click "AskTIM"