@@ -77,7 +77,7 @@ private LdAiCompletionConfig BuildCompletionFromDefault(
7777 string key ,
7878 LdAiCompletionConfigDefault defaultValue ,
7979 IReadOnlyDictionary < string , object > mergedVars ,
80- Func < LdAiConfigBase , ILdAiConfigTracker > trackerFactory )
80+ Func < LdAiConfig , ILdAiConfigTracker > trackerFactory )
8181 {
8282 // Caller-supplied default messages can contain Mustache templates too; interpolate
8383 // with the same per-message fallback as server-returned configs.
@@ -93,16 +93,16 @@ private LdAiCompletionConfig BuildCompletionFromDefault(
9393 trackerFactory ) ;
9494 }
9595
96- private IReadOnlyList < Message > InterpolateMessages (
97- IReadOnlyList < Message > messages ,
96+ private IReadOnlyList < LdAiConfigTypes . Message > InterpolateMessages (
97+ IReadOnlyList < LdAiConfigTypes . Message > messages ,
9898 IReadOnlyDictionary < string , object > mergedVars ,
9999 string key )
100100 {
101101 if ( messages == null )
102102 {
103- return new List < Message > ( ) ;
103+ return new List < LdAiConfigTypes . Message > ( ) ;
104104 }
105- var result = new List < Message > ( messages . Count ) ;
105+ var result = new List < LdAiConfigTypes . Message > ( messages . Count ) ;
106106 for ( var i = 0 ; i < messages . Count ; i ++ )
107107 {
108108 var msg = messages [ i ] ;
@@ -117,12 +117,12 @@ private IReadOnlyList<Message> InterpolateMessages(
117117 $ "AI Config '{ key } ': skipping interpolation of malformed template in message { i } : { ex . Message } ") ;
118118 interpolated = msg . Content ;
119119 }
120- result . Add ( new Message ( interpolated , msg . Role ) ) ;
120+ result . Add ( new LdAiConfigTypes . Message ( interpolated , msg . Role ) ) ;
121121 }
122122 return result ;
123123 }
124124
125- private Func < LdAiConfigBase , ILdAiConfigTracker > TrackerFactoryFor ( Context context )
125+ private Func < LdAiConfig , ILdAiConfigTracker > TrackerFactoryFor ( Context context )
126126 {
127127 return cfg => new LdAiConfigTracker (
128128 _client ,
@@ -148,18 +148,18 @@ private static (bool Enabled, string VariationKey, int Version, string Mode) Par
148148 return ( enabled , variationKey , version , mode ) ;
149149 }
150150
151- private static ModelConfig ParseModel ( LdValue modelValue )
151+ private static LdAiConfigTypes . ModelConfig ParseModel ( LdValue modelValue )
152152 {
153153 var name = modelValue . Get ( "name" ) . AsString ?? "" ;
154154 var parameters = LdValueObjectToDictionary ( modelValue . Get ( "parameters" ) ) ;
155155 var custom = LdValueObjectToDictionary ( modelValue . Get ( "custom" ) ) ;
156- return new ModelConfig ( name , parameters , custom ) ;
156+ return new LdAiConfigTypes . ModelConfig ( name , parameters , custom ) ;
157157 }
158158
159- private static ProviderConfig ParseProvider ( LdValue providerValue )
159+ private static LdAiConfigTypes . ProviderConfig ParseProvider ( LdValue providerValue )
160160 {
161161 var name = providerValue . Get ( "name" ) . AsString ?? "" ;
162- return new ProviderConfig ( name ) ;
162+ return new LdAiConfigTypes . ProviderConfig ( name ) ;
163163 }
164164
165165 private static IReadOnlyDictionary < string , LdValue > LdValueObjectToDictionary ( LdValue value )
@@ -173,14 +173,14 @@ private static IReadOnlyDictionary<string, LdValue> LdValueObjectToDictionary(Ld
173173 return value . Dictionary . ToDictionary ( kv => kv . Key , kv => kv . Value ) ;
174174 }
175175
176- private static IReadOnlyList < Message > ParseMessages ( LdValue messagesValue )
176+ private static IReadOnlyList < LdAiConfigTypes . Message > ParseMessages ( LdValue messagesValue )
177177 {
178178 if ( messagesValue . Type != LdValueType . Array )
179179 {
180- return new List < Message > ( ) ;
180+ return new List < LdAiConfigTypes . Message > ( ) ;
181181 }
182182
183- var result = new List < Message > ( messagesValue . Count ) ;
183+ var result = new List < LdAiConfigTypes . Message > ( messagesValue . Count ) ;
184184 for ( var i = 0 ; i < messagesValue . Count ; i ++ )
185185 {
186186 var msg = messagesValue . Get ( i ) ;
@@ -190,20 +190,20 @@ private static IReadOnlyList<Message> ParseMessages(LdValue messagesValue)
190190 }
191191 var content = msg . Get ( "content" ) . AsString ?? "" ;
192192 var role = ParseRole ( msg . Get ( "role" ) . AsString ) ;
193- result . Add ( new Message ( content , role ) ) ;
193+ result . Add ( new LdAiConfigTypes . Message ( content , role ) ) ;
194194 }
195195 return result ;
196196 }
197197
198- private static Role ParseRole ( string roleString )
198+ private static LdAiConfigTypes . Role ParseRole ( string roleString )
199199 {
200200 // The wire format uses capitalized "User" / "System" / "Assistant"; Enum.TryParse with
201201 // ignoreCase = true is tolerant of casing variants. Unknown / null roles fall back to User.
202- if ( ! string . IsNullOrEmpty ( roleString ) && Enum . TryParse < Role > ( roleString , ignoreCase : true , out var parsed ) )
202+ if ( ! string . IsNullOrEmpty ( roleString ) && Enum . TryParse < LdAiConfigTypes . Role > ( roleString , ignoreCase : true , out var parsed ) )
203203 {
204204 return parsed ;
205205 }
206- return Role . User ;
206+ return LdAiConfigTypes . Role . User ;
207207 }
208208
209209 private IReadOnlyDictionary < string , object > MergeVariables (
0 commit comments