-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: Feature/Add Langfuse Integration for User Feedback Tracking #2264
base: main
Are you sure you want to change the base?
Conversation
- Add thumbs up/down feedback for chat responses - Persist feedback in IndexedDB and server - Track responses with Langfuse analytics
@@ -52,7 +52,7 @@ const Chat = () => { | |||
const [useSemanticCaptions, setUseSemanticCaptions] = useState<boolean>(false); | |||
const [includeCategory, setIncludeCategory] = useState<string>(""); | |||
const [excludeCategory, setExcludeCategory] = useState<string>(""); | |||
const [useSuggestFollowupQuestions, setUseSuggestFollowupQuestions] = useState<boolean>(false); | |||
const [useSuggestFollowupQuestions, setUseSuggestFollowupQuestions] = useState<boolean>(true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will discard changes
Thanks for the PR! We've discussed potential Langfuse integration here: Also, I'm very excited to hear that you've added a feedback store, has that been added in such a way that it can be used with multiple backing options, such as Cosmos DB? I haven't dug into that part of your code yet. |
StorageStreamDownloader as DatalakeDownloader, | ||
) | ||
from langfuse import Langfuse | ||
from langfuse.decorators import observe | ||
from openai import AsyncAzureOpenAI, AsyncOpenAI |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from openai import AsyncAzureOpenAI, AsyncOpenAI | |
from langfuse.openai import AsyncAzureOpenAI, AsyncOpenAI |
Token usage and other metrics tracking implementation
References:
- Issue: #1300 - Tracking Problem
- Solution: #1300 - Resolution
While token usage tracking and other related functionalities are successfully implemented, feedback tracking does not work beyond this stage.
Purpose
This PR implements Langfuse integration for systematic tracking and analysis of user feedback on chat responses, enabling better monitoring and insights into user interactions.
Feedback.feature.with.Langfuse_2025-01-12.111127.Clipchamp.mp4
🔄 Key Changes
🛠️ Setup Required
Add to your
.env
file:✅ Testing Checklist
📝 Important Notes
Please verify your Langfuse credentials before deploying to production.
Does this introduce a breaking change?
When developers merge from main and run the server, azd up, or azd deploy, will this produce an error?
If you're not sure, try it out on an old environment.
Verify if this produces errors when:
azd up
azd deploy
Does this require changes to learn.microsoft.com docs?
This repository is referenced by this tutorial
which includes deployment, settings and usage instructions. If text or screenshot need to change in the tutorial,
check the box below and notify the tutorial author. A Microsoft employee can do this for you if you're an external contributor.
Type of change
Code quality checklist
See CONTRIBUTING.md for more details.
python -m pytest
).python -m pytest --cov
to verify 100% coverage of added linespython -m mypy
to check for type errorsruff
andblack
manually on my code.