-
Notifications
You must be signed in to change notification settings - Fork 3
CharactersManager
The Characters Manager ./src/characters_manager.py is a class that manages the currently active characters in the conversation after they've been loaded from the Character Database. The Characters Manager class has the following methods and properties:
-
__init__(self, conversation_manager): Initializes the Characters Manager. Theconversation_managerparameter is the conversation manager that the character manager is associated with. -
active_characters_list: Returns a list of all active characters. -
bios: Returns a paragraph comprised of all active characters bios. -
names: Returns a list of all active characters names. -
names_w_player: Returns a list of all active characters names with the player's name included. -
relationship_summary: Returns a paragraph comprised of all active characters relationship summaries. -
prompt_style: Returns the prompt style for the current conversation. -
language: Returns the language for the current conversation. -
replacement_dict: Returns a dictionary of replacement values for the current context. -
render_game_event(self, line): Render a game event line using the language file. -
active_character_count: Returns the number of active characters as an int. -
get_raw_prompt: Return the current context for the given active characters as a string. -
get_system_prompt: Return the current context for the given active characters as a string. -
get_character(self, info): Return a character object from the current character manager. -
add_message(self, msg): Add a message to all active characters. -
remove_from_conversation(self, character): Remove a character from the conversation. -
after_step(self): Perform an after step in the memory manager. Triggers this step in all active characters. -
before_step(self): Perform a before step in the memory manager. Triggers this step in all active characters. -
reached_conversation_limit(self): Perform an end of conversation step in the memory manager. Triggers this step in all active characters. -
get_memories(self): Return the memories for the current conversation. Gets the memories from all active characters. -
add_character(self, character_info): Add a character to the active characters list. -
memory_offset: Return the memory depth of the character. -
memory_offset_direction: Return the memory offset direction of the character.
Initializes the Characters Manager. The conversation_manager parameter is the conversation manager that the character manager is associated with. When creating a new Characters Manager, you should call the parent class's __init__ method to ensure that the default Characters Manager is loaded.
Return a list of all active characters.
Return a paragraph comprised of all active characters bios.
Return a list of all active characters names.
Return a list of all active characters names with the player's name included.
Return a paragraph comprised of all active characters relationship summaries.
Return the prompt style for the current conversation.
Return the language for the current conversation.
Return a dictionary of replacement values for the current context.
Render a game event line using the language file.
Return the number of active characters as an int.
Return the current context for the given active characters as a string.
Return the current context for the given active characters as a string.
Return a character object from the current character manager.
Add a message to all active characters.
Remove a character from the conversation.
Perform an after step in the memory manager. Triggers this step in all active characters.
Perform a before step in the memory manager. Triggers this step in all active characters.
Perform an end of conversation step in the memory manager. Triggers this step in all active characters.
Return the memories for the current conversation. Gets the memories from all active characters.
Add a character to the active characters list.
Return the memory depth of the character.
Return the memory offset direction of the character.