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

TypeError: cannot unpack non-iterable coroutine object #8

Open
JaRail opened this issue Nov 6, 2023 · 3 comments
Open

TypeError: cannot unpack non-iterable coroutine object #8

JaRail opened this issue Nov 6, 2023 · 3 comments

Comments

@JaRail
Copy link

JaRail commented Nov 6, 2023

Just tried installing and running this against a local LLM. Looks like maybe MemGPT made a breaking change?

(venv) D:\ai\MemGPT-AutoGEN-LLM>py app.py

MemGPT Agent at work

User_proxy (to MemGPT_coder):

Write a Function to print Numbers 1 to 10

--------------------------------------------------------------------------------
D:\ai\MemGPT-AutoGEN-LLM\venv\Lib\site-packages\memgpt\autogen\memgpt_agent.py:212: RuntimeWarning: coroutine 'AgentAsync.step' was never awaited
  (
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
Traceback (most recent call last):
  File "D:\ai\MemGPT-AutoGEN-LLM\app.py", line 76, in <module>
    user_proxy.initiate_chat(
  File "D:\ai\MemGPT-AutoGEN-LLM\venv\Lib\site-packages\autogen\agentchat\conversable_agent.py", line 531, in initiate_chat
    self.send(self.generate_init_message(**context), recipient, silent=silent)
  File "D:\ai\MemGPT-AutoGEN-LLM\venv\Lib\site-packages\autogen\agentchat\conversable_agent.py", line 334, in send
    recipient.receive(message, self, request_reply, silent)
  File "D:\ai\MemGPT-AutoGEN-LLM\venv\Lib\site-packages\autogen\agentchat\conversable_agent.py", line 462, in receive
    reply = self.generate_reply(messages=self.chat_messages[sender], sender=sender)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ai\MemGPT-AutoGEN-LLM\venv\Lib\site-packages\autogen\agentchat\conversable_agent.py", line 781, in generate_reply
    final, reply = reply_func(self, messages=messages, sender=sender, config=reply_func_tuple["config"])
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\ai\MemGPT-AutoGEN-LLM\venv\Lib\site-packages\memgpt\autogen\memgpt_agent.py", line 212, in _generate_reply_for_user_message
    (
TypeError: cannot unpack non-iterable coroutine object
@tidymonkey81
Copy link

tidymonkey81 commented Nov 6, 2023

i get the same but haven't dug deeper. windows.

@GeoffMillerAZ
Copy link

i get the same but haven't dug deeper. windows.

Here's the fix. At least if you're using:

pyautogen==0.1.14
pymemgpt==0.1.17

Problem:
These code bases move so quickly that when he publishes the video, the latest versions have changed and introduced bugs.

Solution:

Use the same version that @PromptEngineer48 used. But since he didn't publish versions. I have a code change that will fix it.

In your virtual env: Go to : /lib/python3.11/site-packages/memgpt/autogen/memgpt_agent.py

at around line 185:

def _generate_reply_for_user_message(

Change to:

async def _generate_reply_for_user_message(

This should work.

@PromptEngineer48 could you please start including a frozen requirements.txt file so that we can use the exact some libs as you? Love your stuff but this would help a TON!

pathToYourVirtualEnv/bin/python -m pip freeze > requirements.txt

@PromptEngineer48
Copy link
Owner

Point well taken!

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

4 participants