📋 refactor: Attach Message Context to Langfuse Feedback Scores (#13604)

This commit is contained in:
Danny Avila 2026-06-08 15:54:01 -04:00 committed by GitHub
parent 98755d86c8
commit ae0c187ddd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 56 additions and 2 deletions

View file

@ -401,6 +401,17 @@ router.put('/:conversationId/:messageId/feedback', validateMessageReq, async (re
sendFeedbackScore({
traceId: traceIdForMessage(messageId),
feedback: updatedMessage.feedback,
metadata: {
messageId: updatedMessage.messageId ?? messageId,
parentMessageId: updatedMessage.parentMessageId,
conversationId: updatedMessage.conversationId ?? conversationId,
sessionId: updatedMessage.conversationId ?? conversationId,
userId: req?.user?.id,
endpoint: updatedMessage.endpoint,
sender: updatedMessage.sender,
isCreatedByUser: updatedMessage.isCreatedByUser,
tokenCount: updatedMessage.tokenCount,
},
}).catch((err) => logger.error('[langfuse] feedback score failed:', err));
}