Skip to content

Commit

Permalink
feat: Add flashcard service module
Browse files Browse the repository at this point in the history
  • Loading branch information
SverreNystad committed Mar 14, 2024
1 parent bf08d9b commit 8813bea
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions backend/flashcards/flashcard_service.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
""" The service module contains the business logic of the application. """

from django.core.files.uploadedfile import InMemoryUploadedFile


def process_flashcards(uploaded_file: InMemoryUploadedFile) -> list["Flashcard"]:
"""
Process the files and return the flashcards.
"""
print("[INFO] Processing file", flush=True)

# Extract text from the uploaded file
# TODO: Use the scraper to extract the text from the uploaded file

# Post the text into knowledge base
# TODO: Use the rag service to post the text into the knowledge base

# Generate flashcards from the text
# TODO: use the FlashcardGenerator to generate flashcards from the text

# Format the texts into flashcards

0 comments on commit 8813bea

Please sign in to comment.