API/SDK로 점수 넣기(Scores via API/SDK)

API/SDK로 점수 넣기(Scores via API/SDK)

Langfuse SDK 또는 API를 사용해 traces, observations, sessions, dataset runs에 점수(scores)를 추가할 수 있습니다. 이 문서는 각 점수 데이터 타입(Numeric, Categorical, Boolean, Text)별 수집 예시와 세션 수준 점수, 중복 방지, Score Config 강제, 추론된 속성을 다룹니다. 커스텀 평가 워크플로우를 구성하는 평가 방법입니다.

출처: 문서

본문

Langfuse SDK 또는 API를 사용해 점수 를 traces, observations, sessions, dataset runs에 추가할 수 있습니다. 이는 커스텀 평가 워크플로우를 설정하고 Langfuse의 채점 기능을 확장할 수 있게 해주는 평가 방법입니다. score 객체에 대한 전체 세부 사항은 데이터 모델 을 참고하세요.

Langfuse가 결정적 Python/TypeScript 로직을 실행해 주기를 원한다면 code evaluators 를 사용하세요. 애플리케이션, 파이프라인, 또는 CI 작업이 점수를 계산해 API/SDK로 Langfuse에 보낼 때는 이 페이지를 사용하세요.

API/SDK로 점수 수집

점수는 다양한 세분화 수준에서 연결할 수 있습니다: 개별 traces, trace 내 특정 observations, 또는 전체 sessions.

score와 score config의 POST/GET 엔드포인트에 대한 전체 세부 사항은 API reference 를 참고하세요.

Trace 또는 Observation 수준 점수

SDK 또는 API로 점수를 추가할 수 있습니다. 점수는 Numeric, Categorical, Boolean, Text 중 하나의 데이터 타입을 가집니다. 자세한 내용은 Score Types 를 참고하세요.

trace_id를 사용해 점수를 trace에 수동으로 연결해 수집할 때는 trace가 생성될 때까지 기다릴 필요가 없습니다. 점수는 점수 테이블에 나타나고, 같은 trace_id의 trace가 생성되면 그 trace에 연결됩니다.

trace와 observation 점수의 경우 trace_id/traceId는 필수이고 observation_id/observationId는 선택입니다. observation에 점수를 연결하려면 observation ID와 해당 trace ID를 항상 함께 제공하세요.

Numeric 점수 (Python) — 값은 float로 제공:

from langfuse import get_client
langfuse = get_client()

# Method 1: Score via low-level method
langfuse.create_score(
    name="correctness",
    value=0.9,
    trace_id="trace_id_here",
    observation_id="observation_id_here", # optional
    data_type="NUMERIC", # optional, inferred if not provided
    comment="Factually correct", # optional
)

# Method 2: Score current observation (within context)
with langfuse.start_as_current_observation(as_type="span", name="my-operation") as span:
    # Score the current observation
    span.score(
        name="correctness",
        value=0.9,
        data_type="NUMERIC",
        comment="Factually correct"
    )

    # Score the trace
    span.score_trace(
        name="overall_quality",
        value=0.95,
        data_type="NUMERIC"
    )

# Method 3: Score via the current context
with langfuse.start_as_current_observation(as_type="span", name="my-operation"):
    # Score the current observation
    langfuse.score_current_span(
        name="correctness",
        value=0.9,
        data_type="NUMERIC",
        comment="Factually correct"
    )

    # Score the trace
    langfuse.score_current_trace(
        name="overall_quality",
        value=0.95,
        data_type="NUMERIC"
    )

Categorical 점수 (Python) — 값은 문자열로 제공:

from langfuse import get_client
langfuse = get_client()

# Method 1: Score via low-level method
langfuse.create_score(
    name="accuracy",
    value="partially correct",
    trace_id="trace_id_here",
    observation_id="observation_id_here", # optional
    data_type="CATEGORICAL", # optional, inferred if not provided
    comment="Some factual errors", # optional
)

# Method 2: Score current observation (within context)
with langfuse.start_as_current_observation(as_type="span", name="my-operation") as span:
    span.score(
        name="accuracy",
        value="partially correct",
        data_type="CATEGORICAL",
        comment="Some factual errors"
    )
    span.score_trace(
        name="overall_quality",
        value="partially correct",
        data_type="CATEGORICAL"
    )

# Method 3: Score via the current context
with langfuse.start_as_current_observation(as_type="span", name="my-operation"):
    langfuse.score_current_span(
        name="accuracy",
        value="partially correct",
        data_type="CATEGORICAL",
        comment="Some factual errors"
    )
    langfuse.score_current_trace(
        name="overall_quality",
        value="partially correct",
        data_type="CATEGORICAL"
    )

Boolean 점수 (Python) — 1은 true, 0은 false인 float로 제공. v3 scores API 로 읽으면 boolean으로 반환:

from langfuse import get_client
langfuse = get_client()

# Method 1: Score via low-level method
langfuse.create_score(
    name="helpfulness",
    value=0, # 0 or 1
    trace_id="trace_id_here",
    observation_id="observation_id_here", # optional
    data_type="BOOLEAN", # required, numeric values without data type would be inferred as NUMERIC
    comment="Incorrect answer", # optional
)

# Method 2: Score current observation (within context)
with langfuse.start_as_current_observation(as_type="span", name="my-operation") as span:
    span.score(
        name="helpfulness",
        value=1, # 0 or 1
        data_type="BOOLEAN",
        comment="Very helpful response"
    )
    span.score_trace(
        name="overall_quality",
        value=1, # 0 or 1
        data_type="BOOLEAN"
    )
# Method 3: Score via the current context
with langfuse.start_as_current_observation(as_type="span", name="my-operation"):
    langfuse.score_current_span(
        name="helpfulness",
        value=1, # 0 or 1
        data_type="BOOLEAN",
        comment="Very helpful response"
    )
    langfuse.score_current_trace(
        name="overall_quality",
        value=1, # 0 or 1
        data_type="BOOLEAN"
    )

Text 점수 (Python) — 1~500자 문자열로 제공:

from langfuse import get_client
langfuse = get_client()

# Method 1: Score via low-level method
langfuse.create_score(
    name="reviewer_notes",
    value="The response was helpful but could be more concise.",
    trace_id="trace_id_here",
    observation_id="observation_id_here", # optional
    data_type="TEXT", # optional, inferred if not provided
    comment="Reviewed by QA team", # optional
)

# Method 2: Score current observation (within context)
with langfuse.start_as_current_observation(as_type="span", name="my-operation") as span:
    span.score(
        name="reviewer_notes",
        value="The response was helpful but could be more concise.",
        data_type="TEXT",
        comment="Reviewed by QA team"
    )
    span.score_trace(
        name="overall_notes",
        value="Good quality overall, minor formatting issues.",
        data_type="TEXT"
    )

# Method 3: Score via the current context
with langfuse.start_as_current_observation(as_type="span", name="my-operation"):
    langfuse.score_current_span(
        name="reviewer_notes",
        value="The response was helpful but could be more concise.",
        data_type="TEXT",
        comment="Reviewed by QA team"
    )
    langfuse.score_current_trace(
        name="overall_notes",
        value="Good quality overall, minor formatting issues.",
        data_type="TEXT"
    )

JS/TS 예시

Numeric (float 필요):

import { LangfuseClient } from "@langfuse/client";

const langfuse = new LangfuseClient();

langfuse.score.create({
  id: "unique_id", // optional, can be used as an idempotency key to update the score subsequently
  traceId: message.traceId,
  observationId: message.generationId, // optional
  name: "correctness",
  value: 0.9,
  dataType: "NUMERIC", // optional, inferred if not provided
  comment: "Factually correct", // optional
});

// Flush the scores in short-lived environments
await langfuse.flush();

Categorical (문자열 필요):

import { LangfuseClient } from "@langfuse/client";

const langfuse = new LangfuseClient();

langfuse.score.create({
  id: "unique_id", // optional, can be used as an idempotency key to update the score subsequently
  traceId: message.traceId,
  observationId: message.generationId, // optional
  name: "accuracy",
  value: "partially correct",
  dataType: "CATEGORICAL", // optional, inferred if not provided
  comment: "Factually correct", // optional
});

// Flush the scores in short-lived environments
await langfuse.flush();

Boolean (1은 true, 0은 false인 float 필요):

import { LangfuseClient } from "@langfuse/client";

const langfuse = new LangfuseClient();

langfuse.score.create({
  id: "unique_id", // optional, can be used as an idempotency key to update the score subsequently
  traceId: message.traceId,
  observationId: message.generationId, // optional
  name: "helpfulness",
  value: 0, // 0 or 1
  dataType: "BOOLEAN", // required, numeric values without data type would be inferred as NUMERIC
  comment: "Incorrect answer", // optional
});

// Flush the scores in short-lived environments
await langfuse.flush();

Text (1~500자 문자열 필요):

import { LangfuseClient } from "@langfuse/client";

const langfuse = new LangfuseClient();

langfuse.score.create({
  id: "unique_id", // optional, can be used as an idempotency key to update the score subsequently
  traceId: message.traceId,
  observationId: message.generationId, // optional
  name: "reviewer_notes",
  value: "The response was helpful but could be more concise.",
  dataType: "TEXT", // optional, inferred if not provided
  comment: "Reviewed by QA team", // optional
});

// Flush the scores in short-lived environments
await langfuse.flush();

REST API 로도 직접 점수를 만들 수 있습니다. Langfuse Public Key를 사용자 이름, Secret Key를 비밀번호로 하는 HTTP Basic Auth로 인증하세요.

Numeric (curl):

curl -X POST https://cloud.langfuse.com/api/public/scores \
  -u "pk-lf-...":"sk-lf-..." \
  -H "Content-Type: application/json" \
  -d '{
    "traceId": "trace_id_here",
    "observationId": "observation_id_here",
    "name": "correctness",
    "value": 0.9,
    "dataType": "NUMERIC",
    "comment": "Factually correct"
  }'

Categorical (curl):

curl -X POST https://cloud.langfuse.com/api/public/scores \
  -u "pk-lf-...":"sk-lf-..." \
  -H "Content-Type: application/json" \
  -d '{
    "traceId": "trace_id_here",
    "observationId": "observation_id_here",
    "name": "accuracy",
    "value": "partially correct",
    "dataType": "CATEGORICAL",
    "comment": "Some factual errors"
  }'

Boolean (curl):

curl -X POST https://cloud.langfuse.com/api/public/scores \
  -u "pk-lf-...":"sk-lf-..." \
  -H "Content-Type: application/json" \
  -d '{
    "traceId": "trace_id_here",
    "observationId": "observation_id_here",
    "name": "helpfulness",
    "value": 0,
    "dataType": "BOOLEAN",
    "comment": "Incorrect answer"
  }'

Text (curl):

curl -X POST https://cloud.langfuse.com/api/public/scores \
  -u "pk-lf-...":"sk-lf-..." \
  -H "Content-Type: application/json" \
  -d '{
    "traceId": "trace_id_here",
    "observationId": "observation_id_here",
    "name": "reviewer_notes",
    "value": "The response was helpful but could be more concise.",
    "dataType": "TEXT",
    "comment": "Reviewed by QA team"
  }'

브라우저 점수 수집(Browser score ingestion)

점수가 프론트엔드 코드에서 생성될 때(예: thumbs up/down 사용자 피드백, 별점, 클라이언트 측 품질 신호) @langfuse/browser를 사용하세요. 브라우저 SDK는 Langfuse public key만 필요하며 각 점수를 수집 API로 즉시 보냅니다. 브라우저 코드에 secret key를 노출하지 마세요.

백엔드 서비스, 스크립트, CI 작업, 평가 파이프라인에는 위 JS/TS SDK 예시처럼 @langfuse/client를 사용하세요.

npm install @langfuse/browser
import { LangfuseBrowserClient } from "@langfuse/browser";

const langfuse = new LangfuseBrowserClient({
  publicKey: process.env.NEXT_PUBLIC_LANGFUSE_PUBLIC_KEY!,
  baseUrl: process.env.NEXT_PUBLIC_LANGFUSE_BASE_URL, // optional, defaults to https://cloud.langfuse.com
});

await langfuse.score({
  traceId: message.traceId,
  observationId: message.generationId, // optional
  id: `user-feedback-${message.traceId}`, // optional, use as an idempotency key
  name: "user-feedback",
  value: 1, // 1 for positive, 0 for negative
  dataType: "BOOLEAN",
  comment: "Helpful answer", // optional
});

score()는 수집 성공 후 { id }를 반환합니다. flush() 호출은 필요하지 않습니다.

세션 수준 점수(Session-level Scores)

전체 세션에 점수를 매기려면(trace나 observation에 연결하지 않고) session_id(Python SDK) 또는 sessionId(JS/TS SDK 및 API)만 제공하세요.

Python:

from langfuse import get_client
langfuse = get_client()

langfuse.create_score(
    name="session_quality",
    value=0.85,
    session_id="session_id_here",
    data_type="NUMERIC",
    comment="Overall conversation quality"
)

JS/TS:

import { LangfuseClient } from "@langfuse/client";

const langfuse = new LangfuseClient();

langfuse.score.create({
  name: "session_quality",
  value: 0.85,
  sessionId: "session_id_here",
  dataType: "NUMERIC",
  comment: "Overall conversation quality",
});

await langfuse.flush();

curl:

curl -X POST https://cloud.langfuse.com/api/public/scores \
  -u "pk-lf-...":"sk-lf-..." \
  -H "Content-Type: application/json" \
  -d '{
    "sessionId": "session_id_here",
    "name": "session_quality",
    "value": 0.85,
    "dataType": "NUMERIC",
    "comment": "Overall conversation quality"
  }'

고급(Advanced)

중복 점수 방지(Preventing Duplicate Scores)

기본적으로 Langfuse는 같은 trace의 같은 name 점수를 여러 개 허용합니다. 시간 경과에 따른 점수 변화를 추적하거나 같은 trace에서 여러 사용자 피드백 점수를 받는 경우에 유용합니다.

어떤 경우에는 이 동작을 방지하거나 기존 점수를 덮어쓰고 싶을 수 있습니다. 점수는 세 필드로 식별됩니다 — id, name, 날짜(toDate(timestamp)) — 새 점수는 세 필드가 모두 일치할 때만 기존 점수를 대체합니다. 이를 위해 멱등성 키(idempotency key) 를 만들어 점수 생성 시 id(JS/TS) / score_id(Python)로 전달하고(예: trace_id-score_name), 호출 간 nametimestamp를 그대로 유지하세요. 세 필드 중 하나라도 다르면(예: 다른 name의 같은 id) 대체가 아니라 추가 점수가 생깁니다.

부분 점수 업데이트(변경된 필드만)를 보내고 Langfuse가 기존 레코드에 병합하도록 의존하지 마세요. 이 병합은 생성 후 제한된 창에서만 발생하며, deprecated이고 제거될 예정입니다. 항상 완전한 점수를 보내세요.

Langfuse의 불변 데이터 모델에 대한 자세한 내용은 How to update traces, observations, and scores 를 참고하세요.

Score Config 강제(Enforcing a Score Config)

Score config는 향후 분석을 위해 점수를 표준화하려 할 때 유용합니다.

score config을 강제하려면 점수 생성 시 configId를 제공해 이전에 만든 ScoreConfig를 참조할 수 있습니다. Score Configs는 Langfuse UI나 API로 정의할 수 있습니다. score config 생성·관리 가이드 를 참고하세요.

ScoreConfig를 제공하면 점수 데이터가 config에 대해 검증됩니다. 다음 규칙이 적용됩니다:

  • Score Name: config의 이름과 같아야 함
  • Score Data Type: 제공되면 config의 데이터 타입과 일치해야 함
  • Type이 NUMERIC일 때 Score Value: config에 정의된 min/max 값 안에 있어야 함 (제공되면. min/max는 선택이며, 없으면 각각 -∞, +∞로 가정)
  • Type이 CATEGORICAL일 때 Score Value: config에 정의된 카테고리 중 하나에 매핑되어야 함
  • Type이 BOOLEAN일 때 Score Value: 0 또는 1과 같아야 함
  • Type이 TEXT일 때 Score Value: 최대 500자리의 비어 있지 않은 문자열이어야 함

Numeric (Python):

from langfuse import get_client
langfuse = get_client()

# Method 1: Score via low-level method
langfuse.create_score(
    trace_id="trace_id_here",
    observation_id="observation_id_here", # optional
    session_id="session_id_here", # optional, ID of the session the score relates to
    name="accuracy",
    value=0.9,
    comment="Factually correct", # optional
    score_id="unique_id", # optional, can be used as an idempotency key to update the score subsequently
    config_id="78545-6565-3453654-43543", # optional, to ensure that the score follows a specific min/max value range
    data_type="NUMERIC" # optional, possibly inferred
)

# Method 2: Score within context
with langfuse.start_as_current_observation(as_type="span", name="my-operation") as span:
    span.score(
        name="accuracy",
        value=0.9,
        comment="Factually correct",
        config_id="78545-6565-3453654-43543",
        data_type="NUMERIC"
    )

Categorical (Python):

from langfuse import get_client
langfuse = get_client()

# Method 1: Score via low-level method
langfuse.create_score(
    trace_id="trace_id_here",
    observation_id="observation_id_here", # optional
    name="correctness",
    value="correct",
    comment="Factually correct", # optional
    score_id="unique_id", # optional, can be used as an idempotency key to update the score subsequently
    config_id="12345-6565-3453654-43543", # optional, to ensure that the score maps to a specific category defined in a score config
    data_type="CATEGORICAL" # optional, possibly inferred
)

# Method 2: Score within context
with langfuse.start_as_current_observation(as_type="span", name="my-operation") as span:
    span.score(
        name="correctness",
        value="correct",
        comment="Factually correct",
        config_id="12345-6565-3453654-43543",
        data_type="CATEGORICAL"
    )

Boolean (Python):

from langfuse import get_client
langfuse = get_client()

# Method 1: Score via low-level method
langfuse.create_score(
    trace_id="trace_id_here",
    observation_id="observation_id_here", # optional
    name="helpfulness",
    value=1,
    comment="Factually correct", # optional
    score_id="unique_id", # optional, can be used as an idempotency key to update the score subsequently
    config_id="93547-6565-3453654-43543", # optional, can be used to infer the score data type and validate the score value
    data_type="BOOLEAN" # optional, possibly inferred
)

# Method 2: Score within context
with langfuse.start_as_current_observation(as_type="span", name="my-operation") as span:
    span.score(
        name="helpfulness",
        value=1,
        comment="Factually correct",
        config_id="93547-6565-3453654-43543",
        data_type="BOOLEAN"
    )

Text (Python):

from langfuse import get_client
langfuse = get_client()

# Method 1: Score via low-level method
langfuse.create_score(
    trace_id="trace_id_here",
    observation_id="observation_id_here", # optional
    name="reviewer_notes",
    value="The response was helpful but could be more concise.",
    comment="Reviewed by QA team", # optional
    score_id="unique_id", # optional, can be used as an idempotency key to update the score subsequently
    config_id="24680-6565-3453654-43543", # optional
    data_type="TEXT" # optional, possibly inferred
)

# Method 2: Score within context
with langfuse.start_as_current_observation(as_type="span", name="my-operation") as span:
    span.score(
        name="reviewer_notes",
        value="The response was helpful but could be more concise.",
        comment="Reviewed by QA team",
        config_id="24680-6565-3453654-43543",
        data_type="TEXT"
    )

JS/TS(configId 사용):

import { LangfuseClient } from "@langfuse/client";

const langfuse = new LangfuseClient();

langfuse.score.create({
  traceId: message.traceId,
  observationId: message.generationId, // optional
  name: "accuracy",
  value: 0.9,
  comment: "Factually correct", // optional
  id: "unique_id", // optional, can be used as an idempotency key to update the score subsequently
  configId: "78545-6565-3453654-43543", // optional, to ensure that the score follows a specific min/max value range
  dataType: "NUMERIC", // optional, possibly inferred
});

// Flush the scores in short-lived environments
await langfuse.flush();

Categorical/Boolean/Text 점수의 JS/TS와 curl 예시는 위 Python 예시와 동일한 패턴을 따릅니다. configId를 제공하면 점수 값이 config의 카테고리(범주형), 0/1(불리언), 비어 있지 않은 500자 이하 문자열(텍스트), 또는 숫자 범위(숫자형)에 대해 검증됩니다.

REST API 로도 configId를 제공해 score config을 강제할 수 있습니다. 예:

curl -X POST https://cloud.langfuse.com/api/public/scores \
  -u "pk-lf-...":"sk-lf-..." \
  -H "Content-Type: application/json" \
  -d '{
    "id": "unique_id",
    "traceId": "trace_id_here",
    "observationId": "observation_id_here",
    "name": "accuracy",
    "value": 0.9,
    "dataType": "NUMERIC",
    "configId": "78545-6565-3453654-43543",
    "comment": "Factually correct"
  }'

score config의 POST/GET 엔드포인트에 대한 자세한 내용은 API reference 를 참고하세요.

추론된 점수 속성(Inferred Score Properties)

일부 점수 속성은 내 입력에 따라 추론될 수 있습니다:

  • 점수 데이터 타입을 제공하지 않으면 항상 추론됩니다. 자세한 내용은 아래 표를 참고하세요.
  • boolean 및 categorical 점수의 경우 가능하면 점수 값을 숫자와 문자열 형식 모두로 제공합니다. 입력으로 제공되지 않은 점수 값 형식, 즉 번역된 값을 아래 표에서 inferred value라고 합니다.
  • v3 scores API 로 읽으면 boolean 점수는 단일 boolean value로 반환됩니다.
  • categorical 점수의 경우 문자열 표현이 항상 제공되며 ScoreConfig가 제공된 경우에만 카테고리의 숫자 매핑이 생성됩니다.

Numeric 점수(accuracy) 시나리오:

Value Data Type Config Id 설명 Inferred Data Type Valid
0.9 Null Null 데이터 타입 추론됨 NUMERIC
0.9 NUMERIC Null 추론된 속성 없음
depth NUMERIC Null 오류: 값의 데이터 타입이 제공된 데이터 타입과 일치하지 않음 아니요
0.9 NUMERIC 78545 추론된 속성 없음 config 검증 조건부
0.9 Null 78545 데이터 타입 추론됨 NUMERIC config 검증 조건부
depth NUMERIC 78545 오류: 값의 데이터 타입이 제공된 데이터 타입과 일치하지 않음 아니요

Categorical 점수(correctness) 시나리오:

Value Data Type Config Id 설명 Inferred Data Type Inferred Value 표현 Valid
correct Null Null 데이터 타입 추론됨 CATEGORICAL
correct CATEGORICAL Null 추론된 속성 없음
1 CATEGORICAL Null 오류: 값의 데이터 타입이 제공된 데이터 타입과 일치하지 않음 아니요
correct CATEGORICAL 12345 숫자 값 추론됨 4 numeric config category mapping config 검증 조건부
correct NULL 12345 데이터 타입 추론됨 CATEGORICAL config 검증 조건부
1 CATEGORICAL 12345 오류: 값의 데이터 타입이 제공된 데이터 타입과 일치하지 않음 아니요

Boolean 점수(helpfulness) 시나리오:

Value Data Type Config Id 설명 Inferred Data Type Inferred Value 표현 Valid
1 BOOLEAN Null 값의 문자열 등가물 추론됨 True
true BOOLEAN Null 오류: 값의 데이터 타입이 제공된 데이터 타입과 일치하지 않음 아니요
3 BOOLEAN Null 오류: boolean 데이터 타입은 입력 값으로 0 또는 1을 기대함 아니요
0.9 Null 93547 데이터 타입과 값의 문자열 등가물 추론됨 BOOLEAN True config 검증 조건부
depth BOOLEAN 93547 오류: 값의 데이터 타입이 제공된 데이터 타입과 일치하지 않음 아니요

Text 점수(reviewer notes) 시나리오 — 비어 있지 않은 최대 500자 문자열이어야 함:

Value Data Type Config Id 설명 Inferred Data Type Valid
"Good response" Null Null 데이터 타입 추론됨 TEXT
"Good response" TEXT Null 추론된 속성 없음
0.9 TEXT Null 오류: 값의 데이터 타입이 제공된 데이터 타입과 일치하지 않음 아니요
"Good response" TEXT 24680 추론된 속성 없음 config 검증 조건부
"Good response" Null 24680 데이터 타입 추론됨 TEXT config 검증 조건부
"" TEXT Null 오류: text 점수는 비어 있지 않아야 함 아니요

API/SDK로 기존 점수 업데이트

점수를 만들 때 선택적 id(JS/TS) / score_id(Python) 매개변수를 제공할 수 있습니다. 재수집된 점수는 id, name, timestamp(일 단위 정밀도, toDate(timestamp))가 모두 일치할 때만 기존 점수를 덮어씁니다. id만 일치하는 것만으로는 충분하지 않으며, 어떤 차이든 업데이트가 아니라 중복을 만듭니다.

기존 점수를 먼저 조회하지 않고 덮어쓰려면, 초기 생성 시 안정적인 id를 멱등성 키로 설정하고 이후 호출에서 nametimestamp를 그대로 유지하세요. 자세한 내용은 중복 점수 방지 를 참고하세요.

관련 가이드(Related guides)

  • 사용자 피드백 수집 — 브라우저 SDK로 보낸 인앱 평점을 포함해 명시적/암묵적 사용자 피드백을 traces의 점수로 캡처
  • 커스텀 평가 데이터 파이프라인 — traces를 가져오고, 커스텀 평가를 실행하고, 점수를 다시 Langfuse에 수집해 품질을 지속적으로 모니터링
  • 구조화 추출용 필드별 점수 — 출력 필드당 하나의 boolean 점수를 발행해 문서 추출을 평가하고, 통합 정확도가 숨기는 회귀를 잡음
  • 가드레일 및 보안 검사 — 출력에 특정 키워드가 포함되는지, 필요한 구조/형식과 일치하는지, 길이 제한을 초과하는지 확인
  • 커스텀 내부 워크플로우 도구 — 인간 개입(인 더 루프) 워크플로우를 위한 내부 도구를 구축하고, 커스텀 스키마에 따라 점수를 다시 Langfuse에 수집
  • 세션 수준 품질 추적 — SDK 또는 API의 sessionId로 점수를 연결해 지원 채팅이나 에이전트 스레드 같은 전체 대화에 점수 부여

더 알아보기 (Learn more)