MemGPT-AutoGEN-LLM icon indicating copy to clipboard operation
MemGPT-AutoGEN-LLM copied to clipboard

AttributeError: module 'memgpt.presets' has no attribute 'DEFAULT_PRESET'

Open Jyxcana opened this issue 2 years ago • 2 comments

Traceback (most recent call last): File "/Users/jyx/Documents/AIProj/MemGenGPT/app.py", line 55, in memgpt_agent=presets.use_preset(presets.DEFAULT_PRESET, model='gpt-4', persona=persona, human=human, interface=interface, persistence_manager=persistence_manager, agent_config=llm_config) ^^^^^^^^^^^^^^^^^^^^^^ AttributeError: module 'memgpt.presets' has no attribute 'DEFAULT_PRESET'

Jyxcana avatar Dec 19 '23 21:12 Jyxcana

import os import autogen import memgpt.autogen.memgpt_agent as memgpt_autogen import memgpt.autogen.interface as autogen_interface import memgpt.agent as agent
import memgpt.system as system import memgpt.utils as utils import memgpt.presets as presets import memgpt.constants as constants import memgpt.personas.personas as personas import memgpt.humans.humans as humans from memgpt.persistence_manager import InMemoryStateManager, InMemoryStateManagerWithPreloadedArchivalMemory, InMemoryStateManagerWithEmbeddings, InMemoryStateManagerWithFaiss import openai

config_list = [ { "api_type": "open_ai", "api_base": "http://localhost:1234/v1", "api_key": "NULL", }, ]

llm_config = {"config_list": config_list, "seed": 42}

USE_MEMGPT = True

openai.api_base="http://localhost:1234/v1" openai.api_key="NULL"

user_proxy = autogen.UserProxyAgent( name="User_proxy", system_message="A human admin.", code_execution_config={"last_n_messages": 2, "work_dir": "groupchat"}, human_input_mode="TERMINATE", # needed? default_auto_reply="You are going to figure all out by your own. " "Work by yourself, the user won't reply until you output TERMINATE to end the conversation.", )

interface = autogen_interface.AutoGenInterface() persistence_manager=InMemoryStateManager() persona = "I am a 10x engineer, trained in Python. I was the first engineer at Uber." human = "Im a team manager at this company" memgpt_agent=presets.use_preset(presets.DEFAULT_PRESET, model='gpt-4', persona=persona, human=human, interface=interface, persistence_manager=persistence_manager, agent_config=llm_config)

if not USE_MEMGPT: # In the AutoGen example, we create an AssistantAgent to play the role of the coder coder = autogen.AssistantAgent( name="Coder", llm_config=llm_config, system_message=f"I am a 10x engineer, trained in Python. I was the first engineer at Uber", human_input_mode="TERMINATE", )

else: print("\nMemGPT Agent at work\n") coder = memgpt_autogen.MemGPTAgent( name="MemGPT_coder", agent=memgpt_agent, )

user_proxy.initiate_chat( coder, message="Write a Function to print Numbers 1 to 10" )

Jyxcana avatar Dec 19 '23 21:12 Jyxcana

I had a similar issue, I believe fixed by importing the right package (it's been changed): memgpt.presets.presets instead of memgpt.presets.

bitsnaps avatar Dec 31 '23 17:12 bitsnaps