Adds integrationtestcase for chat message with image content

This commit is contained in:
Markus Klenke 2024-02-12 21:35:43 +00:00
parent ca613ed80a
commit 14d2474ee9

View File

@ -162,6 +162,22 @@ class TestRealAPIs {
}
}
@Test
@Order(3)
void testChatWithImage() {
testEndpointReachability();
try {
OllamaChatRequestBuilder builder = OllamaChatRequestBuilder.getInstance(config.getImageModel());
OllamaChatRequestModel requestModel = builder.withMessage(OllamaChatMessageRole.USER, "What's in the picture?",getImageFileFromClasspath("dog-on-a-boat.jpg"))
.build();
OllamaChatResult chatResult = ollamaAPI.chat(requestModel);
assertNotNull(chatResult);
} catch (IOException | OllamaBaseException | InterruptedException e) {
throw new RuntimeException(e);
}
}
@Test
@Order(3)
void testAskModelWithOptionsAndImageFiles() {