Closed hherpa closed 9 months ago
my google collab with memgpt/autogen: link google collaboratory
Try this:
import memgpt.presets.presets as presets
@mclassen I changed the import of modules:
import os
import autogen
import openai
from memgpt.autogen.memgpt_agent import create_autogen_memgpt_agent, create_memgpt_autogen_agent_from_config
import memgpt.presets.presets as presets
But the error is exactly the same:
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
[<ipython-input-18-6c3d7486ceca>](https://localhost:8080/#) in <cell line: 56>()
72 )
73 else:
---> 74 coder = create_memgpt_autogen_agent_from_config(
75 "MemGPT_coder",
76 llm_config=llm_config_memgpt,
/usr/local/lib/python3.10/dist-packages/memgpt/autogen/memgpt_agent.py in create_memgpt_autogen_agent_from_config(name, system_message, is_termination_msg, max_consecutive_auto_reply, human_input_mode, function_map, code_execution_config, llm_config, nonmemgpt_llm_config, default_auto_reply, interface_kwargs)
KeyError: 'preset'
I changed the import a little more:
import os
import autogen
import openai
from memgpt.autogen.memgpt_agent import create_autogen_memgpt_agent, create_memgpt_autogen_agent_from_config
import memgpt.presets.presets as presets
from memgpt.presets.presets import DEFAULT_PRESET
and the error changed as if "preset": DEFAULT_PRESETS could be found:
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
[<ipython-input-36-29df25bb2622>](https://localhost:8080/#) in <cell line: 59>()
75 )
76 else:
---> 77 coder = create_memgpt_autogen_agent_from_config(
78 "MemGPT_coder",
79 llm_config=llm_config_memgpt,
/usr/local/lib/python3.10/dist-packages/memgpt/autogen/memgpt_agent.py in create_memgpt_autogen_agent_from_config(name, system_message, is_termination_msg, max_consecutive_auto_reply, human_input_mode, function_map, code_execution_config, llm_config, nonmemgpt_llm_config, default_auto_reply, interface_kwargs)
KeyError: 'model_wrapper'
but if you also add:
from memgpt.presets.presets import model_wrapper
the code will output an error:
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
[<ipython-input-37-b8d2aac7a11c>](https://localhost:8080/#) in <cell line: 9>()
7 from memgpt.presets.presets import DEFAULT_PRESET
8
----> 9 from memgpt.presets.presets import model_wrapper
10 model_wrapper = None
11 # This config is for autogen agents that powered by MemGPT
ImportError: cannot import name 'model_wrapper' from 'memgpt.presets.presets' (/usr/local/lib/python3.10/dist-packages/memgpt/presets/presets.py)
referring to: https://github.com/cpacker/MemGPT/blob/main/memgpt/autogen/examples/agent_groupchat.py I wrote my config _list:
config_list = [
{
"model": "mistral-7b",
"api_base": "https://few-ot-cooper-attacks.trycloudflare.com/v1",
"api_key": "NULL", # this is a placeholder
"api_type": "open_ai",
"model_wrapper": None,
"model_endpoint_type": "webui", # can use webui, ollama, llamacpp, etc.
"model_endpoint": "https://few-ot-cooper-attacks.trycloudflare.com/v1", # the IP address of your LLM backend
"context_window": 8192,
},
]
and the error has changed:
@cpacker was this fixed with #498?
@hherpa can you share the output of memgpt version
?
@hherpa can you share the output of
memgpt version
?
@sarahwooders 0.1.16 , but I have a new version now and the error is for sure
I am running autogen with multi-LLMs and memgpt in google collaboratory and I have an error:
before running my script with memgpt/autogen, I run the following commands:
and here is my autogen/memgpt script:
it is this code that gives the error KeyError: 'preset' referring to the file 'memgpt_agent.py ', namely on this part: