Skip to content

feat: add the get_course_info function to openedx processor#145

Merged
felipemontoya merged 6 commits intoopenedx:mainfrom
eduNEXT:mfmz/add-get-course-info
Feb 24, 2026
Merged

feat: add the get_course_info function to openedx processor#145
felipemontoya merged 6 commits intoopenedx:mainfrom
eduNEXT:mfmz/add-get-course-info

Conversation

@MaferMazu
Copy link
Copy Markdown
Contributor

@MaferMazu MaferMazu commented Feb 18, 2026

Description

This function retrieves the course information.

Related PR: eduNEXT/openedx-ai-badges#6

How to test

Quick test (without llm request)

  1. Create a profile with examples.openweights.qwen_summary
    1.1 Add a patch
{
  "orchestrator_class": "DirectLLMResponse",
  "processor_config": {
    "OpenEdXProcessor": {
      "function": "get_course_info"
    },
    "LLMProcessor": {
      "function": "summarize_content",
      "provider": "openai"
    }
  }
} 
  1. Edit the DirectLLMResponse to return the value before calling the LLM.
class DirectLLMResponse(BaseOrchestrator):
    """
    Orchestrator for direct LLM responses.
    Does a single call to an LLM and gives a response.
    """

    def run(self, input_data):
        """
        Executes the content fetching, LLM processing, and handles streaming
        or structured response return.
        """

        # --- 1. Process with OpenEdX processor (Content Fetching) ---
        openedx_processor = OpenEdXProcessor(
            processor_config=self.profile.processor_config,
            location_id=self.location_id,
            course_id=self.course_id,
            user=self.user,
        )
        content_result = openedx_processor.process()

        # 
        # --- This is what we are adding ---
        return {
            'response': str(content_result),
            'status': 'completed'
        }
  1. Associate the profile with a Scope (it could be LMS or CMS).
  2. Interact with the AI component, and you should see a response with the course info.

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Feb 18, 2026
@openedx-webhooks
Copy link
Copy Markdown

Thanks for the pull request, @MaferMazu!

This repository is currently maintained by @felipemontoya.

Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review.

🔘 Get product approval

If you haven't already, check this list to see if your contribution needs to go through the product review process.

  • If it does, you'll need to submit a product proposal for your contribution, and have it reviewed by the Product Working Group.
    • This process (including the steps you'll need to take) is documented here.
  • If it doesn't, simply proceed with the next step.
🔘 Provide context

To help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:

  • Dependencies

    This PR must be merged before / after / at the same time as ...

  • Blockers

    This PR is waiting for OEP-1234 to be accepted.

  • Timeline information

    This PR must be merged by XX date because ...

  • Partner information

    This is for a course on edx.org.

  • Supporting documentation
  • Relevant Open edX discussion forum threads
🔘 Get a green build

If one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green.

Details
Where can I find more information?

If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources:

When can I expect my changes to be merged?

Our goal is to get community contributions seen and reviewed as efficiently as possible.

However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:

  • The size and impact of the changes that it introduces
  • The need for product review
  • Maintenance status of the parent repository

💡 As a result it may take up to several weeks or months to complete a review and merge your PR.

@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 18, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.92%. Comparing base (b862005) to head (c7584dd).
⚠️ Report is 13 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #145      +/-   ##
==========================================
+ Coverage   91.77%   91.92%   +0.15%     
==========================================
  Files          54       54              
  Lines        4946     5043      +97     
  Branches      308      310       +2     
==========================================
+ Hits         4539     4636      +97     
  Misses        313      313              
  Partials       94       94              
Flag Coverage Δ
unittests 91.92% <ø> (+0.15%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

Adds a new OpenEdXProcessor LLM tool function to fetch course-level metadata intended for downstream LLM processing.

Changes:

  • Add get_course_info LLM tool to return course details (title/description/overview, etc.) with optional fields filtering via processor_config.
  • Add CourseKey usage to parse course IDs for course info lookup.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread backend/openedx_ai_extensions/processors/openedx/openedx_processor.py Outdated
Comment thread backend/openedx_ai_extensions/processors/openedx/openedx_processor.py Outdated
Comment thread backend/openedx_ai_extensions/processors/openedx/openedx_processor.py Outdated
Comment thread backend/openedx_ai_extensions/processors/openedx/openedx_processor.py Outdated
@MaferMazu MaferMazu force-pushed the mfmz/add-get-course-info branch from 3cf7d1e to c9672af Compare February 20, 2026 20:04
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

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread backend/openedx_ai_extensions/processors/openedx/openedx_processor.py Outdated
Comment thread backend/openedx_ai_extensions/processors/openedx/openedx_processor.py Outdated
Comment thread backend/tests/test_openedx_processor.py
Copy link
Copy Markdown
Contributor

@Henrrypg Henrrypg left a comment

Choose a reason for hiding this comment

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

Fixing the description i see this PR pretty fine, maybe we could be more descriptive in the descriptions but i don't have a specific proposal, maybe @felipemontoya can help us with those.

Comment thread backend/openedx_ai_extensions/processors/openedx/openedx_processor.py Outdated
@mphilbrick211 mphilbrick211 moved this from Needs Triage to In Eng Review in Contributions Feb 24, 2026
Copy link
Copy Markdown
Member

@felipemontoya felipemontoya left a comment

Choose a reason for hiding this comment

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

Based on henrry's review I'll go ahead and merge

@felipemontoya felipemontoya merged commit 4a597c0 into openedx:main Feb 24, 2026
10 checks passed
@github-project-automation github-project-automation Bot moved this from In Eng Review to Done in Contributions Feb 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

open-source-contribution PR author is not from Axim or 2U

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

6 participants