brucepro/Memoir

Test with other extensions

Closed this issue · 3 comments

Memoir should not impact other extensions but I have not done extensive testing.

Consider if features that are present in other extensions should be included with Memoir as commands in the command handler or if they should be siloed to the extensions. Memoir+ should prolly focus on just being the best RAG/Memory extension and not try to have too many features that are maintained by other extensions.

Tested with whisper and tts and worked just fine.

Memoir clashes with any extension that uses the below function for the chat tab in extensions.py as it only works with the first extension it sees.

# custom_generate_chat_prompt handling - currently only the first one will work
def _apply_custom_generate_chat_prompt(text, state, **kwargs):
    for extension, _ in iterator():
        if hasattr(extension, 'custom_generate_chat_prompt'):
            return extension.custom_generate_chat_prompt(text, state, **kwargs)

    return None

For me this is the popular extension superboogav2 i can only assume theres more

took me a while to figure out why my short term memorys wernt commiting to long term. after adding a load of debug logs i found that the function below is never called because of the other extension


def custom_generate_chat_prompt(user_input, state, **kwargs):
    """
    Replaces the function that generates the prompt from the chat history.
    Only used in chat mode.
    """

    '''
    This is the main Dream mode that takes STM and saves to LTM. Right now
    it uses the current loaded model, so generation when LTM's are being 
    saved is a bit longer. 
    '''
    print("GeneratingChatLog")
    if params['memory_active'] == True:
        character_name = state["name2"].lower().strip()
        params['current_persona'] = character_name
        databasefile = os.path.join(databasepath, character_name + "_sqlite.db")
        dream = Dream(databasefile)
        persona = Persona(databasefile)
        stm_user = ShortTermMemory(databasefile)

would be nice if there was a better way to handle this. to even find the issue i had to debug the function in Extensions.py to see what extension it was clashing with as most wouldnt have a clue how to diagnose this as theres no warnings.

perhaps the Memoir needs to check the other extensions installed and if they exist, warn the user that memoir wont work in chat till they are disabled?

Neat. Thank you so much. Adding in the checks is a great idea, Will debug.