Log in
Log into community
Find answers from the community
View all posts
Related posts
Was this helpful?
π
π
π
Powered by
Hall
Inactive
Updated 5 months ago
0
Follow
Prompts
Prompts
Inactive
0
Follow
At a glance
J
JoshHartCreatedYou
last year
Β·
Are there any ways currently to alter the underlying prompts and flows within some of the query engines or retrievers? Like altering the prompt for how the sub questions created in the sub question retriever, how the answers are synthesized? Thanks!
W
L
5 comments
Share
Open in Discord
W
WhiteFang_Jr
last year
Ref on how you can customize the prompt in LlamaIndex:
https://docs.llamaindex.ai/en/stable/module_guides/models/prompts.html
Also for sub query engines: You can change the prompt based on your need from here:
https://github.com/run-llama/llama_index/blob/main/llama_index/query_engine/sub_question_query_engine.py
It has two ways to generate the questions:
OpenAIQuestionGenerator
LLMQuestionGenerator
Both of them use a default prompt which you can modify!
L
LeMoussel
last year
@WhiteFang_Jr How to generate questions from LLMQuestionGenerator?
W
WhiteFang_Jr
last year
https://github.com/run-llama/llama_index/blob/main/llama_index/question_gen/llm_generators.py
L
LeMoussel
last year
Some examples to use it?
W
WhiteFang_Jr
last year
Not sure if there is direct example of using it, But you can check the
generate
method in it and follow on the requirements.
https://github.com/run-llama/llama_index/blob/cdfebe6f438461549a5b3647c697bf4bbaa51d47/llama_index/question_gen/llm_generators.py#L61
Add a reply
Sign up and join the conversation on Discord
Join on Discord