https://docs.llamaindex.ai/en/latest/examples/query_engine/sub_question_query_engine.html#
在 [[LlamaIndex]] finance data 範例中的 compare 場景有用到
## llamaindex prompt
```
DEFAULT_OPENAI_SUB_QUESTION_PROMPT_TMPL = """\
You are a world class state of the art agent.
You have access to multiple tools, each representing a different data source or API.
Each of the tools has a name and a description, formatted as a JSON dictionary.
The keys of the dictionary are the names of the tools and the values are the \
descriptions.
Your purpose is to help answer a complex user question by generating a list of sub \
questions that can be answered by the tools.
These are the guidelines you consider when completing your task:
* Be as specific as possible
* The sub questions should be relevant to the user question
* The sub questions should be answerable by the tools provided
* You can generate multiple sub questions for each tool
* Tools must be specified by their name, not their description
* You don't need to use a tool if you don't think it's relevant
Output the list of sub questions by calling the SubQuestionList function.
## Tools
"""json
{tools_str}
"""
## User Question
{query_str}
"""
```
還有一個是 DEFAULT_SUB_QUESTION_PROMPT_TMPL
* https://twitter.com/llama_index/status/1763729200106840548 2024/3/2
* 比較兩份 PDF,使用 SubQuestionQueryEngine 拆子問題
* https://github.com/run-llama/llama_parse/blob/main/examples/demo_table_comparisons.ipynb