Skip to content

Commit

Permalink
[cognitivelanguage] add live pipeline (#20986)
Browse files Browse the repository at this point in the history
  • Loading branch information
iscai-msft authored Oct 1, 2021
1 parent 848cc57 commit 3f2a011
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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?",
Expand All @@ -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]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down
35 changes: 8 additions & 27 deletions sdk/cognitivelanguage/tests.yml
Original file line number Diff line number Diff line change
@@ -1,43 +1,24 @@
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
EnvVars:
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

0 comments on commit 3f2a011

Please sign in to comment.