-
|
I am using OpenWebUI and Langfuse for the model monitoring. May I ask about is it support the feedback mechasim in OpenWebUI? Seems the feedback raised in the chat inside the OpenWebUI did not reflect in Langfuse trace |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
|
OpenWebUI does not natively send feedback or comments to Langfuse—only trace and usage data are integrated by default. That's why feedback you submit in OpenWebUI chats doesn't show up in Langfuse traces. Langfuse does support collecting user feedback and comments via its public API endpoints and SDKs. To make feedback from OpenWebUI appear in Langfuse, you would need to extend OpenWebUI to call Langfuse's feedback APIs when a user submits feedback. For example, you can use the LangfuseWeb SDK in your UI to send feedback like this: import { LangfuseWeb } from "langfuse";
export function UserFeedbackComponent({ traceId }) {
const langfuseWeb = new LangfuseWeb({ publicKey: "YOUR_LANGFUSE_PUBLIC_KEY" });
const handleUserFeedback = async (value) =>
await langfuseWeb.score({
traceId,
name: "user_feedback",
value, // e.g. 1 for thumbs up, 0 for thumbs down
});
return (
<div>
<button onClick={() => handleUserFeedback(1)}>👍</button>
<button onClick={() => handleUserFeedback(0)}>👎</button>
</div>
);
}You can also submit feedback or comments directly via the Langfuse API (POST /api/public/scores for feedback, POST /api/public/comments for comments) by sending the relevant traceId and feedback value. If you want to enable this, you'll need to add a hook or middleware in OpenWebUI that triggers these API calls when feedback is submitted. There are no official or community-documented examples of this integration yet, so it would require some custom development. Let me know if you want more detailed implementation guidance or have questions about the API or SDK usage! To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
-
|
@dosu I'm working on implementing this, could you give me more details on a hook implementation? |
Beta Was this translation helpful? Give feedback.
OpenWebUI does not natively send feedback or comments to Langfuse—only trace and usage data are integrated by default. That's why feedback you submit in OpenWebUI chats doesn't show up in Langfuse traces.
Langfuse does support collecting user feedback and comments via its public API endpoints and SDKs. To make feedback from OpenWebUI appear in Langfuse, you would need to extend OpenWebUI to call Langfuse's feedback APIs when a user submits feedback. For example, you can use the LangfuseWeb SDK in your UI to send feedback like this: