@@ -109,17 +109,12 @@ def ldai_client(client: LDClient) -> LDAIClient:
109
109
110
110
111
111
def test_model_config_delegates_to_properties ():
112
- model = ModelConfig ('fakeModel' , temperature = 0.5 , max_tokens = 4096 , attributes = {'extra-attribute' : 'value' })
112
+ model = ModelConfig ('fakeModel' , parameters = {'extra-attribute' : 'value' })
113
113
assert model .id == 'fakeModel'
114
- assert model .temperature == 0.5
115
- assert model .max_tokens == 4096
116
- assert model .get_attribute ('extra-attribute' ) == 'value'
117
- assert model .get_attribute ('non-existent' ) is None
114
+ assert model .get_parameter ('extra-attribute' ) == 'value'
115
+ assert model .get_parameter ('non-existent' ) is None
118
116
119
- assert model .id == model .get_attribute ('id' )
120
- assert model .temperature == model .get_attribute ('temperature' )
121
- assert model .max_tokens == model .get_attribute ('maxTokens' )
122
- assert model .max_tokens != model .get_attribute ('max_tokens' )
117
+ assert model .id == model .get_parameter ('id' )
123
118
124
119
125
120
def test_model_config_interpolation (ldai_client : LDAIClient , tracker ):
@@ -141,8 +136,8 @@ def test_model_config_interpolation(ldai_client: LDAIClient, tracker):
141
136
142
137
assert config .model is not None
143
138
assert config .model .id == 'fakeModel'
144
- assert config .model .temperature == 0.5
145
- assert config .model .max_tokens == 4096
139
+ assert config .model .get_parameter ( ' temperature' ) == 0.5
140
+ assert config .model .get_parameter ( 'maxTokens' ) == 4096
146
141
147
142
148
143
def test_model_config_no_variables (ldai_client : LDAIClient , tracker ):
@@ -158,8 +153,8 @@ def test_model_config_no_variables(ldai_client: LDAIClient, tracker):
158
153
159
154
assert config .model is not None
160
155
assert config .model .id == 'fakeModel'
161
- assert config .model .temperature == 0.5
162
- assert config .model .max_tokens == 4096
156
+ assert config .model .get_parameter ( ' temperature' ) == 0.5
157
+ assert config .model .get_parameter ( 'maxTokens' ) == 4096
163
158
164
159
165
160
def test_provider_config_handling (ldai_client : LDAIClient , tracker ):
@@ -189,9 +184,9 @@ def test_context_interpolation(ldai_client: LDAIClient, tracker):
189
184
190
185
assert config .model is not None
191
186
assert config .model .id == 'fakeModel'
192
- assert config .model .temperature is None
193
- assert config .model .max_tokens is None
194
- assert config .model .get_attribute ('extra-attribute' ) == 'I can be anything I set my mind/type to'
187
+ assert config .model .get_parameter ( ' temperature' ) is None
188
+ assert config .model .get_parameter ( 'maxTokens' ) is None
189
+ assert config .model .get_parameter ('extra-attribute' ) == 'I can be anything I set my mind/type to'
195
190
196
191
197
192
def test_model_config_multiple (ldai_client : LDAIClient , tracker ):
@@ -211,8 +206,8 @@ def test_model_config_multiple(ldai_client: LDAIClient, tracker):
211
206
212
207
assert config .model is not None
213
208
assert config .model .id == 'fakeModel'
214
- assert config .model .temperature == 0.7
215
- assert config .model .max_tokens == 8192
209
+ assert config .model .get_parameter ( ' temperature' ) == 0.7
210
+ assert config .model .get_parameter ( 'maxTokens' ) == 8192
216
211
217
212
218
213
def test_model_config_disabled (ldai_client : LDAIClient , tracker ):
@@ -224,8 +219,8 @@ def test_model_config_disabled(ldai_client: LDAIClient, tracker):
224
219
assert config .model is not None
225
220
assert config .enabled is False
226
221
assert config .model .id == 'fakeModel'
227
- assert config .model .temperature == 0.1
228
- assert config .model .max_tokens is None
222
+ assert config .model .get_parameter ( ' temperature' ) == 0.1
223
+ assert config .model .get_parameter ( 'maxTokens' ) is None
229
224
230
225
231
226
def test_model_initial_config_disabled (ldai_client : LDAIClient , tracker ):
0 commit comments