1
0
mirror of https://github.com/chatopera/cosin.git synced 2025-08-01 16:38:02 +08:00

https://github.com/chatopera/cosin/issues/344 upgrade chatopera sdk, rename faq threshold params

This commit is contained in:
Hai Liang Wang 2020-07-20 11:59:38 +08:00
parent 994cbb371d
commit 0b9dbec7fd
2 changed files with 4 additions and 4 deletions

View File

@ -373,7 +373,7 @@
<dependency> <dependency>
<groupId>com.chatopera.bot</groupId> <groupId>com.chatopera.bot</groupId>
<artifactId>sdk</artifactId> <artifactId>sdk</artifactId>
<version>3.0.1</version> <version>3.1.0</version>
</dependency> </dependency>
</dependencies> </dependencies>

View File

@ -59,10 +59,10 @@ public class ChatbotEventSubscription {
ChatbotConstants.BOT_PROVIDER, ChatbotConstants.DEFAULT_BOT_PROVIDER); ChatbotConstants.BOT_PROVIDER, ChatbotConstants.DEFAULT_BOT_PROVIDER);
// FAQ最佳回复阀值 // FAQ最佳回复阀值
private final static double thresholdFaqBestReply = Double.parseDouble(SystemEnvHelper.getenv( private final static double faqBestReplyThreshold = Double.parseDouble(SystemEnvHelper.getenv(
ChatbotConstants.THRESHOLD_FAQ_BEST_REPLY, "0.8")); ChatbotConstants.THRESHOLD_FAQ_BEST_REPLY, "0.8"));
// FAQ建议回复阀值 // FAQ建议回复阀值
private final static double thresholdFaqSuggReply = Double.parseDouble(SystemEnvHelper.getenv( private final static double faqSuggReplyThreshold = Double.parseDouble(SystemEnvHelper.getenv(
ChatbotConstants.THRESHOLD_FAQ_SUGG_REPLY, "0.6")); ChatbotConstants.THRESHOLD_FAQ_SUGG_REPLY, "0.6"));
@Autowired @Autowired
@ -98,7 +98,7 @@ public class ChatbotEventSubscription {
com.chatopera.bot.sdk.Chatbot bot = new com.chatopera.bot.sdk.Chatbot( com.chatopera.bot.sdk.Chatbot bot = new com.chatopera.bot.sdk.Chatbot(
c.getClientId(), c.getSecret(), botServiecProvider); c.getClientId(), c.getSecret(), botServiecProvider);
JSONObject result = bot.conversation( JSONObject result = bot.conversation(
request.getUserid(), request.getMessage(), thresholdFaqBestReply, thresholdFaqSuggReply); request.getUserid(), request.getMessage(), faqBestReplyThreshold, faqSuggReplyThreshold);
// parse response // parse response
if (result != null) { if (result != null) {