feat: adding image generation API to the plugin#21
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds support for an image-generation microservice to the Open edX AI Badges Tutor plugin, and surfaces its health status in the UI alongside the existing badge API and Ollama checks.
Changes:
- Add Tutor configuration defaults and deployment templates (docker-compose + k8s) for a new
mit-slm-imageservice. - Expose image API URL/health settings to Django and include the image service in backend
get_api_status. - Enable the “Image Generation API” label in the frontend API Status panel.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tutor/openedx_ai_badges/plugin.py | Adds config defaults and docker-compose/k8s resources for the new image-generation service; also attempts to inject the image service URL into the badge API container. |
| tutor/openedx_ai_badges/patches/openedx-common-settings | Adds Django settings tokens for image API URL and health URL. |
| backend/openedx_ai_badges/workflows/orchestrators.py | Adds an image_api health check to get_api_status and returns it to the UI. |
| frontend/src/messages.ts | Adds i18n message for the image API service label. |
| frontend/src/components/AIBadgesTab/ApiStatusPanel.tsx | Enables display of the image_api service in the status list. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| def check_image_api(): | ||
| if not image_api_health_url: | ||
| return 'not_configured' | ||
| try: | ||
| resp = requests.get(image_api_health_url, timeout=5) |
There was a problem hiding this comment.
get_api_status now adds an image_api health check (an extra requests.get). The existing unit tests for get_api_status currently mock exactly two requests.get calls, so this change will make them fail with StopIteration unless updated. Please extend those tests to include the new call and add assertions for the image_api status behavior.
f5966ee to
aaf532e
Compare
e66a651 to
7c033a2
Compare

This PR adds the image generation service from https://github.com/oneorigin-inc/mit-badge-image-generation as a separate microservice.
The services is added from a hosted docker image: https://hub.docker.com/r/felipemontoya/dcc-mit-badge-image-gen-api created from the master tip of the repository