-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
I added commands to shape the conversation: #218
Conversation
dd749e0
to
80b9128
Compare
@oderwat would you mind running Alternatively if you add me as a contributor to your fork repository I can add this for you. Thank you for another great PR btw! EDIT: if you use VSCode, you can just install the Microsoft Black Formatter extension, then add this to your settings.json:
Then go into the files that the github actions is saying are bad, and save them inside VSCode which will auto-format them to the black style so that the PR passes the check (in this case you would go to main.py and save to format): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs black reformatting (or add me as a collaborator to your fork @oderwat and I can patch it)
80b9128
to
6805927
Compare
I use PyCharm Professional and just enabled the integrated Black formatter. I will go through the PRs and update them. |
OK. This did not work well. I also think that the setup of Black may be different. Have to investigate. |
6805927
to
0d56246
Compare
OK. I guess it worked now. I also added @cpacker as collaborator, just in case. |
1cc3dc2
to
051610f
Compare
OK. I was in rebase hell because for some stupid reason I could not get upstream to my local origin. I hope that now everything is fine. There are two unrelated problems though: 1. Black reports an error in utils (but I did not change that) and main.py uses |
`/rethink <text>` will change the internal dialog of the last assistant message. `/rewrite <text>` will change the last answer of the assistant. Both commands can be used to change how the conversation continues in some pretty drastic and powerfull ways.
051610f
to
85c6798
Compare
@@ -482,6 +483,32 @@ async def run_agent_loop(memgpt_agent, first, no_verify=False, cfg=None, legacy= | |||
memgpt_agent.messages.pop() | |||
continue | |||
|
|||
elif user_input.lower() == "/rethink" or user_input.lower().startswith("/rethink "): | |||
# TODO this needs to also modify the persistence manager |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just as an FYI @oderwat , your implementation here isn't also overwriting the persistence manager's history, so if the agent uses conversation_search to look into the past, they'll find the original unedited message.
However, it is a significant amount of work to get the persistence manager to also be in sync (since the persistence manager can have many implementations), so I think it's OK to have this issue and just leave a disclaimer, since the commands as-is are still quite useful.
Thank you for your contribution! |
* I added commands to shape the conversation: `/rethink <text>` will change the internal dialog of the last assistant message. `/rewrite <text>` will change the last answer of the assistant. Both commands can be used to change how the conversation continues in some pretty drastic and powerfull ways. * remove magic numbers * add disclaimer --------- Co-authored-by: cpacker <[email protected]>
/rethink <text>
will change the internal dialog of the last assistant message./rewrite <text>
will change the last answer of the assistant.Both commands can be used to change how the conversation continues in some pretty drastic and powerful ways.