@@ -48,9 +48,9 @@ def tracker(td: TestData) -> LDAIConfigTracker:
4848def ldai_client (client : LDClient ) -> LDAIClient :
4949 return LDAIClient (client )
5050
51- def test_model_config_interpolation (ldai_client : LDAIClient ):
51+ def test_model_config_interpolation (ldai_client : LDAIClient , td ):
5252 context = Context .create ('user-key' )
53- default_value = AIConfig (config = AIConfigData (model = { 'modelId' : 'fakeModel' }, prompt = [LDMessage (role = 'system' , content = 'Hello, {{name}}!' )]), tracker = tracker (td () ), enabled = True )
53+ default_value = AIConfig (config = AIConfigData (model = { 'modelId' : 'fakeModel' }, prompt = [LDMessage (role = 'system' , content = 'Hello, {{name}}!' )]), tracker = tracker (td ), enabled = True )
5454 variables = {'name' : 'World' }
5555
5656 config = ldai_client .model_config ('model-config' , context , default_value , variables )
@@ -60,9 +60,9 @@ def test_model_config_interpolation(ldai_client: LDAIClient):
6060 assert config .config .prompt [0 ].content == 'Hello, World!'
6161 assert config .enabled is True
6262
63- def test_model_config_no_variables (ldai_client : LDAIClient ):
63+ def test_model_config_no_variables (ldai_client : LDAIClient , td ):
6464 context = Context .create ('user-key' )
65- default_value = AIConfig (config = AIConfigData (model = {}, prompt = []), tracker = tracker (td () ), enabled = True )
65+ default_value = AIConfig (config = AIConfigData (model = {}, prompt = []), tracker = tracker (td ), enabled = True )
6666
6767 config = ldai_client .model_config ('model-config' , context , default_value , {})
6868
@@ -71,9 +71,9 @@ def test_model_config_no_variables(ldai_client: LDAIClient):
7171 assert config .config .prompt [0 ].content == 'Hello, !'
7272 assert config .enabled is True
7373
74- def test_context_interpolation (ldai_client : LDAIClient ):
74+ def test_context_interpolation (ldai_client : LDAIClient , td ):
7575 context = Context .builder ('user-key' ).name ("Sandy" ).build ()
76- default_value = AIConfig (config = AIConfigData (model = {}, prompt = []), tracker = tracker (td () ), enabled = True )
76+ default_value = AIConfig (config = AIConfigData (model = {}, prompt = []), tracker = tracker (td ), enabled = True )
7777 variables = {'name' : 'World' }
7878
7979 config = ldai_client .model_config ('ctx-interpolation' , context , default_value , variables )
@@ -83,9 +83,9 @@ def test_context_interpolation(ldai_client: LDAIClient):
8383 assert config .config .prompt [0 ].content == 'Hello, Sandy!'
8484 assert config .enabled is True
8585
86- def test_model_config_multiple (ldai_client : LDAIClient ):
86+ def test_model_config_multiple (ldai_client : LDAIClient , td ):
8787 context = Context .create ('user-key' )
88- default_value = AIConfig (config = AIConfigData (model = {}, prompt = []), tracker = tracker (td () ), enabled = True )
88+ default_value = AIConfig (config = AIConfigData (model = {}, prompt = []), tracker = tracker (td ), enabled = True )
8989 variables = {'name' : 'World' , 'day' : 'Monday' }
9090
9191 config = ldai_client .model_config ('multiple-prompt' , context , default_value , variables )
@@ -96,9 +96,9 @@ def test_model_config_multiple(ldai_client: LDAIClient):
9696 assert config .config .prompt [1 ].content == 'The day is, Monday!'
9797 assert config .enabled is True
9898
99- def test_model_config_disabled (ldai_client : LDAIClient ):
99+ def test_model_config_disabled (ldai_client : LDAIClient , td ):
100100 context = Context .create ('user-key' )
101- default_value = AIConfig (config = AIConfigData (model = {}, prompt = []), tracker = tracker (td () ), enabled = False )
101+ default_value = AIConfig (config = AIConfigData (model = {}, prompt = []), tracker = tracker (td ), enabled = False )
102102
103103 config = ldai_client .model_config ('off-config' , context , default_value , {})
104104
0 commit comments