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

Add message-id to messages list in API response #86

Open
wants to merge 26 commits into
base: main
Choose a base branch
from

Conversation

sweep-ai[bot]
Copy link
Contributor

@sweep-ai sweep-ai bot commented Oct 9, 2023

PR Feedback (click)

  • 👍 Sweep Did Well
  • 👎 Sweep Needs Improvement

Description

This PR adds a unique message-id to each message in the API response of the /sessions/{session-id}/memory endpoint in the Motorhead memory server. The message-id is a UUID and facilitates the ability to delete or update a specific message content.

Summary of Changes

  • Added a message_id field to the MemoryMessage struct in src/models.rs.
  • Updated the get_memory function in src/memory.rs to include the message_id in the response.
  • Updated the post_memory function in src/memory.rs to generate and store a unique message_id for each new message.
  • Updated the delete_memory function in src/memory.rs to delete messages based on the message_id.
  • Updated the handle_compaction function in src/reducer.rs to handle the compaction of messages based on the message_id.

Fixes #85.


🎉 Latest improvements to Sweep:

  • Sweep can now passively improve your repository! Check out Rules to learn more.

💡 To get Sweep to edit this pull request, you can:

  • Leave a comment below to get Sweep to edit the entire PR
  • Leave a comment in the code to only modify the file
  • Edit the original issue to get Sweep to recreate the PR from scratch

@sweep-ai
Copy link
Contributor Author

sweep-ai bot commented Oct 9, 2023

Rollback Files For Sweep

  • Rollback changes to src/memory.rs
  • Rollback changes to src/reducer.rs

@sweep-ai
Copy link
Contributor Author

sweep-ai bot commented Oct 9, 2023

Apply Sweep Rules to your PR?

  • Apply: All docstrings and comments should be up to date.
  • Apply: Do not include large chunks of commented out code.
  • Apply: Ensure that all error logs use traceback during exceptions.
  • Apply: Avoid using import pdb; pdb.set_trace() in production code.
  • Apply: Avoid using debug log or print statements in production code.
  • Apply: Ensure that code is properly formatted and follows consistent styling guidelines.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sweep (fast): Sweep: Add message-id to messages list in API response #83
0 participants