configuration#

Load environment variables and validation of project configurations from user

class src.configuration.DelimitedTemplate(template)[source]#

This class allow the creation of a template with a user defined separator. The package is there to define templates for texts and then substitute them with certain values. :param Template: Basic class that is inherited :type Template: _type_

class src.configuration.CharacterContext[source]#

Class to specify the character context for processing.

async input_valid_character()[source]#

Checks if character are available for selection.

Returns:

Character available

Return type:

bool

class src.configuration.GenreContext[source]#

Class to specify the genre context for processing.

async input_valid_genre()[source]#

Checks if genre are available for selection.

Returns:

Genre available

Return type:

bool

class src.configuration.UserContext[source]#

Class to specify the user context and input data for processing.

async input_valid_char()[source]#

Checks if character are available for selection.

Returns:

Character available

Return type:

bool

class src.configuration.GameContext[source]#

Class to specify the game context and input data for processing.

async input_valid_game()[source]#

Checks if games are available for selection.

Returns:

Games available

Return type:

bool

async request_game_start()[source]#

Checks if a game start is requested, based on the selected game status.

Returns:

Game start is requested.

Return type:

bool

class src.configuration.StoryContext[source]#

Class to specify the story context and input data for processing.

events_available()[source]#

Checks if events are available.

Returns:

Events available

Return type:

bool

async get_random_event_weighted()[source]#

Function selecting a random event based on the weights defined in the database for the tale’s genre.

async get_random_insp_word_weighted()[source]#

Function selecting a random inspirational word based on the weights defined in the database for the tale’s genre.

Return type:

INSPIRATIONALWORD

insp_words_not_available()[source]#

Function checks

Returns:

_description_

Return type:

bool

async get_fiction_prompt()[source]#

This function create the fiction prompt based on saved attributes and input from user.

Returns:

Fiction prompt

Return type:

str

class src.configuration.StoryStartContext[source]#

Class to specify the story start context and input data for processing.

class src.configuration.GameStartContext[source]#

Class to specify the game start context and input data for processing.

class src.configuration.ProcessInput[source]#

Combined class to hold all context and input data for processing.

class src.configuration.DcConfiguration(bot_token=Raise(), historian_role_id=0, storyteller_role_id=0, everyone_role_id=0)[source]#

Configuration model for the discord

class src.configuration.EnvConfiguration(api_key='ollama', base_url='localhost:11434/v1', model='llama3.2:3b', gen_req=Raise(), watcher=Raise(), db=Raise(), dc=Raise())[source]#

Configuration class for the entire application, grouping all sub-configurations.

class src.configuration.Configuration(config)[source]#

Genral configuration class for the entire application. Combines all sub-configurations and initializes the database engine and session.