Skip to content

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

Open
sweep-ai-deprecated[bot] wants to merge 26 commits intomainfrom
sweep/add-message-id-to-messages
Open

Add message-id to messages list in API response#86
sweep-ai-deprecated[bot] wants to merge 26 commits intomainfrom
sweep/add-message-id-to-messages

Conversation

@sweep-ai-deprecated
Copy link
Contributor

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-deprecated
Copy link
Contributor Author

Rollback Files For Sweep

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

@sweep-ai-deprecated
Copy link
Contributor Author

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