fabricatio_anki.capabilities.generate_deck
Provide capabilities for creating a deck of cards.
Classes
Create a deck of cards with associated models and templates. |
Module Contents
- class fabricatio_anki.capabilities.generate_deck.GenerateDeck(/, **data: Any)
Bases:
fabricatio_core.capabilities.propose.ProposeCreate a deck of cards with associated models and templates.
This class provides methods to generate full decks, individual models, and card templates based on user requirements and field definitions.
- async generate_deck(requirement: str, fields: List[str], km: int = 0, kt: int = 0, **kwargs: Unpack[fabricatio_core.models.kwargs_types.ValidateKwargs[fabricatio_anki.models.deck.Deck]]) fabricatio_anki.models.deck.Deck | None
Create a deck with the given name and description.
- Parameters:
requirement – The requirement or theme for the deck
fields – List of fields to be included in the cards
km – Number of model generation attempts
kt – Number of template generation attempts
**kwargs – Additional validation keyword arguments
- Returns:
A Deck object containing metadata and models
- async generate_model(fields: List[str], requirement: str, k: int = 0, **kwargs: Unpack[fabricatio_core.models.kwargs_types.ValidateKwargs[fabricatio_anki.models.deck.Model]]) fabricatio_anki.models.deck.Model | None
- async generate_model(fields: List[str], requirement: List[str], k: int = 0, **kwargs: Unpack[fabricatio_core.models.kwargs_types.ValidateKwargs[fabricatio_anki.models.deck.Model]]) List[fabricatio_anki.models.deck.Model] | None
Generate one or more Anki card models.
- Parameters:
fields – Fields to be included in the model
requirement – Requirement(s) for model generation
k – Number of generation attempts
**kwargs – Validation keyword arguments
- Returns:
One or more Model instances based on input type
- async generate_template(fields: List[str], requirement: str, **kwargs: Unpack[fabricatio_core.models.kwargs_types.ValidateKwargs[fabricatio_anki.models.template.Template]]) fabricatio_anki.models.template.Template | None
- async generate_template(fields: List[str], requirement: List[str], **kwargs: Unpack[fabricatio_core.models.kwargs_types.ValidateKwargs[fabricatio_anki.models.template.Template]]) List[fabricatio_anki.models.template.Template] | None
Generate one or more card templates.
- Parameters:
fields – Fields used in the template
requirement – Requirement(s) for template generation
**kwargs – Validation keyword arguments
- Returns:
One or more Template instances based on input type
- async generate_front_side(fields: List[str], requirement: str, **kwargs: Unpack[fabricatio_core.models.kwargs_types.ValidateKwargs[fabricatio_anki.models.template.Side]]) fabricatio_anki.models.template.Side | None
- async generate_front_side(fields: List[str], requirement: List[str], **kwargs: Unpack[fabricatio_core.models.kwargs_types.ValidateKwargs[fabricatio_anki.models.template.Side]]) List[fabricatio_anki.models.template.Side | None] | None
Generate one or more front sides for Anki cards.
- Parameters:
fields – Fields used in the front side
requirement – Requirement(s) for front side generation
**kwargs – Validation keyword arguments
- Returns:
One or more Side instances based on input type
- async generate_back_side(fields: List[str], requirement: str, **kwargs: Unpack[fabricatio_core.models.kwargs_types.ValidateKwargs[fabricatio_anki.models.template.Side]]) fabricatio_anki.models.template.Side | None
- async generate_back_side(fields: List[str], requirement: List[str], **kwargs: Unpack[fabricatio_core.models.kwargs_types.ValidateKwargs[fabricatio_anki.models.template.Side]]) List[fabricatio_anki.models.template.Side | None] | None
Generate one or more back sides for Anki cards.
- Parameters:
fields – Fields used in the back side
requirement – Requirement(s) for back side generation
**kwargs – Validation keyword arguments
- Returns:
One or more Side instances based on input type