Skip to content

Add UserID and Feedback when using LlamaIndex Integration #1434

Answered by marcklingen
skelleex asked this question in Support
Discussion options

You must be logged in to vote

Yes, for user_id and other trace-level attributes, have a look here: https://langfuse.com/docs/integrations/llama-index/get-started#set-trace-params

You can capture user feedback as a score, follow this tutorial to create a trace via the python sdk to then get a llamaindex callback handler: https://langfuse.com/docs/integrations/llama-index/get-started#interoperability-with-langfuse-sdks
The trace can then be used as a reference to add scores (https://langfuse.com/docs/scores/custom).
If you use this integration, also add the user_id and other params to the trace directly.

from llama_index.core import Settings
from llama_index.core.callbacks import CallbackManager
from langfuse import Lan…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by marcklingen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants