@@ -88,6 +88,7 @@ public class Builder
8888 private readonly Dictionary < string , LdValue > _modelParams ;
8989 private readonly Dictionary < string , LdValue > _customModelParams ;
9090 private string _providerId ;
91+ private string _modelId ;
9192
9293 internal Builder ( )
9394 {
@@ -96,6 +97,7 @@ internal Builder()
9697 _modelParams = new Dictionary < string , LdValue > ( ) ;
9798 _customModelParams = new Dictionary < string , LdValue > ( ) ;
9899 _providerId = "" ;
100+ _modelId = "" ;
99101 }
100102
101103 /// <summary>
@@ -157,11 +159,22 @@ public Builder SetCustomModelParam(string name, LdValue value)
157159 return this ;
158160 }
159161
162+ /// <summary>
163+ /// Sets the model's ID. By default, this will be the empty string.
164+ /// </summary>
165+ /// <param name="id">the model ID</param>
166+ /// <returns>the builder</returns>
167+ public Builder SetModelId ( string id )
168+ {
169+ _modelId = id ;
170+ return this ;
171+ }
172+
160173 /// <summary>
161174 /// Sets the model provider's ID. By default, this will be the empty string.
162175 /// </summary>
163176 /// <param name="id">the ID</param>
164- /// <returns></returns>
177+ /// <returns>the builder </returns>
165178 public Builder SetModelProviderId ( string id )
166179 {
167180 _providerId = id ;
@@ -174,7 +187,18 @@ public Builder SetModelProviderId(string id)
174187 /// <returns>a new LdAiConfig</returns>
175188 public LdAiConfig Build ( )
176189 {
177- return new LdAiConfig ( _enabled , _messages , new Meta ( ) , new Model { Parameters = _modelParams , Custom = _customModelParams } , new Provider { Id = _providerId } ) ;
190+ return new LdAiConfig (
191+ _enabled ,
192+ _messages ,
193+ new Meta ( ) ,
194+ new Model
195+ {
196+ Id = _modelId ,
197+ Parameters = _modelParams ,
198+ Custom = _customModelParams
199+ } ,
200+ new Provider { Id = _providerId }
201+ ) ;
178202 }
179203 }
180204
@@ -219,6 +243,7 @@ internal LdValue ToLdValue()
219243 } ) ) ) } ,
220244 { "model" , LdValue . ObjectFrom ( new Dictionary < string , LdValue >
221245 {
246+ { "id" , LdValue . Of ( Model . Id ) } ,
222247 { "parameters" , LdValue . ObjectFrom ( Model . Parameters ) } ,
223248 { "custom" , LdValue . ObjectFrom ( Model . Custom ) }
224249 } ) } ,
0 commit comments