generate_flashcards
Create educational flashcards for studying and memorization. Generate question-answer cards on any topic with customizable difficulty and quantity for effective learning.
Instructions
Generate educational flashcards for effective study and memorization.
This function creates a set of flashcards using EduChain's content engine,
focusing on key concepts, definitions, and important facts related to the topic.
Each flashcard contains a question/prompt on one side and a comprehensive
answer on the other side, optimized for spaced repetition learning.
Args:
topic (str): The subject area, concept, or learning domain for which to
create flashcards. Should be specific enough to generate focused content.
Examples: "Spanish Vocabulary - Food", "Chemistry - Periodic Table",
"History - World War I Events"
num_cards (int, optional): The number of flashcards to generate.
Defaults to 10. Must be between 1 and 50.
difficulty (Optional[str]): The difficulty level for the flashcards.
Options: "beginner", "intermediate", "advanced". If not provided,
a mixed difficulty approach will be used.
Returns:
Dict[str, Any]: A dictionary containing the generated flashcards and metadata.
On success:
- flashcards: List of flashcard objects with front and back content
- topic: The input topic
- count: Number of flashcards generated
- difficulty: Difficulty level (if specified)
On error:
- error: Detailed error message
Raises:
ValueError: If num_cards is not in the valid range (1-50)
Example:
>>> generate_flashcards("Spanish Vocabulary - Animals", 5, "beginner")
{
"flashcards": [
{
"front": "What is the Spanish word for 'dog'?",
"back": "perro (masculine noun)"
},
{
"front": "Translate: 'The cat is sleeping'",
"back": "El gato está durmiendo"
},
...
],
"topic": "Spanish Vocabulary - Animals",
"count": 5,
"difficulty": "beginner"
}
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| topic | Yes | ||
| num_cards | No | ||
| difficulty | No |