From 3f2a011f223aeb9668f1f5a7a86b985961002090 Mon Sep 17 00:00:00 2001 From: iscai-msft <43154838+iscai-msft@users.noreply.github.com> Date: Thu, 30 Sep 2021 20:04:37 -0400 Subject: [PATCH] [cognitivelanguage] add live pipeline (#20986) --- .../samples/sample_chat.py | 8 ++--- .../samples/sample_query_text.py | 4 +-- sdk/cognitivelanguage/tests.yml | 35 +++++-------------- 3 files changed, 14 insertions(+), 33 deletions(-) diff --git a/sdk/cognitivelanguage/azure-ai-language-questionanswering/samples/sample_chat.py b/sdk/cognitivelanguage/azure-ai-language-questionanswering/samples/sample_chat.py index f7a065b77179..033c59be5529 100644 --- a/sdk/cognitivelanguage/azure-ai-language-questionanswering/samples/sample_chat.py +++ b/sdk/cognitivelanguage/azure-ai-language-questionanswering/samples/sample_chat.py @@ -51,8 +51,8 @@ def sample_chit_chat(): deployment_name="test" ) best_candidate = [a for a in output.answers if a.confidence_score > 0.9][0] - print("Q: {}".format(first_question.question)) - print("A: {}".format(best_candidate.answer)) + print(u"Q: {}".format(first_question.question)) + print(u"A: {}".format(best_candidate.answer)) followup_question = qna.QueryKnowledgeBaseOptions( question="How long it takes to charge Surface?", @@ -75,8 +75,8 @@ def sample_chit_chat(): project_name=knowledge_base_project, deployment_name="test" ) - print("Q: {}".format(followup_question.question)) - print("A: {}".format(output.answers[0].answer)) + print(u"Q: {}".format(followup_question.question)) + print(u"A: {}".format(output.answers[0].answer)) # [END chit_chat] diff --git a/sdk/cognitivelanguage/azure-ai-language-questionanswering/samples/sample_query_text.py b/sdk/cognitivelanguage/azure-ai-language-questionanswering/samples/sample_query_text.py index 6d3cc65baafe..c394cf640c91 100644 --- a/sdk/cognitivelanguage/azure-ai-language-questionanswering/samples/sample_query_text.py +++ b/sdk/cognitivelanguage/azure-ai-language-questionanswering/samples/sample_query_text.py @@ -50,8 +50,8 @@ def sample_query_text(): output = client.query_text(input) best_answer = [a for a in output.answers if a.confidence_score > 0.9][0] - print("Q: {}".format(input.question)) - print("A: {}".format(best_answer.answer)) + print(u"Q: {}".format(input.question)) + print(u"A: {}".format(best_answer.answer)) # [END query_text] diff --git a/sdk/cognitivelanguage/tests.yml b/sdk/cognitivelanguage/tests.yml index 77ea573acbbc..cbe99bfbe34a 100644 --- a/sdk/cognitivelanguage/tests.yml +++ b/sdk/cognitivelanguage/tests.yml @@ -1,33 +1,10 @@ -trigger: - branches: - include: - - master - - main - - hotfix/* - - release/* - - restapi* - paths: - include: - - sdk/cognitivelanguage/ - - scripts/ - -pr: - branches: - include: - - master - - main - - feature/* - - hotfix/* - - release/* - - restapi* - paths: - include: - - sdk/cognitivelanguage/ +trigger: none stages: - template: ../../eng/pipelines/templates/stages/archetype-sdk-tests.yml parameters: AllocateResourceGroup: false + BuildTargetingString: azure* ServiceDirectory: cognitivelanguage MatrixReplace: - TestSamples=.*/true @@ -35,9 +12,13 @@ stages: AZURE_QUESTIONANSWERING_KEY: $(qna-key) AZURE_QUESTIONANSWERING_PROJECT: 190a9e13-8ede-4e4b-a8fd-c4d7f2aeab6c AZURE_QUESTIONANSWERING_ENDPOINT: $(qna-uri) + AZURE_CONVERSATIONS_ENDPOINT: $(conversations-endpoint) + AZURE_CONVERSATIONS_KEY: $(conversations-key) + AZURE_CONVERSATIONS_PROJECT: $(conversations-project) + AZURE_CONVERSATIONS_WORKFLOW_PROJECT: $(conversations-workflow-project) AZURE_CLIENT_ID: $(aad-azure-sdk-test-client-id) AZURE_CLIENT_SECRET: $(aad-azure-sdk-test-client-secret) AZURE_SUBSCRIPTION_ID: $(azure-subscription-id) AZURE_TENANT_ID: $(aad-azure-sdk-test-tenant-id) - TEST_MODE: 'RunLiveNoRecord' # use when allowing preparers to create the rgs for you - AZURE_TEST_RUN_LIVE: 'true' # use when utilizing the New-TestResources Script + TEST_MODE: "RunLiveNoRecord" # use when allowing preparers to create the rgs for you + AZURE_TEST_RUN_LIVE: "true" # use when utilizing the New-TestResources Script