Skip to content

Commit fce0042

Browse files
committed
fix(langfuse): skip compaction turn output
1 parent 636a24d commit fce0042

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

src/langfuse.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -328,11 +328,13 @@ export class LangfuseClient {
328328
role: "assistant" as const,
329329
content: this.getAssistantText(input.messageID),
330330
};
331-
const turn = this.getTurnObservation(input.sessionID, input.parentID);
332-
turn?.span.setAttribute(
333-
"langfuse.observation.output",
334-
JSON.stringify(output),
335-
);
331+
if (input.mode !== "compaction") {
332+
const turn = this.getTurnObservation(input.sessionID, input.parentID);
333+
turn?.span.setAttribute(
334+
"langfuse.observation.output",
335+
JSON.stringify(output),
336+
);
337+
}
336338
const step = this.traceState.activeGenerationSteps.get(input.sessionID);
337339

338340
if (step) {

0 commit comments

Comments
 (0)