motorhead
motorhead copied to clipboard
Add message-id to messages list in API response
Current Implementation:
Actual call to http://MOTOR_URL/sessions/{session-id}/memory returns a list of messages in the following format:
{
"messages": [
{
"role": "AI",
"content": "Test."
},
{
"role": "Human",
"content": "Test"
},
],
"context": null,
"tokens": 0
}
Enhancement Request:
In the messages list, it would be beneficial to include a unique message-id for each message. This enhancement would facilitate the ability to delete or update a specific message content. Here's the updated format:
{
"messages": [
{
"role": "AI",
"content": "Test.",
"message-id" : "uuid"
},
{
"role": "Human",
"content": "Test",
"message-id" : "uuid"
},
],
"context": null,
"tokens": 0
}
Absolutely, this!
It would allow us to manage more efficiently what we're "remembering" (and paying OpenAI for).
Being able to delete messages from the contextual memory is the best feature of the playground, for example. But oddly, you rarely if ever, see it implemented anywhere else.