Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Jyxcana opened this issue Dec 19, 2023 · 2 comments
Open

Comments

@Jyxcana
Copy link

Jyxcana commented Dec 19, 2023

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
Copy link
Author

Jyxcana commented Dec 19, 2023

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"
)

@bitsnaps
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants