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
PR Feedback (click)
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
message_id
field to theMemoryMessage
struct insrc/models.rs
.get_memory
function insrc/memory.rs
to include themessage_id
in the response.post_memory
function insrc/memory.rs
to generate and store a uniquemessage_id
for each new message.delete_memory
function insrc/memory.rs
to delete messages based on themessage_id
.handle_compaction
function insrc/reducer.rs
to handle the compaction of messages based on themessage_id
.Fixes #85.
π Latest improvements to Sweep:
π‘ To get Sweep to edit this pull request, you can: