@@ -48,9 +48,9 @@ def tracker(td: TestData) -> LDAIConfigTracker:
48
48
def ldai_client (client : LDClient ) -> LDAIClient :
49
49
return LDAIClient (client )
50
50
51
- def test_model_config_interpolation (ldai_client : LDAIClient ):
51
+ def test_model_config_interpolation (ldai_client : LDAIClient , td ):
52
52
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 )
54
54
variables = {'name' : 'World' }
55
55
56
56
config = ldai_client .model_config ('model-config' , context , default_value , variables )
@@ -60,9 +60,9 @@ def test_model_config_interpolation(ldai_client: LDAIClient):
60
60
assert config .config .prompt [0 ].content == 'Hello, World!'
61
61
assert config .enabled is True
62
62
63
- def test_model_config_no_variables (ldai_client : LDAIClient ):
63
+ def test_model_config_no_variables (ldai_client : LDAIClient , td ):
64
64
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 )
66
66
67
67
config = ldai_client .model_config ('model-config' , context , default_value , {})
68
68
@@ -71,9 +71,9 @@ def test_model_config_no_variables(ldai_client: LDAIClient):
71
71
assert config .config .prompt [0 ].content == 'Hello, !'
72
72
assert config .enabled is True
73
73
74
- def test_context_interpolation (ldai_client : LDAIClient ):
74
+ def test_context_interpolation (ldai_client : LDAIClient , td ):
75
75
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 )
77
77
variables = {'name' : 'World' }
78
78
79
79
config = ldai_client .model_config ('ctx-interpolation' , context , default_value , variables )
@@ -83,9 +83,9 @@ def test_context_interpolation(ldai_client: LDAIClient):
83
83
assert config .config .prompt [0 ].content == 'Hello, Sandy!'
84
84
assert config .enabled is True
85
85
86
- def test_model_config_multiple (ldai_client : LDAIClient ):
86
+ def test_model_config_multiple (ldai_client : LDAIClient , td ):
87
87
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 )
89
89
variables = {'name' : 'World' , 'day' : 'Monday' }
90
90
91
91
config = ldai_client .model_config ('multiple-prompt' , context , default_value , variables )
@@ -96,9 +96,9 @@ def test_model_config_multiple(ldai_client: LDAIClient):
96
96
assert config .config .prompt [1 ].content == 'The day is, Monday!'
97
97
assert config .enabled is True
98
98
99
- def test_model_config_disabled (ldai_client : LDAIClient ):
99
+ def test_model_config_disabled (ldai_client : LDAIClient , td ):
100
100
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 )
102
102
103
103
config = ldai_client .model_config ('off-config' , context , default_value , {})
104
104
0 commit comments