@@ -123,7 +123,7 @@ def test_short_text_valid_response_hallucination_v0_2(self):
123123 config = Config ({'hallucination_v0.2' : 'default' })
124124 client = Client (api_key = API_KEY , email = "preetam@aimon.ai" )
125125 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 }]
127127 response = client .detect (data_to_send , config = config )[0 ]
128128 assert "hallucination_v0.2" in response
129129 assert "is_hallucinated" in response ['hallucination_v0.2' ]
@@ -138,7 +138,7 @@ def test_special_characters_valid_response_hallucination_v0_2(self):
138138 config = Config ({'hallucination_v0.2' : 'default' })
139139 client = Client (api_key = API_KEY , email = "preetam@aimon.ai" )
140140 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 }]
142142 response = client .detect (data_to_send , config = config )[0 ]
143143 assert "hallucination_v0.2" in response
144144 assert "is_hallucinated" in response ['hallucination_v0.2' ]
@@ -185,7 +185,6 @@ def test_valid_data_valid_response_instruction_adherence(self):
185185 assert "results" in response ["instruction_adherence" ]
186186 assert len (response ["instruction_adherence" ]["results" ]) == 3
187187 assert "instruction" in response ["instruction_adherence" ]["results" ][2 ]
188- assert "examples" in response ["instruction_adherence" ]["results" ][2 ]
189188 assert "detailed_explanation" in response ["instruction_adherence" ]["results" ][2 ]
190189 assert "adherence" in response ["instruction_adherence" ]["results" ][2 ]
191190 # print(response)
0 commit comments