Skip to content
This repository was archived by the owner on Dec 4, 2023. It is now read-only.
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 @@ -33,7 +33,6 @@
import java.util.concurrent.CompletableFuture;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.google.common.base.Strings;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -91,15 +90,15 @@ public QnAMaker(
}
this.endpoint = withEndpoint;

if (Strings.isNullOrEmpty(this.endpoint.getKnowledgeBaseId())) {
if (StringUtils.isBlank(this.endpoint.getKnowledgeBaseId())) {
throw new IllegalArgumentException("knowledgeBaseId");
}

if (Strings.isNullOrEmpty(this.endpoint.getHost())) {
if (StringUtils.isBlank(this.endpoint.getHost())) {
throw new IllegalArgumentException("host");
}

if (Strings.isNullOrEmpty(this.endpoint.getEndpointKey())) {
if (StringUtils.isBlank(this.endpoint.getEndpointKey())) {
throw new IllegalArgumentException("endpointKey");
}

Expand Down Expand Up @@ -222,7 +221,7 @@ public CompletableFuture<QueryResults> getAnswersRaw(
return Async.completeExceptionally(new IllegalArgumentException("Activity type is not a message"));
}

if (Strings.isNullOrEmpty(turnContext.getActivity().getText())) {
if (StringUtils.isBlank(turnContext.getActivity().getText())) {
return Async.completeExceptionally(new IllegalArgumentException("Null or empty text"));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class FeedbackRecord {
private Integer qnaId;

/**
* Gets the feedback recod's user ID.
* Gets the feedback record's user ID.
*
* @return The user ID.
*/
Expand All @@ -28,7 +28,7 @@ public String getUserId() {
}

/**
* Sets the feedback recod's user ID.
* Sets the feedback record's user ID.
*
* @param withUserId The user ID.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
* Class to bind activities.
*/
public class BindToActivity {
private Activity activity;
private final Activity activity;

/**
* Construct to bind an Activity.
*
*
* @param withActivity activity to bind.
*/
public BindToActivity(Activity withActivity) {
Expand All @@ -37,7 +37,7 @@ public CompletableFuture<Activity> bind(DialogContext context, @Nullable Object

/**
* Get the activity text.
*
*
* @return The activity text.
*/
public String toString() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
* Helper for HTTP requests.
*/
public class HttpRequestUtils {
private OkHttpClient httpClient = new OkHttpClient();
private final OkHttpClient httpClient = new OkHttpClient();

/**
* Execute Http request.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ public void returnAnswersWithIntents() {

private String readFileContent (String fileName) throws IOException {
String path = Paths.get("", "src", "test", "java", "com", "microsoft", "bot", "ai", "qna",
"testData", fileName).toAbsolutePath().toString();
"testdata", fileName).toAbsolutePath().toString();
File file = new File(path);
return FileUtils.readFileToString(file, "utf-8");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1109,7 +1109,7 @@ public void qnaMakerTestOptionsHydration() {

QnAMakerOptions allChangedRequestOptions = new QnAMakerOptions();
allChangedRequestOptions.setTop(2000);
allChangedRequestOptions.setScoreThreshold(0.4f);
allChangedRequestOptions.setScoreThreshold(0.42f);
allChangedRequestOptions.setStrictFilters(allChangedRequestOptionsFilters);

QnAMaker qna = new QnAMaker(qnAMakerEndpoint, noFiltersOptions);
Expand Down