fabricatio_anki.capabilities.generate_analysis

Generates topic analysis for Anki flashcards.

This module provides the GenerateAnalysis class, which extends the Propose class to generate structured topic analysis using a template-based approach.

Classes

GenerateAnalysis

This class provides functionality to generate topic analysis for Anki flashcards.

Module Contents

class fabricatio_anki.capabilities.generate_analysis.GenerateAnalysis(/, **data: Any)

Bases: fabricatio_core.capabilities.propose.Propose

This class provides functionality to generate topic analysis for Anki flashcards.

It extends the Propose class and uses the TopicAnalysis model to structure the output.

async generate_analysis(topic: str, **kwargs: Unpack[fabricatio_core.models.kwargs_types.ValidateKwargs[fabricatio_anki.models.topic_analysis.TopicAnalysis]]) None | fabricatio_anki.models.topic_analysis.TopicAnalysis
async generate_analysis(topic: List[str], **kwargs: Unpack[fabricatio_core.models.kwargs_types.ValidateKwargs[fabricatio_anki.models.topic_analysis.TopicAnalysis]]) List[fabricatio_anki.models.topic_analysis.TopicAnalysis | None] | None

Generates an analysis for the given topic(s) using a template-based approach.

This method renders a template with the provided topic information and proposes a TopicAnalysis based on the generated content.

Parameters:
  • topic (str or List[str]) – A string or list of strings representing the topic(s) to analyze.

  • **kwargs (Unpack[ValidateKwargs[TopicAnalysis]]) – Additional keyword arguments for validation and customization.

Returns:

Returns None, a TopicAnalysis

object, or a list of TopicAnalysis objects depending on input.

Return type:

None | TopicAnalysis | List[TopicAnalysis | None]