diff --git a/pkgs/sdk/server-ai/src/Config/LdAiConfig.cs b/pkgs/sdk/server-ai/src/Config/LdAiConfig.cs index 0baf031..d82f273 100644 --- a/pkgs/sdk/server-ai/src/Config/LdAiConfig.cs +++ b/pkgs/sdk/server-ai/src/Config/LdAiConfig.cs @@ -222,7 +222,7 @@ internal LdAiConfig(bool enabled, IEnumerable messages, Meta meta, Mode Model = new ModelConfiguration(model?.Id ?? "", model?.Parameters ?? new Dictionary(), model?.Custom ?? new Dictionary()); Messages = messages?.ToList() ?? new List(); - VersionKey = meta?.VersionKey ?? ""; + VariationKey = meta?.VariationKey ?? ""; Enabled = enabled; Provider = new ModelProvider(provider?.Id ?? ""); } @@ -233,7 +233,7 @@ internal LdValue ToLdValue() { "_ldMeta", LdValue.ObjectFrom( new Dictionary { - { "versionKey", LdValue.Of(VersionKey) }, + { "variationKey", LdValue.Of(VariationKey) }, { "enabled", LdValue.Of(Enabled) } }) }, { "messages", LdValue.ArrayFrom(Messages.Select(m => LdValue.ObjectFrom(new Dictionary @@ -269,7 +269,7 @@ internal LdValue ToLdValue() /// /// This field meant for internal LaunchDarkly usage. /// - public string VersionKey { get; } + public string VariationKey { get; } /// /// Convenient helper that returns a disabled LdAiConfig. diff --git a/pkgs/sdk/server-ai/src/DataModel/DataModel.cs b/pkgs/sdk/server-ai/src/DataModel/DataModel.cs index 9ed7223..3054b2f 100644 --- a/pkgs/sdk/server-ai/src/DataModel/DataModel.cs +++ b/pkgs/sdk/server-ai/src/DataModel/DataModel.cs @@ -28,10 +28,10 @@ public enum Role public class Meta { /// - /// The version key. + /// The variation key. /// - [JsonPropertyName("versionKey")] - public string VersionKey { get; set; } + [JsonPropertyName("variationKey")] + public string VariationKey { get; set; } /// /// If the config is enabled. diff --git a/pkgs/sdk/server-ai/src/LdAiConfigTracker.cs b/pkgs/sdk/server-ai/src/LdAiConfigTracker.cs index b8dc33b..c820fec 100644 --- a/pkgs/sdk/server-ai/src/LdAiConfigTracker.cs +++ b/pkgs/sdk/server-ai/src/LdAiConfigTracker.cs @@ -41,7 +41,7 @@ public LdAiConfigTracker(ILaunchDarklyClient client, string configKey, LdAiConfi _context = context; _trackData = LdValue.ObjectFrom(new Dictionary { - { "versionKey", LdValue.Of(Config.VersionKey)}, + { "variationKey", LdValue.Of(config.VariationKey)}, { "configKey" , LdValue.Of(configKey ?? throw new ArgumentNullException(nameof(configKey))) } }); } diff --git a/pkgs/sdk/server-ai/test/InterpolationTests.cs b/pkgs/sdk/server-ai/test/InterpolationTests.cs index b05f983..366f093 100644 --- a/pkgs/sdk/server-ai/test/InterpolationTests.cs +++ b/pkgs/sdk/server-ai/test/InterpolationTests.cs @@ -21,7 +21,7 @@ private string Eval(string prompt, Context context, IReadOnlyDictionary { - { "versionKey", LdValue.Of(config.VersionKey) }, + { "variationKey", LdValue.Of(config.VariationKey) }, { "configKey", LdValue.Of(flagKey) } }); var tracker = new LdAiConfigTracker(mockClient.Object, flagKey, config, context); @@ -61,7 +61,7 @@ public void CanTrackSuccess() var config = LdAiConfig.Disabled; var data = LdValue.ObjectFrom(new Dictionary { - { "versionKey", LdValue.Of(config.VersionKey) }, + { "variationKey", LdValue.Of(config.VariationKey) }, { "configKey", LdValue.Of(flagKey) } }); @@ -80,7 +80,7 @@ public async void CanTrackDurationOfTask() var config = LdAiConfig.Disabled; var data = LdValue.ObjectFrom(new Dictionary { - { "versionKey", LdValue.Of(config.VersionKey) }, + { "variationKey", LdValue.Of(config.VariationKey) }, { "configKey", LdValue.Of(flagKey) } }); @@ -114,7 +114,7 @@ public void CanTrackFeedback() var config = LdAiConfig.Disabled; var data = LdValue.ObjectFrom(new Dictionary { - { "versionKey", LdValue.Of(config.VersionKey) }, + { "variationKey", LdValue.Of(config.VariationKey) }, { "configKey", LdValue.Of(flagKey) } }); @@ -135,7 +135,7 @@ public void CanTrackTokens() var config = LdAiConfig.Disabled; var data = LdValue.ObjectFrom(new Dictionary { - { "versionKey", LdValue.Of(config.VersionKey) }, + { "variationKey", LdValue.Of(config.VariationKey) }, { "configKey", LdValue.Of(flagKey) } }); @@ -163,7 +163,7 @@ public void CanTrackResponseWithSpecificLatency() var config = LdAiConfig.Disabled; var data = LdValue.ObjectFrom(new Dictionary { - { "versionKey", LdValue.Of(config.VersionKey) }, + { "variationKey", LdValue.Of(config.VariationKey) }, { "configKey", LdValue.Of(flagKey) } }); @@ -204,7 +204,7 @@ public void CanTrackResponseWithPartialData() var config = LdAiConfig.Disabled; var data = LdValue.ObjectFrom(new Dictionary { - { "versionKey", LdValue.Of(config.VersionKey) }, + { "variationKey", LdValue.Of(config.VariationKey) }, { "configKey", LdValue.Of(flagKey) } });