Skip to content

feat: adding image generation API to the plugin#21

Merged
felipemontoya merged 4 commits intomainfrom
fmo/image-generation
Mar 25, 2026
Merged

feat: adding image generation API to the plugin#21
felipemontoya merged 4 commits intomainfrom
fmo/image-generation

Conversation

@felipemontoya
Copy link
Copy Markdown
Member

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

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-image service.
  • 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.

Comment thread tutor/openedx_ai_badges/plugin.py Outdated
Comment thread tutor/openedx_ai_badges/plugin.py
Comment thread tutor/openedx_ai_badges/patches/openedx-common-settings
Comment on lines +319 to +323
def check_image_api():
if not image_api_health_url:
return 'not_configured'
try:
resp = requests.get(image_api_health_url, timeout=5)
Copy link

Copilot AI Mar 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
@felipemontoya felipemontoya requested a review from Henrrypg March 21, 2026 00:59
@felipemontoya
Copy link
Copy Markdown
Member Author

What the generate image button looks like

image

Copy link
Copy Markdown
Contributor

@dcoa dcoa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@felipemontoya felipemontoya merged commit c9f2267 into main Mar 25, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants