Skip to content

Index

NexusLabs.Needlr.AgentFramework.Langfuse Namespace

Classes
LangfuseDatasetItem A single Langfuse dataset item — one eval case. Upserted via UpsertItemAsync(LangfuseDatasetItem, CancellationToken) and later referenced by an experiment run.
LangfuseEvaluationScoreExtensions Convenience extensions for projecting Microsoft.Extensions.AI.Evaluation results onto a Langfuse scenario trace as scores.
LangfuseException The exception thrown when a request to the Langfuse API fails.
LangfuseMetric One metric in a LangfuseMetricsQuery: a measure plus an aggregation. The result column is named {Aggregation}_{Measure} (for example avg_value, sum_totalCost).
LangfuseMetricsFilter One filter in a LangfuseMetricsQuery.
LangfuseMetricsQuery A query against the Langfuse Metrics API (GET /api/public/metrics). Use it to read aggregates back from Langfuse — for example to drive a CI quality gate from recorded eval scores.
LangfuseMetricsResult The result of a LangfuseMetricsQuery. Each row is a dictionary of column name to value; aggregated columns are named {Aggregation}_{Measure} and dimension columns keep their field name.
LangfuseModelPrice A model price definition registered with Langfuse so it can compute cost for generations whose model it does not price out of the box (for example mock or internal model names). Langfuse derives cost from token usage and these prices when a generation carries no explicit cost.
LangfuseOptions Configuration for exporting Needlr agent telemetry and evaluation scores to Langfuse.
LangfusePrompt A prompt fetched from Langfuse prompt management. Use Text for a text prompt's content, and pass the prompt to SetPrompt(LangfusePrompt) to link generations to the exact version that was used.
LangfuseScoreConfig Declares the shape of a named Langfuse score so the dashboard renders consistent ranges, colors, and category sets and validates incoming values. Created via EnsureScoreConfigAsync(LangfuseScoreConfig, CancellationToken).
LangfuseScoreConfigCategory One allowed category for a Categorical score config.
LangfuseScoreError Describes a single failed attempt to upload an evaluation score to Langfuse. Passed to ScoreErrorCallback when NonFatal is in effect, so callers can log the loss with their own logger.
LangfuseServiceCollectionExtensions Registers Langfuse OTLP export on an Microsoft.Extensions.DependencyInjection.IServiceCollection for ASP.NET Core and generic-host applications.
LangfuseTelemetry Entry point for exporting Needlr agent telemetry to Langfuse without requiring a generic host. Designed for evals, console apps, and test fixtures that build telemetry by hand.
Interfaces
ILangfuseDatasetClient Creates and populates Langfuse datasets — the named collections of eval cases that experiment runs are scored against.
ILangfuseExperimentRun Represents an in-progress Langfuse experiment (dataset run). Each call to BeginItemAsync(string, string, IEnumerable<string>, IReadOnlyDictionary<string,string>, CancellationToken) starts a trace for one dataset item and links it to this run, so the scores recorded on that trace roll up into the run's experiment-comparison view.
ILangfuseMetricsClient Reads aggregates back from Langfuse via the Metrics API, so recorded eval scores (and observation metrics) can drive CI quality gates and dashboards from Langfuse as the source of truth.
ILangfuseModelClient Registers model price definitions with Langfuse so it can compute cost for generations whose model it does not price by default.
ILangfusePromptClient Fetches and creates prompts in Langfuse prompt management, so the prompt an eval runs against lives in Langfuse and the generations link to the exact version that was used.
ILangfuseScenario Represents a single Langfuse trace scoped to one eval scenario or agent run. Created via BeginScenario(string, string, string, IEnumerable<string>, IReadOnlyDictionary<string,string>).
ILangfuseScoreClient Records Langfuse scores against a known trace id. Registered in dependency injection by AddNeedlrLangfuse(this IServiceCollection, Action<LangfuseOptions>) for ASP.NET Core and generic-host applications that score their own request traces.
ILangfuseScoreConfigClient Idempotently registers Langfuse score configs so eval scores appear on the dashboard with defined data types, ranges, and category sets.
ILangfuseSession Represents an active Langfuse export session. Owns the OpenTelemetry tracer/meter providers that forward Needlr agent telemetry to Langfuse and flushes pending telemetry on disposal.
Enums
LangfuseMetricsView The Langfuse Metrics API view to query. Determines which measures and dimensions are available.
LangfuseRegion Identifies the Langfuse deployment that traces and scores are sent to. Used to derive the base URL of the OTLP ingestion endpoint when Host is not set explicitly.
LangfuseScoreDataType The data type of a Langfuse score, controlling how the score value is interpreted and displayed.
LangfuseScoreFailureMode Controls how a Langfuse scenario reacts when uploading an evaluation score to the Langfuse Scores API fails.