Skip to content

Commit 6d5717b

Browse files
AmichelangeloQi-2077Copilotsarkar-rajarshi
authored
[SDK Release] (Python) CQA inference 2025-05-15-preview (#42870)
* init and update by tsp generate tool * update patch files to support old version, and fix tests and samples * delete old question anwsering folder * init * update patch files to support old version, and fix tests and samples * update tests * update tests&recordings * fix spell issue * fix the Azure Pipelines / python - pullrequest * fix Unexpected indentation issue for sphinx-build * fix the cspell issue * fix verify whl stage * fix Incompatible types in assignment * fix pylint * fix Inline strong start-string without end-string. * fix overload issue * update operation patch and re record * fix(questionanswering): add missing type annotations to restore verifytypes score The verifytypes pipeline failed because type completeness for azure-ai-language-questionanswering dropped from 100% (main) to 87.9%. Pyright reported missing / ambiguous types for: QuestionAnsweringClient.question_answering (sync + async clients) QuestionAnsweringOperations.init (sync + async) Derived patch classes were then flagged as having partially unknown bases. Changes: Added explicit return/attribute annotation for question_answering in _client.py and _client.py. Added *args: Any, **kwargs: Any plus explicit internal attribute types in _operations.py and _operations.py. Result: Eliminates Pyright errors about missing annotations and partially unknown base classes. Restores type completeness score to parity with main (expected 100%). No runtime or public API behavior changes; typing-only improvement. Follow-up (optional): Consider templating these annotations in the code generator to avoid future regeneration loss * regenerate the code and update tests/samples/patch * fix commit: 1. update readme, add sample for both flattened options and explicit AnswersOptions 2. add overloads for get_answers 3. other fix * add back files * update * update version * switch examples to DefaultAzureCredential and reorganize README Make AAD the primary auth path; move API key to secondary section Clarify custom subdomain requirement for token auth Add rationale for DefaultAzureCredential Unify example headings (options vs flattened vs async) Fix internal anchors and markdown lint issues * Update sdk/cognitivelanguage/azure-ai-language-questionanswering/azure/ai/language/questionanswering/models/_enums.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update sdk/cognitivelanguage/azure-ai-language-questionanswering/samples/sample_query_knowledgebase.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update sdk/cognitivelanguage/azure-ai-language-questionanswering/samples/README.md Co-authored-by: Rajarshi Sarkar <73562869+sarkar-rajarshi@users.noreply.github.com> * add and update * deleted generated files and restore patch file * updated * update the python version in sample readme * update the python version in setup.py * fix pylint, 4 of them not foxed, because them are generated code * update patch file * remove uesless _default_language * update * update parameter name of just "options" update the class name * fix pylint * fix pylint * update change log * update * Update sdk/cognitivelanguage/azure-ai-language-questionanswering/tsp-location.yaml Co-authored-by: Rajarshi Sarkar <73562869+sarkar-rajarshi@users.noreply.github.com> * fix analyze issue * update * about default_language * regenerate * update --------- Co-authored-by: Qi Yin <v-qiyin1@microsoft.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Rajarshi Sarkar <73562869+sarkar-rajarshi@users.noreply.github.com>
1 parent 14a1af7 commit 6d5717b

File tree

84 files changed

+3750
-14496
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+3750
-14496
lines changed

.vscode/cspell.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -912,7 +912,7 @@
912912
},
913913
{
914914
"filename": "sdk/cognitivelanguage/azure-ai-language-questionanswering/**",
915-
"words": [ "qnas", "qnamaker", "ADTO" ],
915+
"words": [ "qnas", "qnamaker", "ADTO", "tfidf", "ngram" ],
916916
"caseSensitive": false
917917
},
918918
{

sdk/cognitivelanguage/azure-ai-language-questionanswering/CHANGELOG.md

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,28 @@
11
# Release History
22

3-
## 1.1.1 (Unreleased)
4-
5-
### Features Added
3+
## 2.0.0b1 (2025-10-27)
64

75
### Breaking Changes
86

9-
### Bugs Fixed
7+
* Authoring functionality (project creation, knowledge source management, deployment operations) has been removed from this package and moved to a separate dedicated authoring package / namespace. All references to `AuthoringClient`, and related authoring operations have been eliminated from the runtime client distribution.
8+
* Dropped support for Python versions earlier than 3.9 (aligns with Azure SDK Python support policy going forward).
9+
* Model base class change: all public model types now inherit from `MutableMapping[str, Any]` (dict-like) instead of the previous `Model` base class. As a result they now support standard mutable mapping behavior (key iteration, item assignment, etc.) and any code depending on methods/properties inherited from the old base class should be reviewed/updated.
10+
* Removed client constructor keyword argument `default_language`. Per-call language control is now done explicitly via the `language` property on `AnswersFromTextOptions` (and related options models). The service default remains `"en"` if a language is not supplied. To change the effective language:
11+
* Pass `language="<bcp-47-code>"` when constructing `AnswersFromTextOptions` (e.g. `"es"`, `"zh-Hans"`).
12+
* Or create / select a project in the desired language in [Language Studio](https://language.azure.com) when authoring knowledge bases.
13+
14+
The previous implicit fallback (client-level `default_language`) has been removed to avoid hidden state and to encourage explicit specification or project-level configuration.
15+
* Removed support for passing metadata as `Dict[str,str]` to `MetadataFilter`. Tuple form `[("key","value"), ...]` and `List[MetadataRecord]` remain supported.
16+
17+
### Features Added
18+
19+
* Documentation improvements: expanded README with authentication guidance, AAD usage, async examples, and troubleshooting section.
1020

1121
### Other Changes
1222

23+
* Internal refactoring and dependency grooming in preparation for the authoring/runtime split.
24+
* Changed samples and README examples to use explicit `AnswersOptions` / `AnswersFromTextOptions` objects as the first argument when calling `get_answers` and `get_answers_from_text`.
25+
1326
## 1.1.0 (2022-10-13)
1427

1528
### Breaking Changes
@@ -102,4 +115,4 @@
102115
## 1.0.0b1 (2021-07-27)
103116

104117
### Features Added
105-
* Initial release - supports querying from text records and knowledge bases.
118+
* Initial release - supports querying from text records and knowledge bases.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
include *.md
22
include LICENSE
3+
include azure/ai/language/questionanswering/py.typed
4+
recursive-include tests *.py
5+
recursive-include samples *.py *.md
36
include azure/__init__.py
47
include azure/ai/__init__.py
58
include azure/ai/language/__init__.py
6-
recursive-include tests *.py
7-
recursive-include samples *.py *.md
8-
include azure/ai/language/questionanswering/py.typed

sdk/cognitivelanguage/azure-ai-language-questionanswering/README.md

Lines changed: 181 additions & 203 deletions
Large diffs are not rendered by default.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"apiVersion": "2025-05-15-preview"
3+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"CrossLanguagePackageId": "Language.QuestionAnswering",
3+
"CrossLanguageDefinitionId": {
4+
"azure.ai.language.questionanswering.models.AnswersFromTextOptions": "Language.QuestionAnswering.AnswersFromTextOptions",
5+
"azure.ai.language.questionanswering.models.AnswersFromTextResult": "Language.QuestionAnswering.AnswersFromTextResult",
6+
"azure.ai.language.questionanswering.models.AnswersOptions": "Language.QuestionAnswering.AnswersOptions",
7+
"azure.ai.language.questionanswering.models.AnswerSpan": "Language.QuestionAnswering.AnswerSpan",
8+
"azure.ai.language.questionanswering.models.AnswersResult": "Language.QuestionAnswering.AnswersResult",
9+
"azure.ai.language.questionanswering.models.Error": "Language.QuestionAnswering.Error",
10+
"azure.ai.language.questionanswering.models.ErrorResponse": "Language.QuestionAnswering.ErrorResponse",
11+
"azure.ai.language.questionanswering.models.InnerErrorModel": "Language.QuestionAnswering.InnerErrorModel",
12+
"azure.ai.language.questionanswering.models.KnowledgeBaseAnswer": "Language.QuestionAnswering.KnowledgeBaseAnswer",
13+
"azure.ai.language.questionanswering.models.KnowledgeBaseAnswerContext": "Language.QuestionAnswering.KnowledgeBaseAnswerContext",
14+
"azure.ai.language.questionanswering.models.KnowledgeBaseAnswerDialog": "Language.QuestionAnswering.KnowledgeBaseAnswerDialog",
15+
"azure.ai.language.questionanswering.models.KnowledgeBaseAnswerPrompt": "Language.QuestionAnswering.KnowledgeBaseAnswerPrompt",
16+
"azure.ai.language.questionanswering.models.MatchingPolicy": "Language.QuestionAnswering.MatchingPolicy",
17+
"azure.ai.language.questionanswering.models.MetadataFilter": "Language.QuestionAnswering.MetadataFilter",
18+
"azure.ai.language.questionanswering.models.MetadataRecord": "Language.QuestionAnswering.MetadataRecord",
19+
"azure.ai.language.questionanswering.models.PrebuiltQueryMatchingPolicy": "Language.QuestionAnswering.PrebuiltQueryMatchingPolicy",
20+
"azure.ai.language.questionanswering.models.QueryFilters": "Language.QuestionAnswering.QueryFilters",
21+
"azure.ai.language.questionanswering.models.QueryPreferences": "Language.QuestionAnswering.QueryPreferences",
22+
"azure.ai.language.questionanswering.models.ShortAnswerOptions": "Language.QuestionAnswering.ShortAnswerOptions",
23+
"azure.ai.language.questionanswering.models.TextAnswer": "Language.QuestionAnswering.TextAnswer",
24+
"azure.ai.language.questionanswering.models.TextDocument": "Language.QuestionAnswering.TextDocument",
25+
"azure.ai.language.questionanswering.models.ErrorCode": "Language.QuestionAnswering.ErrorCode",
26+
"azure.ai.language.questionanswering.models.InnerErrorCode": "Language.QuestionAnswering.InnerErrorCode",
27+
"azure.ai.language.questionanswering.models.RankerKind": "Language.QuestionAnswering.RankerKind",
28+
"azure.ai.language.questionanswering.models.LogicalOperationKind": "Language.QuestionAnswering.LogicalOperationKind",
29+
"azure.ai.language.questionanswering.models.Scorer": "Language.QuestionAnswering.Scorer",
30+
"azure.ai.language.questionanswering.models.MatchingPolicyKind": "Language.QuestionAnswering.MatchingPolicyKind",
31+
"azure.ai.language.questionanswering.models.MatchingPolicyFieldsType": "Language.QuestionAnswering.MatchingPolicyFieldsType",
32+
"azure.ai.language.questionanswering.models.StringIndexType": "Language.QuestionAnswering.StringIndexType",
33+
"azure.ai.language.questionanswering.QuestionAnsweringClient.get_answers": "Language.QuestionAnsweringClientCustomizations.QuestionAnsweringClientOperations.getAnswers",
34+
"azure.ai.language.questionanswering.aio.QuestionAnsweringClient.get_answers": "Language.QuestionAnsweringClientCustomizations.QuestionAnsweringClientOperations.getAnswers",
35+
"azure.ai.language.questionanswering.QuestionAnsweringClient.get_answers_from_text": "Language.QuestionAnsweringClientCustomizations.QuestionAnsweringClientOperations.getAnswersFromText",
36+
"azure.ai.language.questionanswering.aio.QuestionAnsweringClient.get_answers_from_text": "Language.QuestionAnsweringClientCustomizations.QuestionAnsweringClientOperations.getAnswersFromText"
37+
}
38+
}

sdk/cognitivelanguage/azure-ai-language-questionanswering/assets.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"AssetsRepo": "Azure/azure-sdk-assets",
33
"AssetsRepoPrefixPath": "python",
44
"TagPrefix": "python/cognitivelanguage/azure-ai-language-questionanswering",
5-
"Tag": "python/cognitivelanguage/azure-ai-language-questionanswering_1f7e05ddea"
5+
"Tag": "python/cognitivelanguage/azure-ai-language-questionanswering_4cf6afbd99"
66
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__path__ = __import__("pkgutil").extend_path(__path__, __name__)
1+
__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__path__ = __import__("pkgutil").extend_path(__path__, __name__)
1+
__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__path__ = __import__("pkgutil").extend_path(__path__, __name__)
1+
__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore

0 commit comments

Comments
 (0)