Find answers from the community

Updated 10 months ago

Is there a benefit to using either of

Is there a benefit to using either of these response variables?

response = engine.query(query)

response = engine.query(QueryBundle(query_str=query, embedding=embedded_query))

Plain Text
    def query_index(self, query_engines: List[BaseQueryEngine], queries: List[str]):
        for query in queries:
            embedded_query = Settings.embed_model.get_text_embedding(query)
            for engine in query_engines:
                response = engine.query(query)
                <...or...>
                response = engine.query(QueryBundle(query_str=query, 
                                                    embedding=embedded_query))

Plain Text
    vector_index = VectorStoreIndex.from_vector_store(vector_store=rag.vector_store, 
                                               embed_model=Settings.embed_model)

    query_engine0 = vector_index.as_query_engine(llm=Settings.llm,
                                         similarity_top_k=15, 
                                         node_postprocessors=[
                                                SimilarityPostprocessor(similarity_cutoff=0.60), 
                                                cohere_rerank
                                            ]
                                        )
L
s
3 comments
A benefit to using the query bundle you mean?
Yea like you can separate the query/embedding used for retrieval vs the query that is sent to the LLM
Add a reply
Sign up and join the conversation on Discord