So passing in
text_qa_template
and
refine_template
works, but it only applies to the actual query engine itself
For example, the flow is
- User sends message
- Agent decides which tool to use
- If it picks a tool, it writes it's own input to that tool
- In this case, it would call your query engine, where the templates are used
- Then the agent sees the answer, decides if anymore tools should be used, and re-writes the tool ouput(s) using the chat history to answer the original user message
In this flow, the templates only get used if the agent decides to use a query engine tool