Skip to content
This repository has been archived by the owner on Dec 4, 2023. It is now read-only.

[Samples] Add 11.qnamaker bot sample #1023

Merged

Conversation

Batta32
Copy link
Contributor

@Batta32 Batta32 commented Feb 26, 2021

Fixes #864

Description

We are adding the sample 11.qnamaker in Java taking into account the C# 11.qnamaker bot present in BotBuilder-Samples repository.

Specific Changes

  • Generate main structure of the sample
  • Add resources folder with sample questions tsv
  • Add deploymentTemplates folder
  • Add root files
  • Add application.properties
  • Add LICENSE document
  • Add README document to describe the steps to run the sample

Testing

Current behavior of the Java migrated sample
image

matiasroldan6 and others added 11 commits February 19, 2021 13:57
* Add deploymentTemplates folder

* Fix templates
* Add qnabot class

* Add pom

* Add feedback changes

* Remove join() calls
* Add Application class

* Implement the use of ConfigurationCredentialProvider

* Apply feedback
};

// The actual call to the QnA Maker service.
qnaMaker.getAnswers(turnContext, options).thenAccept(response -> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be:

        // The actual call to the QnA Maker service.
        return qnaMaker.getAnswers(turnContext, options)
            .thenCompose(response -> {
                if (response != null && response.length > 0) {
                    return turnContext.sendActivity(MessageFactory.text(response[0].getAnswer()))
                        .thenApply(sendResult -> null);
                }
                else {
                    return turnContext.sendActivity(MessageFactory.text("No QnA Maker answers were found."))
                        .thenApply(sendResult -> null);
                }
            });

@@ -0,0 +1,42 @@
{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

new-rg-parameters.json can be removed.

@@ -0,0 +1,39 @@
{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

preexisting-rg-parameters.json can be removed.

@@ -0,0 +1,183 @@
{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update template-with-new-rg.json with version from 02.echo-bot

@@ -0,0 +1,154 @@
{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update template-with-preexisting-rg.json with version from 02.echo-bot

@tracyboehrer
Copy link
Member

@Batta32 Also need to update from main

@Batta32
Copy link
Contributor Author

Batta32 commented Feb 26, 2021

Thanks @tracyboehrer for your feedback. We will be applying the requested changes right now!

matiasroldan6 added a commit to southworks/botbuilder-java that referenced this pull request Feb 26, 2021
@Batta32
Copy link
Contributor Author

Batta32 commented Feb 26, 2021

@tracyboehrer - we already applied the requested changes and merged main into this branch 😊.

@tracyboehrer tracyboehrer merged commit f84e1da into microsoft:main Feb 26, 2021
@Batta32 Batta32 deleted the feature/southworks/samples/11qnamaker branch March 1, 2021 12:09
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sample: 11.qnamaker
4 participants