pyaiml21.botconfig.config.BotConfig

class pyaiml21.botconfig.config.BotConfig(predicate_defaults: typing.Dict[str, str] = <factory>, sets: typing.Dict[str, typing.Set[str]] = <factory>, maps: typing.Dict[str, typing.Mapping[str, str]] = <factory>, gossip_filename: typing.Optional[str] = None, learnf_file: str = './learnf.aiml')[source][source]

Dataclass that contains all configuration files of the bot.

The only missing is its knowledge (which is saved in the graphmaster).

Methods

Attributes

default_answer

Reply returned when the interpretation fails.

default_predicate

Default value of the _predicate.

denormalize

Substitutions used with <denormalize> tag.

gender

Substitutions used with <gender> tag.

gossip_filename

Absolute path to file where to store <gossip/>.

learnf_file

Path to file where to store <learnf/>.

normalize

Substitutions used with <normalize> tag.

person

Substitutions used with <person> tag.

person2

Substitutions used with <person2> tag.

properties

Bot properties.

predicate_defaults

Default values for the predicates.

sets

Mapping from set name to the set - AIML 2.x sets.

maps

Mapping from map name to the map - AIML 2.x maps.

default_answer = 'I have no answer for that.'[source]

Reply returned when the interpretation fails.

default_predicate = 'unknown'[source]

Default value of the _predicate.

When no _predicate with corresponding name is found in session.predicates or in self.predicate_defaults, this is the value that will be used.

denormalize = <pyaiml21.botconfig.substitutions.Substitutions object>[source]

Substitutions used with <denormalize> tag.

gender = <pyaiml21.botconfig.substitutions.Substitutions object>[source]

Substitutions used with <gender> tag.

gossip_filename: Optional[str] = None[source]

Absolute path to file where to store <gossip/>.

If no path is provided, the contents of <gossip> are discarded, as this tag produces no output. The file be be created, if not exists at the first encounter of <gossip> tag.

learnf_file: str = './learnf.aiml'[source]

Path to file where to store <learnf/>.

This file, if not exists, will be created at the first encounter of <learnf/> tag during evaluation.

maps: Dict[str, Mapping[str, str]][source]

Mapping from map name to the map - AIML 2.x maps.

Bot’s maps. Used at the evaluation of <map> tag. As the argument of dictionary has type mapping, it is enough to provide an object inheriting from collections.abs.Mapping, e.g. see implementation of standard maps in /stdlib/.

normalize = <pyaiml21.botconfig.substitutions.Substitutions object>[source]

Substitutions used with <normalize> tag.

person = <pyaiml21.botconfig.substitutions.Substitutions object>[source]

Substitutions used with <person> tag.

person2 = <pyaiml21.botconfig.substitutions.Substitutions object>[source]

Substitutions used with <person2> tag.

predicate_defaults: Dict[str, str][source]

Default values for the predicates.

If during the evaluation, <get name=”_predicate”> is called and there is no _predicate in current user session with this name, the value from this dict will be used.

properties = <pyaiml21.botconfig.misc.Properties object>[source]

Bot properties.

sets: Dict[str, Set[str]][source]

Mapping from set name to the set - AIML 2.x sets.

Bot’s sets, used to evaluate pattern-side <set>. Is is enough to load them after the .aiml files, as the parsing and storing to graphmaster does not require the sets to exist.