letta icon indicating copy to clipboard operation
letta copied to clipboard

Python client: Error while using create_memgpt_autogen_agent_from_config

Open ashokparmar29 opened this issue 1 year ago • 2 comments

Describe the bug Trying to run the doc chat example given here: https://github.com/cpacker/MemGPT/blob/main/memgpt/autogen/examples/agent_docs.py

Getting following error: Type mismatch for attribute model_wrapper, cannot cast None to <class 'NoneType'>

AttributeError Traceback (most recent call last) in <cell line: 1>() ----> 1 memgpt_agent = create_memgpt_autogen_agent_from_config( 2 "MemGPT_agent", 3 llm_config=llm_config_memgpt, 4 system_message=f"You are an AI research assistant.\n" f"You are participating in a group chat with a user ({user_proxy.name}).", 5 interface_kwargs=interface_kwargs,

2 frames /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, skip_verify, auto_save) 446 raise NotImplementedError 447 --> 448 autogen_memgpt_agent = create_autogen_memgpt_agent( 449 agent_config, 450 default_auto_reply=default_auto_reply,

/usr/local/lib/python3.10/dist-packages/memgpt/autogen/memgpt_agent.py in create_autogen_memgpt_agent(agent_config, skip_verify, auto_save, interface, interface_kwargs, default_auto_reply, is_termination_msg) 346 try: 347 preset = ms.get_preset(preset_name=agent_state.preset, user_id=user_id) --> 348 memgpt_agent = presets.create_agent_from_preset( 349 agent_state=agent_state, 350 preset=preset,

/usr/local/lib/python3.10/dist-packages/memgpt/presets/presets.py in create_agent_from_preset(agent_state, preset, interface, persona_is_file, human_is_file) 80 81 preset_name = agent_state.preset ---> 82 assert preset_name == preset.name, f"AgentState preset '{preset_name}' does not match preset name '{preset.name}'" 83 persona = agent_state.persona 84 human = agent_state.human

AttributeError: 'NoneType' object has no attribute 'name' Please describe your setup

  • [ ] How did you install memgpt?

    • %pip install pyautogen
    • %pip install pymemgpt
  • [ ] Describe your setup

    • Running on colab
    • Python version: Python 3.10.12
    • memgpt version: 0.3.3

    colab Link: https://colab.research.google.com/drive/1QGMrb89sdC6LE5dkkE5FmLno7wNj_EQN?usp=sharing

ashokparmar29 avatar Feb 24 '24 18:02 ashokparmar29

I downgrade to 0.3.2 and it solved.

hadi2f244 avatar Feb 28 '24 13:02 hadi2f244

Reopening - the autogen version of this bug will be patched in 0.3.5. Non-autogen bug should be patched in 0.3.4.

cpacker avatar Mar 01 '24 04:03 cpacker