22from ldclient import Config , Context , LDClient
33from ldclient .integrations .test_data import TestData
44
5- from ldai .client import AIConfig , ModelConfig , LDAIClient , LDMessage
5+ from ldai .client import AIConfig , LDAIClient , LDMessage , ModelConfig
66from ldai .tracker import LDAIConfigTracker
77
88
@@ -112,6 +112,7 @@ def test_model_config_interpolation(ldai_client: LDAIClient, tracker):
112112 assert config .prompt [0 ].content == 'Hello, World!'
113113 assert config .enabled is True
114114
115+ assert config .model is not None
115116 assert config .model .id == 'fakeModel'
116117 assert config .model .temperature == 0.5
117118 assert config .model .max_tokens == 4096
@@ -128,6 +129,7 @@ def test_model_config_no_variables(ldai_client: LDAIClient, tracker):
128129 assert config .prompt [0 ].content == 'Hello, !'
129130 assert config .enabled is True
130131
132+ assert config .model is not None
131133 assert config .model .id == 'fakeModel'
132134 assert config .model .temperature == 0.5
133135 assert config .model .max_tokens == 4096
@@ -147,6 +149,7 @@ def test_context_interpolation(ldai_client: LDAIClient, tracker):
147149 assert config .prompt [0 ].content == 'Hello, Sandy!'
148150 assert config .enabled is True
149151
152+ assert config .model is not None
150153 assert config .model .id == 'fakeModel'
151154 assert config .model .temperature is None
152155 assert config .model .max_tokens is None
@@ -168,6 +171,7 @@ def test_model_config_multiple(ldai_client: LDAIClient, tracker):
168171 assert config .prompt [1 ].content == 'The day is, Monday!'
169172 assert config .enabled is True
170173
174+ assert config .model is not None
171175 assert config .model .id == 'fakeModel'
172176 assert config .model .temperature == 0.7
173177 assert config .model .max_tokens == 8192
@@ -179,6 +183,7 @@ def test_model_config_disabled(ldai_client: LDAIClient, tracker):
179183
180184 config = ldai_client .model_config ('off-config' , context , default_value , {})
181185
186+ assert config .model is not None
182187 assert config .enabled is False
183188 assert config .model .id == 'fakeModel'
184189 assert config .model .temperature == 0.1
0 commit comments