Skip to content

Commit

Permalink
rename config tracker to LdAiClient
Browse files Browse the repository at this point in the history
  • Loading branch information
cwaldren-ld committed Nov 5, 2024
1 parent 37f395d commit c00ae79
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions pkgs/sdk/server-ai/src/Config/LdAiConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ public class LdAiConfig
/// <summary>
/// TBD
/// </summary>
public readonly LdAiConfigTracker Tracker;
public readonly LdAiClient Tracker;
private readonly Meta _meta;
private readonly IReadOnlyDictionary<string, object> _model;
private readonly bool _enabled;

private LdAiConfig(bool enabled, LdAiConfigTracker tracker, IEnumerable<Message> prompt, Meta meta, IReadOnlyDictionary<string, object> model)
private LdAiConfig(bool enabled, LdAiClient tracker, IEnumerable<Message> prompt, Meta meta, IReadOnlyDictionary<string, object> model)
{
Tracker = tracker;
Prompt = prompt?.ToList();
Expand All @@ -60,7 +60,7 @@ private LdAiConfig(bool enabled, LdAiConfigTracker tracker, IEnumerable<Message
_enabled = enabled;
}

internal LdAiConfig(LdAiConfigTracker tracker, IEnumerable<Message> prompt, Meta meta,
internal LdAiConfig(LdAiClient tracker, IEnumerable<Message> prompt, Meta meta,
IReadOnlyDictionary<string, object> model) : this(true, tracker, prompt, meta, model) {}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public interface ILaunchDarklyClient
/// <summary>
/// TBD
/// </summary>
public sealed class LdAiConfigTracker : IDisposable
public sealed class LdAiClient : IDisposable
{
private readonly ILaunchDarklyClient _client;

Expand All @@ -70,7 +70,7 @@ public sealed class LdAiConfigTracker : IDisposable
/// TBD
/// </summary>
/// <param name="client">an ILaunchDarklyClient</param>
public LdAiConfigTracker(ILaunchDarklyClient client)
public LdAiClient(ILaunchDarklyClient client)
{
_client = client;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class LdAiTrackerTest
[Fact]
public void CanCallDispose()
{
var tracker = new LdAiConfigTracker(null);
var tracker = new LdAiClient(null);
tracker.Dispose();
}

Expand All @@ -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);

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit c00ae79

Please sign in to comment.