Skip to content

Conversation

@nicofretti
Copy link
Owner

@nicofretti nicofretti commented Dec 10, 2025

Description

  • 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
  • Refactor of the codebase with Pydantic objects where useful

Related Issue

Checklist

  • Code follows project style guidelines
  • Comments explain "why" not "what"
  • Documentation updated (if needed)
  • No debug code or console statements
  • make format passes
  • make pre-merge passes
  • PR update from develop branch
  • Copilot review run and addressed

@nicofretti nicofretti linked an issue Dec 10, 2025 that may be closed by this pull request
@nicofretti nicofretti requested a review from Copilot December 10, 2025 22:20
@nicofretti nicofretti self-assigned this Dec 10, 2025
Copy link

Copilot AI left a 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.

@nicofretti nicofretti changed the base branch from main to develop December 12, 2025 17:48
Copy link

Copilot AI left a 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.

@nicofretti nicofretti requested a review from Copilot December 15, 2025 19:00
Copy link

Copilot AI left a 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.

@nicofretti nicofretti changed the title 🚀 Feat: integration with langfuse + upload dataset 🚀 Feat: integration with langfuse + refactor with pydantic Dec 15, 2025
@nicofretti nicofretti marked this pull request as ready for review December 15, 2025 20:00
@nicofretti nicofretti merged commit b6710ed into develop Dec 15, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🚀 Feat: upload dataset into Langfuse

2 participants