[BUG] Index Lookup raises Exception in search_function_execution.
Description Index lookup step using Registered Inded and an existing index that works OK in Chat playground fails in prompt flow with the following error: Run failed: Exception: Exception occured in search_function_execution.
Traceback (most recent call last):
File "/azureml-envs/prompt-flow/runtime/lib/python3.9/site-packages/promptflow_vectordb/tool/utils/profiling.py", line 18, in measure_execution_time
yield
File "/azureml-envs/prompt-flow/runtime/lib/python3.9/site-packages/promptflow_vectordb/tool/common_index_lookup.py", line 63, in telemetry_wrapper
search_result = search_func(query)
File "/azureml-envs/prompt-flow/runtime/lib/python3.9/site-packages/promptflow_vectordb/tool/common_index_lookup_extensions/acs.py", line 113, in wrapper
results = search_func(query)
File "/azureml-envs/prompt-flow/runtime/lib/python3.9/site-packages/langchain_community/vectorstores/azuresearch.py", line 524, in hybrid_search_with_score
docs = [
File "/azureml-envs/prompt-flow/runtime/lib/python3.9/site-packages/langchain_community/vectorstores/azuresearch.py", line 527, in
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/azureml-envs/prompt-flow/runtime/lib/python3.9/site-packages/promptflow_vectordb/tool/utils/profiling.py", line 18, in measure_execution_time
yield
File "/azureml-envs/prompt-flow/runtime/lib/python3.9/site-packages/promptflow_vectordb/tool/common_index_lookup.py", line 133, in search
results = [
File "/azureml-envs/prompt-flow/runtime/lib/python3.9/site-packages/promptflow_vectordb/tool/common_index_lookup.py", line 133, in
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "/azureml-envs/prompt-flow/runtime/lib/python3.9/site-packages/promptflow/tracing/_trace.py", line 556, in wrapped output = func(*args, **kwargs) File "/azureml-envs/prompt-flow/runtime/lib/python3.9/site-packages/promptflow_vectordb/core/logging/utils.py", line 98, in wrapper res = func(*args, **kwargs) File "/azureml-envs/prompt-flow/runtime/lib/python3.9/site-packages/promptflow_vectordb/tool/common_index_lookup.py", line 133, in search results = [ File "/azureml-envs/prompt-flow/runtime/lib/python3.9/contextlib.py", line 137, in exit self.gen.throw(typ, value, traceback) File "/azureml-envs/prompt-flow/runtime/lib/python3.9/site-packages/promptflow_vectordb/tool/utils/profiling.py", line 21, in measure_execution_time raise Exception(error_msg) from e Exception: Exception occured in search_function_execution.
How To Reproduce the bug Method 1: get a working Chat example with a Vector index and select Prompt Flow to Orchestrate and customize this setup with prompt flow. Method 2: create a flow by selecting "Multi-Round Q&A on Your Data"
Expected behavior Expected behaviours is the complete successfully the index lookup.
Screenshots
Running Information(please complete the following information):
- Azure AI Studio
- Module: promptflow.tools.aoai
Additional context Add any other context about the problem here.
True. Only appears when multiple fields are added to content in Field mapping. Change it to one, and it works alright.
True. Only appears when multiple fields are added to content in Field mapping. Change it to one, and it works alright.
I don't understand where the "multiple fields refer." Please give me more detailed description. Please note that the model was constructed automatically from a "Chat playground project" that works OK.
I've got the same error when running the "Q&A on Your Data" out of the box flow together with AI search. My index lookup settings look the following:
The error is a little more specific, namely keyerror 'content' is given.
True. Only appears when multiple fields are added to content in Field mapping. Change it to one, and it works alright.
I don't understand where the "multiple fields refer." Please give me more detailed description. Please note that the model was constructed automatically from a "Chat playground project" that works OK.
@pkpsomas I agree that there is a discrepancy between chat playground and the prompt flow automatically created. By multiple fields, I mean
This in the prompt flow, is reflected in 'acs_content_field' of the 'querySearchResource' as comma separated fields leading to an error. When you recreate the prompt flow but with only one content field selected in the 'add your data' section of the chat playground, it works fine. Definitely a bug.
I've got the same error when running the "Q&A on Your Data" out of the box flow together with AI search. My index lookup settings look the following:
The error is a little more specific, namely keyerror 'content' is given.
I'm afraid, we'd need more information to debug. For starters, does the AI search index have the 'content' field?
got it figured out. In the AI search settings, the content was not set as 'retrievable'. Changing this solved the issue for me
Hi, we're sending this friendly reminder because we haven't heard back from you in 30 days. We need more information about this issue to help address it. Please be sure to give us your input. If we don't hear back from you within 7 days of this comment, the issue will be automatically closed. Thank you!
I retested the functionality in the latest version, and it works OK.
