Skip to content

feat: add extension mvp from ai-extensions#1

Open
Henrrypg wants to merge 9 commits intomainfrom
hpg/basic-mvp
Open

feat: add extension mvp from ai-extensions#1
Henrrypg wants to merge 9 commits intomainfrom
hpg/basic-mvp

Conversation

@Henrrypg
Copy link
Collaborator

@Henrrypg Henrrypg commented Feb 9, 2026

This pull request introduces a foundational implementation of the AI-powered badges feature, integrating backend workflow orchestration, API structure, and frontend component registration. The changes establish the core architecture for badge generation using LLM processors and enable frontend-backend communication for badge requests and responses.

Backend architecture and workflow orchestration:

  • Introduced a custom orchestrator (BadgeOrchestrator) that manages the badge generation workflow, including session management and mock course context for testing. This orchestrator uses a processor to generate badge definitions and serializes the result for API consumption. [1] [2] [3]
  • Implemented a badge processor (BadgeProcessor) that leverages an LLM to generate badge definitions following the Open Badges 2.0 spec, with clear constraints and deterministic output. [1] [2]
  • Added a serializer (BadgeClassPublicSerializer) for badge data, ensuring output conforms to a static, model-independent JSON structure.

API and URL structure:

  • Established a modular API URL structure, including versioned endpoints and integration into the main app URLs, to support future extensibility. [1] [2] [3]

Frontend integration and component registration:

  • Added a reusable React component (AIRequestBadgesComponent) for initiating badge requests, with loading and disabled states, and registered it with the AI extensions UI registry for dynamic backend-driven UI configuration. [1] [2]

Workflow configuration and settings:

  • Added a sample workflow profile JSON (badges_base.json) that defines the orchestrator, processor, and frontend actuator configuration for badge generation workflows.
  • Updated plugin settings to extend workflow template directories, ensuring custom workflow profiles are discoverable.

Other foundational changes:

  • Added module docstrings and initialized Python modules for custom workflows and processors, improving code organization and clarity. [1] [2]

These changes lay the groundwork for AI-driven badge generation, with clear separation of concerns and extensibility for both backend workflows and frontend UI components.

@MaferMazu
Copy link

An early comment here:
@Henrrypg, thank you very much for bringing this to the table!
It works! We can extend openedx-ai-extensions!!! 🙌🎉

I haven't reviewed the code, but as an early comment, I suggest removing all unnecessary features from this proof of concept (for example, assertions) and updating the PR cover to reflect your recent changes.

Again, thanks for this PR ✨ I'll be reviewing it in more depth soon.

@felipemontoya
Copy link
Member

I would say that what I'm missing the most in this PR is documentation on how to use it. Since I already know how to install the dependencies from the original AI extensions plugin, I'm I was able to, but I think a readme explaining how you get the UI components to connect that would be highly needed.

Copy link

@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.

I think the package.json is missing, something simple, the reasoning is 1) we are using a dependency need to specify it and second to use this as a module, this is the important things:

{
  "name": "@openedx/ai-badges-creator",
// ....
  "peerDependencies": {
        "@openedx/openedx-ai-extensions-ui": "^0.0.1"
  },
//.....
}

@@ -1,10 +1,35 @@
import RedLine from './plugin';
import AIRequestBadgesComponent from './components/AIRequestBadgesComponent';
Copy link

Choose a reason for hiding this comment

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

Please use tsx

animation="border"
variant="secondary"
size="sm"
className="me-2"
Copy link

Choose a reason for hiding this comment

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

for all the me classes replace them with mr (me is Bootstrap no Paragon)

onClick={onAskAI}
disabled={disabled || isLoading}
iconBefore={Send}
style={{
Copy link

Choose a reason for hiding this comment

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

try to avoid inline styles

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.

4 participants