MCPcopy
hub / github.com/gunthercox/ChatterBot / remove

Method remove

chatterbot/storage/sql_storage.py:151–166  ·  view source on GitHub ↗

Removes the statement that matches the input text. Removes any responses from statements where the response text matches the input text.

(self, statement_text)

Source from the content-addressed store, hash-verified

149 session.close()
150
151 def remove(self, statement_text):
152 """
153 Removes the statement that matches the input text.
154 Removes any responses from statements where the response text matches
155 the input text.
156 """
157 Statement = self.get_model('statement')
158 session = self.Session()
159 try:
160 query = session.query(Statement).filter_by(text=statement_text)
161 record = query.first()
162
163 session.delete(record)
164 session.commit()
165 finally:
166 session.close()
167
168 def filter(self, **kwargs):
169 """

Callers 1

closeMethod · 0.45

Calls 2

get_modelMethod · 0.80
closeMethod · 0.45

Tested by

no test coverage detected