Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ async def sample_conv_summarization_async():
endpoint = os.environ["AZURE_CONVERSATIONS_ENDPOINT"]
key = os.environ["AZURE_CONVERSATIONS_KEY"]

# analyze quey
# analyze query
client = ConversationAnalysisClient(endpoint, AzureKeyCredential(key))
async with client:
poller = await client.begin_conversation_analysis(
Expand All @@ -48,18 +48,21 @@ async def sample_conv_summarization_async():
"text": "Hello, how can I help you?",
"modality": "text",
"id": "1",
"role": "Agent",
"participantId": "Agent"
},
{
"text": "How to upgrade Office? I am getting error messages the whole day.",
"modality": "text",
"id": "2",
"role": "Customer",
"participantId": "Customer"
},
{
"text": "Press the upgrade button please. Then sign in and follow the instructions.",
"modality": "text",
"id": "3",
"role": "Agent",
"participantId": "Agent"
}
],
Expand All @@ -74,7 +77,7 @@ async def sample_conv_summarization_async():
"taskName": "analyze 1",
"kind": "ConversationalSummarizationTask",
"parameters": {
"summaryAspects": ["Issue, Resolution"]
"summaryAspects": ["issue", "resolution"]
}
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def sample_conv_summarization():
endpoint = os.environ["AZURE_CONVERSATIONS_ENDPOINT"]
key = os.environ["AZURE_CONVERSATIONS_KEY"]

# analyze quey
# analyze query
client = ConversationAnalysisClient(endpoint, AzureKeyCredential(key))
with client:
poller = client.begin_conversation_analysis(
Expand All @@ -46,18 +46,21 @@ def sample_conv_summarization():
"text": "Hello, how can I help you?",
"modality": "text",
"id": "1",
"role": "Agent",
"participantId": "Agent"
},
{
"text": "How to upgrade Office? I am getting error messages the whole day.",
"modality": "text",
"id": "2",
"role": "Customer",
"participantId": "Customer"
},
{
"text": "Press the upgrade button please. Then sign in and follow the instructions.",
"modality": "text",
"id": "3",
"role": "Agent",
"participantId": "Agent"
}
],
Expand All @@ -72,7 +75,7 @@ def sample_conv_summarization():
"taskName": "analyze 1",
"kind": "ConversationalSummarizationTask",
"parameters": {
"summaryAspects": ["Issue, Resolution"]
"summaryAspects": ["issue", "resolution"]
}
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"Accept": "application/json",
"Accept-Encoding": "gzip, deflate",
"Connection": "keep-alive",
"Content-Length": "692",
"Content-Length": "748",
"Content-Type": "application/json",
"Ocp-Apim-Subscription-Key": "0000000000000000",
"User-Agent": "azsdk-python-ai-language-conversations/1.1.0b3 Python/3.10.0 (Windows-10-10.0.22621-SP0)"
Expand All @@ -22,18 +22,21 @@
"text": "Hello, how can I help you?",
"modality": "text",
"id": "1",
"role": "Agent",
"participantId": "Agent"
},
{
"text": "How to upgrade Office? I am getting error messages the whole day.",
"modality": "text",
"id": "2",
"role": "Customer",
"participantId": "Customer"
},
{
"text": "Press the upgrade button please. Then sign in and follow the instructions.",
"modality": "text",
"id": "3",
"role": "Agent",
"participantId": "Agent"
}
],
Expand All @@ -49,26 +52,28 @@
"kind": "ConversationalSummarizationTask",
"parameters": {
"summaryAspects": [
"Issue, Resolution"
"Issue",
"Resolution"
]
}
}
]
},
"StatusCode": 202,
"ResponseHeaders": {
"apim-request-id": "3f5270da-dc02-43b5-bc36-7e6644bdd1f2",
"apim-request-id": "2e91b606-9082-496b-a546-dbdebd082072",
"Content-Length": "0",
"Date": "Mon, 17 Oct 2022 22:09:58 GMT",
"operation-location": "https://test-resource.api.cognitive.microsoft.com/language/analyze-conversations/jobs/2b72ef0f-d157-4f53-ad76-bcd05260cd0d?api-version=2022-10-01-preview",
"Date": "Fri, 21 Oct 2022 00:17:28 GMT",
"operation-location": "https://test-resource.api.cognitive.microsoft.com/language/analyze-conversations/jobs/64be3414-83c9-4105-ab1c-4bb1350d2e19?api-version=2022-10-01-preview",
"Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload",
"X-Content-Type-Options": "nosniff",
"x-envoy-upstream-service-time": "130"
"x-envoy-upstream-service-time": "144",
"x-ms-region": "UK South"
},
"ResponseBody": null
},
{
"RequestUri": "https://test-resource.api.cognitive.microsoft.com/language/analyze-conversations/jobs/2b72ef0f-d157-4f53-ad76-bcd05260cd0d?api-version=2022-10-01-preview",
"RequestUri": "https://test-resource.api.cognitive.microsoft.com/language/analyze-conversations/jobs/64be3414-83c9-4105-ab1c-4bb1350d2e19?api-version=2022-10-01-preview",
"RequestMethod": "GET",
"RequestHeaders": {
"Accept": "*/*",
Expand All @@ -80,19 +85,20 @@
"RequestBody": null,
"StatusCode": 200,
"ResponseHeaders": {
"apim-request-id": "c67b4ae9-1818-4816-bba6-f3d51561763e",
"apim-request-id": "947ee134-b200-4631-8e79-c42b208b53cb",
"Content-Length": "330",
"Content-Type": "application/json; charset=utf-8",
"Date": "Mon, 17 Oct 2022 22:09:58 GMT",
"Date": "Fri, 21 Oct 2022 00:17:28 GMT",
"Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload",
"X-Content-Type-Options": "nosniff",
"x-envoy-upstream-service-time": "8"
"x-envoy-upstream-service-time": "13",
"x-ms-region": "UK South"
},
"ResponseBody": {
"jobId": "2b72ef0f-d157-4f53-ad76-bcd05260cd0d",
"lastUpdatedDateTime": "2022-10-17T22:09:59Z",
"createdDateTime": "2022-10-17T22:09:59Z",
"expirationDateTime": "2022-10-18T22:09:59Z",
"jobId": "64be3414-83c9-4105-ab1c-4bb1350d2e19",
"lastUpdatedDateTime": "2022-10-21T00:17:28Z",
"createdDateTime": "2022-10-21T00:17:28Z",
"expirationDateTime": "2022-10-22T00:17:28Z",
"status": "notStarted",
"errors": [],
"displayName": "Analyze conversations from xxx",
Expand All @@ -106,7 +112,7 @@
}
},
{
"RequestUri": "https://test-resource.api.cognitive.microsoft.com/language/analyze-conversations/jobs/2b72ef0f-d157-4f53-ad76-bcd05260cd0d?api-version=2022-10-01-preview",
"RequestUri": "https://test-resource.api.cognitive.microsoft.com/language/analyze-conversations/jobs/64be3414-83c9-4105-ab1c-4bb1350d2e19?api-version=2022-10-01-preview",
"RequestMethod": "GET",
"RequestHeaders": {
"Accept": "*/*",
Expand All @@ -118,19 +124,20 @@
"RequestBody": null,
"StatusCode": 200,
"ResponseHeaders": {
"apim-request-id": "bba29e4f-29ec-4047-9963-98a34531598c",
"Content-Length": "807",
"apim-request-id": "ade6d7d8-8304-4cae-9d0d-1fcf441eafa0",
"Content-Length": "801",
"Content-Type": "application/json; charset=utf-8",
"Date": "Mon, 17 Oct 2022 22:10:04 GMT",
"Date": "Fri, 21 Oct 2022 00:17:33 GMT",
"Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload",
"X-Content-Type-Options": "nosniff",
"x-envoy-upstream-service-time": "31"
"x-envoy-upstream-service-time": "211",
"x-ms-region": "UK South"
},
"ResponseBody": {
"jobId": "2b72ef0f-d157-4f53-ad76-bcd05260cd0d",
"lastUpdatedDateTime": "2022-10-17T22:10:00Z",
"createdDateTime": "2022-10-17T22:09:59Z",
"expirationDateTime": "2022-10-18T22:09:59Z",
"jobId": "64be3414-83c9-4105-ab1c-4bb1350d2e19",
"lastUpdatedDateTime": "2022-10-21T00:17:31Z",
"createdDateTime": "2022-10-21T00:17:28Z",
"expirationDateTime": "2022-10-22T00:17:28Z",
"status": "succeeded",
"errors": [],
"displayName": "Analyze conversations from xxx",
Expand All @@ -143,32 +150,19 @@
{
"kind": "conversationalSummarizationResults",
"taskName": "analyze 1",
"lastUpdateDateTime": "2022-10-17T22:10:00.8411219Z",
"lastUpdateDateTime": "2022-10-21T00:17:31.3219791Z",
"status": "succeeded",
"results": {
"conversations": [
{
"summaries": [
{
"aspect": "chapterTitle",
"text": "How to Upgrade Office",
"contexts": [
{
"conversationItemId": "1",
"offset": 0,
"length": 26
},
{
"conversationItemId": "2",
"offset": 0,
"length": 65
},
{
"conversationItemId": "3",
"offset": 0,
"length": 74
}
]
"aspect": "issue",
"text": "Customer wants to upgrade Office. | Customer is getting error messages."
},
{
"aspect": "resolution",
"text": "Advised to press the upgrade button. | Then sign in and follow the instructions."
}
],
"id": "conversation1",
Expand Down
Loading