| | | 1 | | namespace NexusLabs.Needlr.AgentFramework.Langfuse; |
| | | 2 | | |
| | | 3 | | /// <summary> |
| | | 4 | | /// Inert <see cref="ILangfuseSession"/> returned when Langfuse export is not configured. All |
| | | 5 | | /// members are no-ops so calling code never needs to branch on whether credentials are present. |
| | | 6 | | /// </summary> |
| | | 7 | | internal sealed class DisabledLangfuseSession : ILangfuseSession |
| | | 8 | | { |
| | | 9 | | /// <inheritdoc /> |
| | 3 | 10 | | public bool IsEnabled => false; |
| | | 11 | | |
| | | 12 | | /// <inheritdoc /> |
| | 0 | 13 | | public int ScoresFailed => 0; |
| | | 14 | | |
| | | 15 | | /// <inheritdoc /> |
| | 4 | 16 | | public ILangfuseDatasetClient Datasets { get; } = new DisabledLangfuseDatasetClient(); |
| | | 17 | | |
| | | 18 | | /// <inheritdoc /> |
| | 4 | 19 | | public ILangfuseScoreConfigClient ScoreConfigs { get; } = new DisabledLangfuseScoreConfigClient(); |
| | | 20 | | |
| | | 21 | | /// <inheritdoc /> |
| | 1 | 22 | | public bool Flush(TimeSpan? timeout = null) => true; |
| | | 23 | | |
| | | 24 | | /// <inheritdoc /> |
| | | 25 | | public ILangfuseScenario BeginScenario( |
| | | 26 | | string name, |
| | | 27 | | string? sessionId = null, |
| | | 28 | | string? userId = null, |
| | | 29 | | IEnumerable<string>? tags = null, |
| | | 30 | | IReadOnlyDictionary<string, string>? metadata = null) => |
| | 1 | 31 | | new DisabledLangfuseScenario(); |
| | | 32 | | |
| | | 33 | | /// <inheritdoc /> |
| | | 34 | | public ILangfuseExperimentRun BeginExperimentRun(string datasetName, string runName, string? runDescription = null) |
| | 0 | 35 | | new DisabledLangfuseExperimentRun(datasetName, runName); |
| | | 36 | | |
| | | 37 | | /// <inheritdoc /> |
| | | 38 | | public Task AddTraceCommentAsync(string traceId, string content, CancellationToken cancellationToken = default) => |
| | 0 | 39 | | Task.CompletedTask; |
| | | 40 | | |
| | | 41 | | /// <inheritdoc /> |
| | | 42 | | public void Dispose() |
| | | 43 | | { |
| | 4 | 44 | | } |
| | | 45 | | } |