You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: integration-tests/src/jvmTest/kotlin/ai/koog/integration/tests/MultipleLLMPromptExecutorIntegrationTest.kt
"Expected exception for a corrupted image [400 Bad Request] was not found, got [${e.message}] instead"
804
806
)
805
807
if (model.provider ==LLMProvider.Anthropic) {
806
-
assertTrue(
807
-
e.message?.contains("Could not process image") ==true,
808
+
assertEquals(
809
+
e.message?.contains("Could not process image"),
810
+
true,
808
811
"Expected exception for a corrupted image [Could not process image] was not found, got [${e.message}] instead"
809
812
)
810
813
} elseif (model.provider ==LLMProvider.OpenAI) {
811
-
assertTrue(
814
+
assertEquals(
812
815
e.message?.contains(
813
816
"You uploaded an unsupported image. Please make sure your image is valid."
814
-
)==
815
-
true,
817
+
),
818
+
true,
816
819
"Expected exception for a corrupted image [You uploaded an unsupported image. Please make sure your image is valid.] was not found, got [${e.message}] instead"
817
820
)
818
821
}
@@ -831,37 +834,37 @@ class MultipleLLMPromptExecutorIntegrationTest {
system("You are a helpful assistant that can analyze and process text.")
858
+
859
+
user {
860
+
markdown {
861
+
+"I'm sending you a text file. Please analyze it and summarize its content."
862
+
newline()
863
+
+file.readText()
864
+
}
861
865
}
862
866
}
863
867
}
864
-
}
865
868
866
869
withRetry {
867
870
try {
@@ -871,28 +874,31 @@ class MultipleLLMPromptExecutorIntegrationTest {
871
874
when (scenario) {
872
875
TextTestScenario.EMPTY_TEXT-> {
873
876
if (model.provider ==LLMProvider.Google) {
874
-
assertTrue(
875
-
e.message?.contains("400 Bad Request") ==true,
877
+
assertEquals(
878
+
e.message?.contains("400 Bad Request"),
879
+
true,
876
880
"Expected exception for empty text [400 Bad Request] was not found, got [${e.message}] instead"
877
881
)
878
-
assertTrue(
882
+
assertEquals(
879
883
e.message?.contains(
880
884
"Unable to submit request because it has an empty inlineData parameter. Add a value to the parameter and try again."
881
-
)==
882
-
true,
885
+
),
886
+
true,
883
887
"Expected exception for empty text [Unable to submit request because it has an empty inlineData parameter. Add a value to the parameter and try again] was not found, got [${e.message}] instead"
884
888
)
885
889
}
886
890
}
887
891
888
892
TextTestScenario.LONG_TEXT_5_MB-> {
889
893
if (model.provider ==LLMProvider.Anthropic) {
890
-
assertTrue(
891
-
e.message?.contains("400 Bad Request") ==true,
894
+
assertEquals(
895
+
e.message?.contains("400 Bad Request"),
896
+
true,
892
897
"Expected exception for long text [400 Bad Request] was not found, got [${e.message}] instead"
893
898
)
894
-
assertTrue(
895
-
e.message?.contains("prompt is too long") ==true,
899
+
assertEquals(
900
+
e.message?.contains("prompt is too long"),
901
+
true,
896
902
"Expected exception for long text [prompt is too long:] was not found, got [${e.message}] instead"
897
903
)
898
904
} elseif (model.provider ==LLMProvider.Google) {
@@ -925,7 +931,7 @@ class MultipleLLMPromptExecutorIntegrationTest {
925
931
926
932
user {
927
933
markdown {
928
-
"I'm sending you an audio file. Please tell me a couple of words about it."
934
+
+"I'm sending you an audio file. Please tell me a couple of words about it."
929
935
}
930
936
931
937
attachments {
@@ -940,18 +946,21 @@ class MultipleLLMPromptExecutorIntegrationTest {
940
946
checkExecutorMediaResponse(response)
941
947
} catch (e:Exception) {
942
948
if (scenario ==AudioTestScenario.CORRUPTED_AUDIO) {
943
-
assertTrue(
944
-
e.message?.contains("400 Bad Request") ==true,
949
+
assertEquals(
950
+
e.message?.contains("400 Bad Request"),
951
+
true,
945
952
"Expected exception for empty text [400 Bad Request] was not found, got [${e.message}] instead"
946
953
)
947
954
if (model.provider ==LLMProvider.OpenAI) {
948
-
assertTrue(
949
-
e.message?.contains("This model does not support the format you provided.") ==true,
955
+
assertEquals(
956
+
e.message?.contains("This model does not support the format you provided."),
957
+
true,
950
958
"Expected exception for corrupted audio [This model does not support the format you provided.]"
951
959
)
952
960
} elseif (model.provider ==LLMProvider.Google) {
953
-
assertTrue(
954
-
e.message?.contains("Request contains an invalid argument.") ==true,
961
+
assertEquals(
962
+
e.message?.contains("Request contains an invalid argument."),
963
+
true,
955
964
"Expected exception for corrupted audio [Request contains an invalid argument.]"
0 commit comments