Synthesizers
BaseSynthesizer
dataclass
BaseSynthesizer(
name: str = "",
llm: InstructorBaseRagasLLM = _default_llm_factory(),
llm_context: Optional[str] = None,
)
Bases: ABC, Generic[Scenario], PromptMixin
Base class for synthesizing scenarios and samples.
is_applicable
is_applicable(knowledge_graph: KnowledgeGraph) -> bool
Whether knowledge_graph has what this synthesizer needs.
default_query_distribution(kg=...) leaves out the synthesizers
for which this is False. The default is True.
Source code in src/ragas/testset/synthesizers/base.py
default_query_distribution
default_query_distribution(
llm: InstructorBaseRagasLLM,
kg: Optional[KnowledgeGraph] = None,
llm_context: Optional[str] = None,
) -> QueryDistribution