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

Bug with fix #443

Closed
alexandj90 opened this issue Nov 14, 2023 · 1 comment
Closed

Bug with fix #443

alexandj90 opened this issue Nov 14, 2023 · 1 comment

Comments

@alexandj90
Copy link

I get this after memgpt run and press enter to activate chat session:

"self.config.context_window" is not an integer as expected, in the agent.py file, printing this to terminal:

💭 Let's make sure everything is running smoothly and get ready for what's to come.
🤖 Hey! Welcome to your first session with me. What coding problem can we tackle today?
An exception ocurred when running agent.step():
Traceback (most recent call last):
  File "C:\User\User\anaconda3\Lib\site-packages\memgpt\main.py", line 608, in run_agent_loop
    new_messages, user_message, skip_next_user_input = process_agent_step(user_message, no_verify)
                                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\User\anaconda3\Lib\site-packages\memgpt\main.py", line 584, in process_agent_step
    new_messages, heartbeat_request, function_failed, token_warning = memgpt_agent.step(
                                                                      ^^^^^^^^^^^^^^^^^^
  File "C:\Users\User\anaconda3\Lib\site-packages\memgpt\agent.py", line 657, in step
    raise e
  File "C:\Users\User\anaconda3\Lib\site-packages\memgpt\agent.py", line 631, in step
    if current_total_tokens > MESSAGE_SUMMARY_WARNING_FRAC * self.config.context_window:
                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
TypeError: can't multiply sequence by non-int of type 'float'
? Retry agent.step()? (Y/n)

It's being treated as a sequence type instead of an integer.

This fixed it for me:

context_window=self.config.context_window

set to

context_window=int(self.config.context_window)

...throughout the agent.py file.

How did you install MemGPT?

@deej81
Copy link

deej81 commented Nov 16, 2023

I think this is fixed by #444 - suggest closing

@cpacker cpacker closed this as completed Dec 1, 2023
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

3 participants