You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: sdk/cognitivelanguage/azure-ai-language-questionanswering/CHANGELOG.md
+13Lines changed: 13 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,10 +5,23 @@
5
5
* We are now targeting service version `2021-07-15-preview`
6
6
7
7
### Breaking changes
8
+
8
9
* The method `QuestionAnsweringClient.query_knowledgebase` has been renamed to `query_knowledge_base`.
10
+
* Options bag model `KnowledgeBaseQueryOptions` for `query_knowledge_base` is renamed to `QueryKnowledgeBaseOptions`
11
+
* Options bag model `TextQueryOptions` for `query_text` is renamed to `QueryTextOptions`
12
+
* The filters model `StrictFilters` is renamed to `QueryFilters`
13
+
* Enum `CompoundOperationKind` is renamed to `LogicalOperationKind`
14
+
* We have removed the `string_index_type` input to all models and operations. We have also removed the `StringIndexType` enum.
15
+
* The type of input `metadata` to `MetadataFilter` has changed from a dictionary of strings to a list of key-value tuples.
16
+
For example, the input has changed from `{"key": "value"}` to `[("key", "value")]`.
17
+
* The input to the `query_knowledge_base` and `query_text` overloads that take in a positional model for the body should be
18
+
considered positional only.
9
19
10
20
### Features Added
21
+
11
22
* The method `QuestionAnsweringClient.query_text` now supports a list of records as strings, where the ID value will be automatically populated.
23
+
* Added keyword argument `default_language` onto `QuestionAnsweringClient`, which has default value `'en'`. The default language for any operation call will
_Azure SDK Python packages support for Python 2.7 is ending 01 January 2022. For more information and questions, please refer to https://github.com/Azure/azure-sdk-for-python/issues/20691_
12
+
9
13
## Getting started
10
14
11
15
### Prerequisites
12
16
13
-
* Python 2.7, or 3.6 or later is required to use this package.
14
-
* An [Azure subscription][azure_subscription]
15
-
* An existing Question Answering resource
17
+
- Python 2.7, or 3.6 or later is required to use this package.
18
+
- An [Azure subscription][azure_subscription]
19
+
- An existing Question Answering resource
16
20
17
21
> Note: the new unified Cognitive Language Services are not currently available for deployment.
The [QuestionAnsweringClient][questionanswering_client_class] is the primary interface for asking questions using a knowledge base with your own information, or text input using pre-trained models.
63
+
The [QuestionAnsweringClient][questionanswering_client_class] is the primary interface for asking questions using a knowledge base with your own information, or text input using pre-trained models.
60
64
For asynchronous operations, an async `QuestionAnsweringClient` is in the `azure.ai.language.questionanswering.aio` namespace.
61
65
62
66
## Examples
63
67
64
68
The `azure-ai-language-questionanswering` client library provides both synchronous and asynchronous APIs.
65
69
66
70
The following examples show common scenarios using the `client`[created above](#create-questionansweringclient).
71
+
67
72
-[Ask a question](#ask-a-question)
68
73
-[Ask a follow-up question](#ask-a-follow-up-question)
@@ -75,7 +80,7 @@ The only input required to ask a question using a knowledge base is just the que
75
80
```python
76
81
from azure.ai.language.questionanswering import models as qna
77
82
78
-
params = qna.KnowledgeBaseQueryOptions(
83
+
params = qna.QueryKnowledgeBaseOptions(
79
84
question="How long should my Surface battery last?"
80
85
)
81
86
@@ -89,14 +94,14 @@ for candidate in output.answers:
89
94
90
95
```
91
96
92
-
You can set additional properties on `KnowledgeBaseQueryOptions` to limit the number of answers, specify a minimum confidence score, and more.
97
+
You can set additional properties on `QueryKnowledgeBaseOptions` to limit the number of answers, specify a minimum confidence score, and more.
93
98
94
99
### Ask a follow-up question
95
100
96
101
If your knowledge base is configured for [chit-chat][questionanswering_docs_chat], the answers from the knowledge base may include suggested [prompts for follow-up questions][questionanswering_refdocs_prompts] to initiate a conversation. You can ask a follow-up question by providing the ID of your chosen answer as the context for the continued conversation:
Optional keyword arguments can be passed in at the client and per-operation level. The azure-core [reference documentation][azure_core_ref_docs] describes available configurations for retries, logging, transport protocols, and more.
137
145
138
146
## Troubleshooting
139
147
140
148
### General
149
+
141
150
Azure QuestionAnswering clients raise exceptions defined in [Azure Core][azure_core_readme].
142
151
When you interact with the Cognitive Language Services Question Answering client library using the Python SDK, errors returned by the service correspond to the same HTTP status codes returned for [REST API][questionanswering_rest_docs] requests.
143
152
@@ -156,6 +165,7 @@ except HttpResponseError as error:
156
165
```
157
166
158
167
### Logging
168
+
159
169
This library uses the standard
160
170
[logging][python_logging] library for logging.
161
171
Basic information about HTTP sessions (URLs, headers, etc.) is logged at INFO
@@ -168,9 +178,9 @@ See full SDK logging documentation with examples [here][sdk_logging_docs].
168
178
169
179
## Next steps
170
180
171
-
* View our [samples][questionanswering_samples].
172
-
* Read about the different [features][questionanswering_docs_features] of the Question Answering service.
173
-
* Try our service [demos][questionanswering_docs_demos].
181
+
- View our [samples][questionanswering_samples].
182
+
- Read about the different [features][questionanswering_docs_features] of the Question Answering service.
183
+
- Try our service [demos][questionanswering_docs_demos].
174
184
175
185
## Contributing
176
186
@@ -183,6 +193,7 @@ When you submit a pull request, a CLA-bot will automatically determine whether y
183
193
This project has adopted the [Microsoft Open Source Code of Conduct][code_of_conduct]. For more information see the [Code of Conduct FAQ][coc_faq] or contact [[email protected]][coc_contact] with any additional questions or comments.
Copy file name to clipboardExpand all lines: sdk/cognitivelanguage/azure-ai-language-questionanswering/azure/ai/language/questionanswering/_question_answering_client.py
+3Lines changed: 3 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -32,6 +32,8 @@ class QuestionAnsweringClient(QuestionAnsweringClientOperationsMixin):
32
32
:type endpoint: str
33
33
:param credential: Credential needed for the client to connect to Azure.
Copy file name to clipboardExpand all lines: sdk/cognitivelanguage/azure-ai-language-questionanswering/azure/ai/language/questionanswering/aio/_question_answering_client.py
+3Lines changed: 3 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -27,6 +27,8 @@ class QuestionAnsweringClient(QuestionAnsweringClientOperationsMixin):
27
27
:type endpoint: str
28
28
:param credential: Credential needed for the client to connect to Azure.
0 commit comments