forked from Azure/azure-sdk-for-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
255614b
commit 2522ff3
Showing
4 changed files
with
185 additions
and
2 deletions.
There are no files selected for viewing
66 changes: 66 additions & 0 deletions
66
...nanswering/tests/recordings/test_query_knowledgebase.test_query_knowledgebase_filter.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
interactions: | ||
- request: | ||
body: '{"question": "Battery life", "top": 3, "filters": {"metadataFilter": {"metadata": | ||
[["explicitlytaggedheading", "check the battery level"], ["explicitlytaggedheading", | ||
"make your battery last"]]}, "logicalOperation": "OR"}}' | ||
headers: | ||
Accept: | ||
- application/json | ||
Accept-Encoding: | ||
- gzip, deflate | ||
Connection: | ||
- keep-alive | ||
Content-Length: | ||
- '222' | ||
Content-Type: | ||
- application/json | ||
User-Agent: | ||
- azsdk-python-ai-language-questionanswering/1.0.0b2 Python/3.9.5 (macOS-11.5.2-x86_64-i386-64bit) | ||
method: POST | ||
uri: https://test-resource.api.cognitive.microsoft.com/language/:query-knowledgebases?projectName=test-project&deploymentName=test&api-version=2021-07-15-preview | ||
response: | ||
body: | ||
string: "{\n \"answers\": [\n {\n \"questions\": [\n \"Check | ||
the battery level\"\n ],\n \"answer\": \"**Check the battery level**\\n\\nYou | ||
can check the battery level from the lock screen or the desktop:\",\n \"confidenceScore\": | ||
0.6905,\n \"id\": 24,\n \"source\": \"surface-pro-4-user-guide-EN.pdf\",\n | ||
\ \"metadata\": {\n \"explicitlytaggedheading\": \"check the battery | ||
level\"\n },\n \"dialog\": {\n \"isContextOnly\": false,\n | ||
\ \"prompts\": []\n }\n },\n {\n \"questions\": [\n | ||
\ \"Make your battery last\"\n ],\n \"answer\": \"**Make your | ||
battery last**\\n\\nFor info on how to care for your battery and power supply, | ||
conserve power, and make your Surface battery last longer, see [Surface battery | ||
and power](http://www.microsoft.com/surface/support/hardware-and-drivers/battery-and-power) | ||
on Surface.com.\",\n \"confidenceScore\": 0.5818,\n \"id\": 27,\n | ||
\ \"source\": \"surface-pro-4-user-guide-EN.pdf\",\n \"metadata\": | ||
{\n \"explicitlytaggedheading\": \"make your battery last\"\n },\n | ||
\ \"dialog\": {\n \"isContextOnly\": false,\n \"prompts\": | ||
[]\n }\n },\n {\n \"questions\": [\n \"Desktop taskbar.\"\n | ||
\ ],\n \"answer\": \"**Desktop taskbar.**\\n\\nBattery status appears | ||
at the right side of the taskbar. Select the battery icon for info about the | ||
charging and battery status, including the percent remaining. \u272A\",\n | ||
\ \"confidenceScore\": 0.36340000000000006,\n \"id\": 26,\n \"source\": | ||
\"surface-pro-4-user-guide-EN.pdf\",\n \"metadata\": {},\n \"dialog\": | ||
{\n \"isContextOnly\": false,\n \"prompts\": []\n }\n }\n | ||
\ ]\n}" | ||
headers: | ||
apim-request-id: | ||
- d3b7407a-57b7-49c1-af6e-b6fc494f4bdb | ||
content-length: | ||
- '1622' | ||
content-type: | ||
- application/json; charset=utf-8 | ||
csp-billing-usage: | ||
- CognitiveServices.TextAnalytics.QuestionAnsweringTextRecords=1 | ||
date: | ||
- Thu, 30 Sep 2021 15:37:25 GMT | ||
strict-transport-security: | ||
- max-age=31536000; includeSubDomains; preload | ||
x-content-type-options: | ||
- nosniff | ||
x-envoy-upstream-service-time: | ||
- '902' | ||
status: | ||
code: 200 | ||
message: OK | ||
version: 1 |
55 changes: 55 additions & 0 deletions
55
...ring/tests/recordings/test_query_knowledgebase_async.test_query_knowledgebase_filter.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
interactions: | ||
- request: | ||
body: '{"question": "Battery life", "top": 3, "filters": {"metadataFilter": {"metadata": | ||
[["explicitlytaggedheading", "check the battery level"], ["explicitlytaggedheading", | ||
"make your battery last"]]}, "logicalOperation": "OR"}}' | ||
headers: | ||
Accept: | ||
- application/json | ||
Content-Length: | ||
- '222' | ||
Content-Type: | ||
- application/json | ||
User-Agent: | ||
- azsdk-python-ai-language-questionanswering/1.0.0b2 Python/3.9.5 (macOS-11.5.2-x86_64-i386-64bit) | ||
method: POST | ||
uri: https://test-resource.api.cognitive.microsoft.com/language/:query-knowledgebases?projectName=test-project&deploymentName=test&api-version=2021-07-15-preview | ||
response: | ||
body: | ||
string: "{\n \"answers\": [\n {\n \"questions\": [\n \"Check | ||
the battery level\"\n ],\n \"answer\": \"**Check the battery level**\\n\\nYou | ||
can check the battery level from the lock screen or the desktop:\",\n \"confidenceScore\": | ||
0.6905,\n \"id\": 24,\n \"source\": \"surface-pro-4-user-guide-EN.pdf\",\n | ||
\ \"metadata\": {\n \"explicitlytaggedheading\": \"check the battery | ||
level\"\n },\n \"dialog\": {\n \"isContextOnly\": false,\n | ||
\ \"prompts\": []\n }\n },\n {\n \"questions\": [\n | ||
\ \"Make your battery last\"\n ],\n \"answer\": \"**Make your | ||
battery last**\\n\\nFor info on how to care for your battery and power supply, | ||
conserve power, and make your Surface battery last longer, see [Surface battery | ||
and power](http://www.microsoft.com/surface/support/hardware-and-drivers/battery-and-power) | ||
on Surface.com.\",\n \"confidenceScore\": 0.5818,\n \"id\": 27,\n | ||
\ \"source\": \"surface-pro-4-user-guide-EN.pdf\",\n \"metadata\": | ||
{\n \"explicitlytaggedheading\": \"make your battery last\"\n },\n | ||
\ \"dialog\": {\n \"isContextOnly\": false,\n \"prompts\": | ||
[]\n }\n },\n {\n \"questions\": [\n \"Desktop taskbar.\"\n | ||
\ ],\n \"answer\": \"**Desktop taskbar.**\\n\\nBattery status appears | ||
at the right side of the taskbar. Select the battery icon for info about the | ||
charging and battery status, including the percent remaining. \u272A\",\n | ||
\ \"confidenceScore\": 0.36340000000000006,\n \"id\": 26,\n \"source\": | ||
\"surface-pro-4-user-guide-EN.pdf\",\n \"metadata\": {},\n \"dialog\": | ||
{\n \"isContextOnly\": false,\n \"prompts\": []\n }\n }\n | ||
\ ]\n}" | ||
headers: | ||
apim-request-id: c381395f-d6a2-4c9c-9cd8-f80373269209 | ||
content-length: '1622' | ||
content-type: application/json; charset=utf-8 | ||
csp-billing-usage: CognitiveServices.TextAnalytics.QuestionAnsweringTextRecords=1 | ||
date: Thu, 30 Sep 2021 15:37:26 GMT | ||
strict-transport-security: max-age=31536000; includeSubDomains; preload | ||
x-content-type-options: nosniff | ||
x-envoy-upstream-service-time: '384' | ||
status: | ||
code: 200 | ||
message: OK | ||
url: https://wuppe.api.cognitive.microsoft.com/language/:query-knowledgebases?projectName=190a9e13-8ede-4e4b-a8fd-c4d7f2aeab6c&deploymentName=test&api-version=2021-07-15-preview | ||
version: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters