-
Notifications
You must be signed in to change notification settings - Fork 7
🚀 Feat: integration with langfuse + refactor with pydantic #46
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
Conversation
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.
Pull request overview
This PR adds Langfuse integration to enable LLM observability and dataset management. The integration includes automatic tracing of LLM calls via LiteLLM callbacks, a new block for uploading generated records to Langfuse datasets, and UI components to display integration status and upload results.
Key changes:
- Adds trace_id and job_id tracking throughout pipeline execution to enable request grouping in Langfuse
- Implements LangfuseDatasetBlock for uploading completed job records to Langfuse datasets
- Adds metadata column to jobs table to track upload status and prevent duplicate uploads
Reviewed changes
Copilot reviewed 14 out of 15 changed files in this pull request and generated 14 comments.
Show a summary per file
| File | Description |
|---|---|
| pyproject.toml | Adds langfuse==2.59.7 dependency |
| models.py | Adds optional metadata field to Job model |
| lib/workflow.py | Adds trace_id generation and propagation through pipeline execution; adds job_id to accumulated data |
| lib/storage.py | Adds metadata column migration to jobs table; includes metadata in get_job method |
| lib/job_processor.py | Adds job_id to seed metadata for block access |
| lib/entities/pipeline.py | Adds comprehensive documentation for ExecutionResult explaining trace_id concept and hierarchy |
| lib/blocks/builtin/text_generator.py | Adds trace_id metadata to LiteLLM calls for Langfuse grouping |
| lib/blocks/builtin/structured_generator.py | Adds trace_id metadata to LiteLLM calls for Langfuse grouping |
| lib/blocks/builtin/langfuse.py | New block that uploads job records to Langfuse datasets with idempotency checks |
| app.py | Configures LiteLLM Langfuse callback at startup; adds /api/langfuse/status endpoint |
| frontend/src/pages/Settings.tsx | Adds Langfuse integration status display with configuration instructions |
| frontend/src/pages/Review.tsx | Displays Langfuse upload success/error messages from job metadata |
| frontend/src/pages/Generator.tsx | Displays Langfuse upload success/error messages from job metadata |
| .env.example | Adds Langfuse configuration environment variables |
| .gitignore | Adds release.tag.md and Q to ignored files |
Comments suppressed due to low confidence (1)
lib/blocks/builtin/langfuse.py:4
- Import of 'datetime' is not used.
from datetime import datetime
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Pull request overview
Copilot reviewed 33 out of 34 changed files in this pull request and generated 12 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Pull request overview
Copilot reviewed 52 out of 53 changed files in this pull request and generated 7 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Description
Related Issue
Checklist
make formatpassesmake pre-mergepasses