Skip to content

Index

BaseQuestionGenerator #

Bases: PromptMixin

Source code in llama_index/core/question_gen/types.py
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
class BaseQuestionGenerator(PromptMixin):
    def _get_prompt_modules(self) -> PromptMixinType:
        """获取提示模块。"""
        return {}

    @abstractmethod
    def generate(
        self, tools: Sequence[ToolMetadata], query: QueryBundle
    ) -> List[SubQuestion]:
        pass

    @abstractmethod
    async def agenerate(
        self, tools: Sequence[ToolMetadata], query: QueryBundle
    ) -> List[SubQuestion]:
        pass

SubQuestionList #

Bases: BaseModel

一个包装子问题列表的pydantic对象。

这主要用于使获取json模式更容易。

Source code in llama_index/core/question_gen/types.py
15
16
17
18
19
20
class SubQuestionList(BaseModel):
    """一个包装子问题列表的pydantic对象。

这主要用于使获取json模式更容易。"""

    items: List[SubQuestion]

SubQuestion #

Bases: BaseModel

Source code in llama_index/core/question_gen/types.py
10
11
12
class SubQuestion(BaseModel):
    sub_question: str
    tool_name: str