Open
Description
- Package Name: azure-search-documents
- Package Version: 11.5.2
- Operating System: Windows
- Python Version: 3.12.9
Describe the bug
When I try to run a semantic search with extractive answers, the SDK provides a query_answer_count
option. However, when I try to use it, I get an error:
Exception Details: (InvalidAnswersOption) The value 'queryanswertype.extractive' is invalid mode for 'answers' parameter. Please specify one of the following options: none, extractive.
Code: InvalidAnswersOption
Message: The value 'queryanswertype.extractive' is invalid mode for 'answers' parameter. Please specify one of the following options: none, extractive.
Without that parameter it works fine (except that I only get one answer).
Instead, I have to change this:
query_answer=QueryAnswerType.EXTRACTIVE,
to this:
query_answer="extractive|count-3"
This is what the REST API expects. It seems like this was split out into two parameters in the SDK to try and be more intuitive... except that it simply doesn't work.
To Reproduce
Steps to reproduce the behavior:
- Perform a semantic search and set
query_answer
andquery_answer_count
properties. It will fail.
Expected behavior
Either these properties should be removed and you should tell people to use the "REST-compatible" string with query_answer
... or these should work correctly.
Additional context
query_answer_threshold
also does not work.