fix(langfuse): 테스트가 로컬 .env 의 LANGFUSE_HOST 로 진짜 전송하던 것 차단(autouse) + 게이트웨이 루트 span 에 질문/답 실음

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
lee-hyeon-cheol
2026-09-22 14:01:05 +09:00
co-authored by Claude Fable 5.1
parent 678ea2482f
commit 07d733ea30
2 changed files with 9 additions and 1 deletions
+3 -1
View File
@@ -102,7 +102,9 @@ def _observe(model_id: str, body: dict, col: _Collect, started: float, status: i
u = col.usage or {}
tid = str(uuid.uuid4())
t0 = datetime.fromtimestamp(started, timezone.utc).isoformat()
root = langfuse.trace(tid, "fabrix", tags=["gateway"], metadata={"parts": kinds}, start=t0, end=langfuse.now_iso())
last_user = next((m.get("content") for m in reversed(body.get("messages") or []) if m.get("role") == "user"), None)
root = langfuse.trace(tid, "fabrix", tags=["gateway"], metadata={"parts": kinds}, start=t0, end=langfuse.now_iso(),
input=last_user, output="".join(col.text)) # 목록에서 뭘 물었는지 바로 보이게
langfuse.send_later([
root,
langfuse.generation(