-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: Azure AI Search Hybrid Semantic Search is unusable due to hardcoded parameter #17636
Comments
Hey @edgBR! 👋 I'm here to help you with any bugs, questions, or contributions you have. Let's squash those bugs together! To resolve the issue with semantic hybrid queries failing due to a hardcoded parameter in the LlamaIndex code, you need to ensure that the semantic configuration name is correctly set to "default" in your code. The error occurs because the semantic configuration name might be set to "mySemanticConfig" in the LlamaIndex code, which doesn't match your setup. Here's how you can update the code to use the "default" semantic configuration:
def _create_query_result(
self, search_query: str, vectors: Optional[List[Any]]
) -> VectorStoreQueryResult:
results = self._search_client.search(
search_text=search_query,
vector_queries=vectors,
top=self._query.similarity_top_k,
select=self._select_fields,
filter=self._odata_filter,
query_type="semantic",
semantic_configuration_name="default", # Change to "default"
)
# ... rest of the code ...
async def _acreate_query_result(
self, search_query: str, vectors: Optional[List[Any]]
) -> VectorStoreQueryResult:
results = await self._async_search_client.search(
search_text=search_query,
vector_queries=vectors,
top=self._query.similarity_top_k,
select=self._select_fields,
filter=self._odata_filter,
query_type="semantic",
semantic_configuration_name="default", # Change to "default"
)
# ... rest of the code ... Make sure that the semantic configuration named "default" is correctly set up in your Azure AI Search service. If it does not exist, you will need to create it or use the existing configuration name as defined in your Azure setup [1]. To continue talking to Dosu, mention @dosu. Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other |
Seems like an issue left from the original contributor. If you have the time, I welcome making a PR to configure this |
Hi @logan-markewich thanks for the blazing fast reply. I would be very willing to contribute but this is my first time looking to llamaindex internals. Besides the contribution guide: https://docs.llamaindex.ai/en/stable/CONTRIBUTING/#contributing-to-llamaindex Is there any tips what you could offer regarding how the class structure regarding vector stores should work? BR |
@edgBR nothing too much else specific to mention. I think this should probably be part of the vector store constructor, and then that value is just accessed when doing the hybrid retrieval. Something like To test your code locally, you can clone the repo, and install the package in editable mode |
On it @logan-markewich |
Bug Description
Hi all,
I noticed that all my semantic hybrid queries fail when defining an index as retrieves. My index definition is as follows:
When calling:
I get errors for all the queries.
Looking to the internal code of llamaindex I have not been able to see a way to pass the semantic config parameters via kwargs:
Version
0.12.9
Steps to Reproduce
Follow this notebooks:
https://github.com/farzad528/azure-ai-search-python-playground/blob/main/azure-ai-search-rag-eval-arize-ai.ipynb
And adapt it to your Azure Endpoints. Besides your semantic config needs to be called something different from: "mySemanticConfig"
In my case is default:
Relevant Logs/Tracbacks
The text was updated successfully, but these errors were encountered: