fix: migrate Langfuse integration from start_generation to start_obse… (#14205)

The Langfuse Python SDK v3+ removed `start_generation()` method.
RagFlow's code called this non-existent method, causing AttributeError
when Langfuse tracing is enabled.

Replace all `start_generation()` calls with
`start_observation(as_type="generation")` which is the correct v4 SDK
API.

Affected files:
- api/db/services/llm_service.py (12 occurrences)
- api/db/services/dialog_service.py (1 occurrence)

Fixes #14204
Related to #9243

### What problem does this PR solve?

_Briefly describe what this PR aims to solve. Include background context
that will help reviewers understand the purpose of the PR._

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
RazmikGevorgyan
2026-04-24 06:03:57 +04:00
committed by GitHub
parent c74aece63c
commit c41b5e8a5d
4 changed files with 15 additions and 15 deletions

View File

@@ -53,7 +53,7 @@ dependencies = [
"infinity-emb>=0.0.66,<0.0.67",
"jira==3.10.5",
"json-repair==0.35.0",
"langfuse>=2.60.0",
"langfuse>=4.0.1",
"mammoth>=1.11.0",
"markdown==3.6",
"markdown-to-json==2.1.1",