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

Class Statement

chatterbot/ext/sqlalchemy_app/models.py:51–114  ·  view source on GitHub ↗

A Statement represents a sentence or phrase.

Source from the content-addressed store, hash-verified

49
50
51class Statement(Base, StatementMixin):
52 """
53 A Statement represents a sentence or phrase.
54 """
55
56 confidence = 0
57
58 text = Column(
59 String(constants.STATEMENT_TEXT_MAX_LENGTH)
60 )
61
62 search_text = Column(
63 String(constants.STATEMENT_TEXT_MAX_LENGTH),
64 nullable=False,
65 server_default=''
66 )
67
68 conversation = Column(
69 String(constants.CONVERSATION_LABEL_MAX_LENGTH),
70 nullable=False,
71 server_default=''
72 )
73
74 created_at = Column(
75 DateTime(timezone=True),
76 server_default=func.now()
77 )
78
79 tags = relationship(
80 'Tag',
81 secondary=lambda: tag_association_table,
82 backref='statements'
83 )
84
85 in_response_to = Column(
86 String(constants.STATEMENT_TEXT_MAX_LENGTH),
87 nullable=True
88 )
89
90 search_in_response_to = Column(
91 String(constants.STATEMENT_TEXT_MAX_LENGTH),
92 nullable=False,
93 server_default=''
94 )
95
96 persona = Column(
97 String(constants.PERSONA_MAX_LENGTH),
98 nullable=False,
99 server_default=''
100 )
101
102 def get_tags(self) -> list[str]:
103 """
104 Return a list of tags for this statement.
105 """
106 return [tag.name for tag in self.tags]
107
108 def add_tags(self, *tags):

Callers 6

createMethod · 0.90
create_manyMethod · 0.90
updateMethod · 0.90
createMethod · 0.50
create_manyMethod · 0.50

Calls

no outgoing calls

Tested by 1