@@ -154,11 +154,11 @@ def test_retrieve_attachments_on_proper_input():
154
154
query = "Tell me about Kubernetes" ,
155
155
conversation_id = conversation_id ,
156
156
attachments = [
157
- {
158
- " attachment_type" : "log" ,
159
- " content_type" : "text/plain" ,
160
- " content" : "this is attachment" ,
161
- } ,
157
+ Attachment (
158
+ attachment_type = "log" ,
159
+ content_type = "text/plain" ,
160
+ content = "this is attachment" ,
161
+ ) ,
162
162
],
163
163
)
164
164
attachments = ols .retrieve_attachments (llm_request )
@@ -180,11 +180,11 @@ def test_retrieve_attachments_on_improper_attachment_type():
180
180
query = "Tell me about Kubernetes" ,
181
181
conversation_id = conversation_id ,
182
182
attachments = [
183
- {
184
- " attachment_type" : "not-correct-one" ,
185
- " content_type" : "text/plain" ,
186
- " content" : "this is attachment" ,
187
- } ,
183
+ Attachment (
184
+ attachment_type = "not-correct-one" ,
185
+ content_type = "text/plain" ,
186
+ content = "this is attachment" ,
187
+ ) ,
188
188
],
189
189
)
190
190
with pytest .raises (
@@ -201,11 +201,11 @@ def test_retrieve_attachments_on_improper_content_type():
201
201
query = "Tell me about Kubernetes" ,
202
202
conversation_id = conversation_id ,
203
203
attachments = [
204
- {
205
- " attachment_type" : "log" ,
206
- " content_type" : "not/known" ,
207
- " content" : "this is attachment" ,
208
- } ,
204
+ Attachment (
205
+ attachment_type = "log" ,
206
+ content_type = "not/known" ,
207
+ content = "this is attachment" ,
208
+ ) ,
209
209
],
210
210
)
211
211
with pytest .raises (
@@ -230,7 +230,7 @@ def test_store_conversation_history():
230
230
llm_request ,
231
231
response ,
232
232
[],
233
- [] ,
233
+ {} ,
234
234
)
235
235
236
236
expected_history = CacheEntry (query = HumanMessage (query ))
@@ -273,11 +273,11 @@ def test_store_conversation_history_empty_user_id():
273
273
llm_request = LLMRequest (query = "Tell me about Kubernetes" )
274
274
with pytest .raises (HTTPException , match = "Invalid user ID" ):
275
275
ols .store_conversation_history (
276
- user_id , conversation_id , llm_request , "" , [], []
276
+ user_id , conversation_id , llm_request , "" , [], {}
277
277
)
278
278
with pytest .raises (HTTPException , match = "Invalid user ID" ):
279
279
ols .store_conversation_history (
280
- user_id , conversation_id , llm_request , None , [], []
280
+ user_id , conversation_id , llm_request , None , [], {}
281
281
)
282
282
283
283
@@ -289,7 +289,7 @@ def test_store_conversation_history_improper_user_id():
289
289
llm_request = LLMRequest (query = "Tell me about Kubernetes" )
290
290
with pytest .raises (HTTPException , match = "Invalid user ID" ):
291
291
ols .store_conversation_history (
292
- user_id , conversation_id , llm_request , "" , [], []
292
+ user_id , conversation_id , llm_request , "" , [], {}
293
293
)
294
294
295
295
@@ -300,7 +300,7 @@ def test_store_conversation_history_improper_conversation_id():
300
300
llm_request = LLMRequest (query = "Tell me about Kubernetes" )
301
301
with pytest .raises (HTTPException , match = "Invalid conversation ID" ):
302
302
ols .store_conversation_history (
303
- constants .DEFAULT_USER_UID , conversation_id , llm_request , "" , [], []
303
+ constants .DEFAULT_USER_UID , conversation_id , llm_request , "" , [], {}
304
304
)
305
305
306
306
@@ -469,6 +469,7 @@ def test_query_filter_with_one_redact_filter():
469
469
llm_request = LLMRequest (query = query , conversation_id = conversation_id )
470
470
471
471
# use one custom filter
472
+ assert config .ols_config .query_filters is not None
472
473
q = Redactor (config .ols_config .query_filters )
473
474
q .regex_filters = [
474
475
RegexFilter (
@@ -492,6 +493,7 @@ def test_query_filter_with_two_redact_filters():
492
493
llm_request = LLMRequest (query = query , conversation_id = conversation_id )
493
494
494
495
# use two custom filters
496
+ assert config .ols_config .query_filters is not None
495
497
q = Redactor (config .ols_config .query_filters )
496
498
q .regex_filters = [
497
499
RegexFilter (
@@ -566,6 +568,7 @@ def test_attachments_redact_with_one_filter_defined():
566
568
]
567
569
568
570
# use two custom filters
571
+ assert config .ols_config .query_filters is not None
569
572
q = Redactor (config .ols_config .query_filters )
570
573
q .regex_filters = [
571
574
RegexFilter (
@@ -612,6 +615,7 @@ def test_attachments_redact_with_two_filters_defined():
612
615
]
613
616
614
617
# use two custom filters
618
+ assert config .ols_config .query_filters is not None
615
619
q = Redactor (config .ols_config .query_filters )
616
620
q .regex_filters = [
617
621
RegexFilter (
0 commit comments