Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

1.2 KB
Raw Blame
import {
  type MonitorThresholdOperator,
  type MonitorView,
  type MonitorWindow,
} from "@langfuse/shared/monitors";

/** windowLabels maps each MonitorWindow enum value to a human label. */
export const windowLabels: Record<MonitorWindow, string> = {
  "5m": "5 minutes",
  "10m": "10 minutes",
  "15m": "15 minutes",
  "30m": "30 minutes",
  "1h": "1 hour",
  "2h": "2 hours",
  "4h": "4 hours",
  "1d": "1 day",
  "2d": "2 days",
  "1w": "1 week",
};

/** operatorLabels maps each MonitorThresholdOperator to a natural-language label. */
export const operatorLabels: Record<MonitorThresholdOperator, string> = {
  GT: "above",
  GTE: "above or equal to",
  LT: "below",
  LTE: "below or equal to",
  EQ: "equal to",
  NEQ: "not equal to",
};

/** operatorSymbol maps each MonitorThresholdOperator to a single math glyph. */
export const operatorSymbol: Record<MonitorThresholdOperator, string> = {
  GT: ">",
  GTE: "≥",
  LT: "<",
  LTE: "≤",
  EQ: "=",
  NEQ: "≠",
};

/** viewLabels maps each MonitorView to a human label. */
export const viewLabels: Record<MonitorView, string> = {
  observations: "Observations",
  "scores-numeric": "Scores (numeric)",
  "scores-boolean": "Scores (boolean)",
  "scores-categorical": "Scores (categorical)",
};