Skip to content

Add queries in Query engine instead of 'query_str' - Help Needed #14689

Answered by dosubot bot
mraguth asked this question in Q&A
Discussion options

You must be logged in to vote

Yes, you can integrate the generated queries automatically by directing the output of the queries into your query engine. Here's an example of how to achieve this:

  1. Generate the Queries: Use the provided code to generate multiple queries from the original query_str.

  2. Modify the Query Engine: Update your query engine to handle multiple queries.

Here is a complete example:

from llama_index.core.tools import ToolMetadata
from llama_index.core.selectors import (
    PydanticMultiSelector,
    PydanticSingleSelector,
)
from llama_index.core import PromptTemplate
from llama_index.llms.openai import OpenAI
from llama_index.core.retrievers import BaseRetriever
from llama_index.core.llms import 

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@mraguth
Comment options

@dosubot
Comment options

Answer selected by mraguth
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant