@@ -123,7 +123,7 @@ def test_short_text_valid_response_hallucination_v0_2(self):
123
123
config = Config ({'hallucination_v0.2' : 'default' })
124
124
client = Client (api_key = API_KEY , email = "preetam@aimon.ai" )
125
125
short_text = "Yes"
126
- data_to_send = [{"context" : "This is the context" , "generated_text" : short_text }]
126
+ data_to_send = [{"context" : "This is the context" , "user_query" : "summarization" , " generated_text" : short_text }]
127
127
response = client .detect (data_to_send , config = config )[0 ]
128
128
assert "hallucination_v0.2" in response
129
129
assert "is_hallucinated" in response ['hallucination_v0.2' ]
@@ -138,7 +138,7 @@ def test_special_characters_valid_response_hallucination_v0_2(self):
138
138
config = Config ({'hallucination_v0.2' : 'default' })
139
139
client = Client (api_key = API_KEY , email = "preetam@aimon.ai" )
140
140
special_text = "!@#$%^&*()_+"
141
- data_to_send = [{"context" : "This is the context" , "generated_text" : special_text }]
141
+ data_to_send = [{"context" : "This is the context" , "user_query" : "summarization" , " generated_text" : special_text }]
142
142
response = client .detect (data_to_send , config = config )[0 ]
143
143
assert "hallucination_v0.2" in response
144
144
assert "is_hallucinated" in response ['hallucination_v0.2' ]
@@ -185,7 +185,6 @@ def test_valid_data_valid_response_instruction_adherence(self):
185
185
assert "results" in response ["instruction_adherence" ]
186
186
assert len (response ["instruction_adherence" ]["results" ]) == 3
187
187
assert "instruction" in response ["instruction_adherence" ]["results" ][2 ]
188
- assert "examples" in response ["instruction_adherence" ]["results" ][2 ]
189
188
assert "detailed_explanation" in response ["instruction_adherence" ]["results" ][2 ]
190
189
assert "adherence" in response ["instruction_adherence" ]["results" ][2 ]
191
190
# print(response)
0 commit comments