From c00ae792b1bd8023a3557dd07bea755b812b5001 Mon Sep 17 00:00:00 2001 From: Casey Waldren Date: Tue, 5 Nov 2024 13:46:55 -0800 Subject: [PATCH] rename config tracker to LdAiClient --- pkgs/sdk/server-ai/src/Config/LdAiConfig.cs | 6 +++--- .../server-ai/src/{LdAiConfigTracker.cs => LdAiClient.cs} | 4 ++-- .../test/{LdAiConfigTrackerTest.cs => LdAiClientTest.cs} | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) rename pkgs/sdk/server-ai/src/{LdAiConfigTracker.cs => LdAiClient.cs} (97%) rename pkgs/sdk/server-ai/test/{LdAiConfigTrackerTest.cs => LdAiClientTest.cs} (94%) diff --git a/pkgs/sdk/server-ai/src/Config/LdAiConfig.cs b/pkgs/sdk/server-ai/src/Config/LdAiConfig.cs index 8b78ba0d..2f460862 100644 --- a/pkgs/sdk/server-ai/src/Config/LdAiConfig.cs +++ b/pkgs/sdk/server-ai/src/Config/LdAiConfig.cs @@ -46,12 +46,12 @@ public class LdAiConfig /// /// TBD /// - public readonly LdAiConfigTracker Tracker; + public readonly LdAiClient Tracker; private readonly Meta _meta; private readonly IReadOnlyDictionary _model; private readonly bool _enabled; - private LdAiConfig(bool enabled, LdAiConfigTracker tracker, IEnumerable prompt, Meta meta, IReadOnlyDictionary model) + private LdAiConfig(bool enabled, LdAiClient tracker, IEnumerable prompt, Meta meta, IReadOnlyDictionary model) { Tracker = tracker; Prompt = prompt?.ToList(); @@ -60,7 +60,7 @@ private LdAiConfig(bool enabled, LdAiConfigTracker tracker, IEnumerable prompt, Meta meta, + internal LdAiConfig(LdAiClient tracker, IEnumerable prompt, Meta meta, IReadOnlyDictionary model) : this(true, tracker, prompt, meta, model) {} diff --git a/pkgs/sdk/server-ai/src/LdAiConfigTracker.cs b/pkgs/sdk/server-ai/src/LdAiClient.cs similarity index 97% rename from pkgs/sdk/server-ai/src/LdAiConfigTracker.cs rename to pkgs/sdk/server-ai/src/LdAiClient.cs index 214cf058..25cdf1c4 100644 --- a/pkgs/sdk/server-ai/src/LdAiConfigTracker.cs +++ b/pkgs/sdk/server-ai/src/LdAiClient.cs @@ -61,7 +61,7 @@ public interface ILaunchDarklyClient /// /// TBD /// - public sealed class LdAiConfigTracker : IDisposable + public sealed class LdAiClient : IDisposable { private readonly ILaunchDarklyClient _client; @@ -70,7 +70,7 @@ public sealed class LdAiConfigTracker : IDisposable /// TBD /// /// an ILaunchDarklyClient - public LdAiConfigTracker(ILaunchDarklyClient client) + public LdAiClient(ILaunchDarklyClient client) { _client = client; } diff --git a/pkgs/sdk/server-ai/test/LdAiConfigTrackerTest.cs b/pkgs/sdk/server-ai/test/LdAiClientTest.cs similarity index 94% rename from pkgs/sdk/server-ai/test/LdAiConfigTrackerTest.cs rename to pkgs/sdk/server-ai/test/LdAiClientTest.cs index d0e08a8c..14d1bd9d 100644 --- a/pkgs/sdk/server-ai/test/LdAiConfigTrackerTest.cs +++ b/pkgs/sdk/server-ai/test/LdAiClientTest.cs @@ -10,7 +10,7 @@ public class LdAiTrackerTest [Fact] public void CanCallDispose() { - var tracker = new LdAiConfigTracker(null); + var tracker = new LdAiClient(null); tracker.Dispose(); } @@ -29,7 +29,7 @@ public void ReturnsDefaultConfigWhenFlagNotFound() mockClient.Setup(x => x.GetLogger()).Returns(mockLogger.Object); - var tracker = new LdAiConfigTracker(mockClient.Object); + var tracker = new LdAiClient(mockClient.Object); var config = tracker.GetModelConfig("foo", Context.New(ContextKind.Default, "key"), LdAiConfig.Default); @@ -80,7 +80,7 @@ public void ConfigNotEnabledReturnsDisabledInstance(string json) mockClient.Setup(x => x.GetLogger()).Returns(mockLogger.Object); - var tracker = new LdAiConfigTracker(mockClient.Object); + var tracker = new LdAiClient(mockClient.Object); var config = tracker.GetModelConfig("foo", Context.New(ContextKind.Default, "key"), null); Assert.Equal(config, LdAiConfig.Disabled);