From 9581374412e4f53a7332a06974cbe30decf1ee51 Mon Sep 17 00:00:00 2001 From: bobloy Date: Wed, 29 Aug 2018 09:42:30 -0400 Subject: [PATCH] More logic stuff --- chatter/chat.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/chatter/chat.py b/chatter/chat.py index 57dadf7..0cbd9c4 100644 --- a/chatter/chat.py +++ b/chatter/chat.py @@ -9,6 +9,7 @@ from redbot.core.data_manager import cog_data_path from chatter.chatterbot import ChatBot from chatter.chatterbot.comparisons import levenshtein_distance +from chatter.chatterbot.response_selection import get_first_response from chatter.chatterbot.trainers import ListTrainer @@ -32,7 +33,16 @@ class Chatter: "ChatterBot", storage_adapter='chatter.chatterbot.storage.SQLStorageAdapter', database=str(data_path), - statement_comparison_function=levenshtein_distance + statement_comparison_function=levenshtein_distance, + response_selection_method=get_first_response, + logic_adapters=[ + 'chatter.chatterbot.logic.BestMatch', + { + 'import_path': 'chatter.chatterbot.logic.LowConfidenceAdapter', + 'threshold': 0.65, + 'default_response': ':thinking:' + } + ] ) self.chatbot.set_trainer(ListTrainer)