diff --git a/components/AIReplySection.js b/components/AIReplySection.js index 0c40675a..aba64ef4 100644 --- a/components/AIReplySection.js +++ b/components/AIReplySection.js @@ -26,7 +26,11 @@ const useStyles = makeStyles(theme => ({ }, })); -function AIReplySection({ defaultExpand = false, aiReplyText = '', traceId }) { +function AIReplySection({ + defaultExpand = false, + aiReplyText = '', + aiResponseId, +}) { const [expand, setExpand] = useState(defaultExpand); const classes = useStyles(); @@ -37,9 +41,9 @@ function AIReplySection({ defaultExpand = false, aiReplyText = '', traceId }) { const handleVote = async (vote: 1 | -1) => { await langfuseWeb.score({ - traceId, - name: 'ai_reply_feedback', - value: vote === 1 ? 1 : 0, + traceId: aiResponseId, + name: 'user-feedback', + value: vote, }); }; diff --git a/pages/article/[id].js b/pages/article/[id].js index 966d43dd..e5440197 100644 --- a/pages/article/[id].js +++ b/pages/article/[id].js @@ -153,6 +153,7 @@ const LOAD_ARTICLE = gql` ...CurrentRepliesData } aiReplies { + id text } ...RelatedArticleData @@ -575,6 +576,7 @@ function ArticlePage() { {article.aiReplies?.length > 0 && (