Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement pre-processing for the embed api #4399

Closed
Tracked by #4044
akolson opened this issue Jan 15, 2024 · 0 comments
Closed
Tracked by #4044

Implement pre-processing for the embed api #4399

akolson opened this issue Jan 15, 2024 · 0 comments
Assignees
Labels
DEV: backend P1 - important Priority: High impact on UX

Comments

@akolson
Copy link
Member

akolson commented Jan 15, 2024

Overview

This task involves implementing a robust pre-processing mechanism for the Embed API that performs validations and transformations on received input. This task is dependent on learningequality/le-utils#117. The implementation should be made off https://github.com/learningequality/curriculum-automation/pull/2

Description and outcomes

  • The input expected by the embed API is displayed below;
{
  "topics": [
      {
          "id": "02d6763539bd4dfc998464a72768d0cc",
          "title": "Target topic",
          "description": "Target description",
          "language": "en",
          "ancestors": [
              {
                "id": "02d6763539bd4dfc998464a72768d0ee",
                "title": "Parent topic title",
                "description": "Parent topic description",
                "language": "en",
              }
          ]
      }
  ],
  "resources": [
      {
          "id": "02d6763539bd4dfc998464a72768d0bb",
          "title": "Resource title",
          "description": "Resource description",
          "text": "Resource text",
          "language": "en",
      },
  ],
  "metadata": {
      "channel_id": "738a44c0d5ba4c69900494083e0b059e",
      "channel_title": "Channel title",
      "some_additional_field": "some_random_value",
  },
}
  • Ensure the presence of required fields and validate their formats.
  • Convert input into a standardized format compatible with the ensemble of models within the Embed API.

Accessibility requirements

Not applicable

Acceptance criteria

  • The Embed API only allows input data with all required fields
  • The input data is standardized into a format compatible with the ensemble of models within the Embed API.
  • Tests to verify the correctness of the input pre-processing functions.

Resources

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DEV: backend P1 - important Priority: High impact on UX
Projects
None yet
Development

No branches or pull requests

1 participant