Skip to content

Commit

Permalink
cleaned up Ollama vision test
Browse files Browse the repository at this point in the history
  • Loading branch information
LangChain4j committed Jul 16, 2024
1 parent bf4d2cb commit 56f6e91
Showing 1 changed file with 1 addition and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@
import static dev.langchain4j.model.ollama.OllamaImage.BAKLLAVA_MODEL;
import static org.assertj.core.api.Assertions.assertThat;

class OllamaChatModeVisionModellITInfrastructure extends AbstractOllamaVisionModelInfrastructure {
class OllamaChatModelVisionIT extends AbstractOllamaVisionModelInfrastructure {

static final String CAT_IMAGE_URL = "https://upload.wikimedia.org/wikipedia/commons/e/e9/Felis_silvestris_silvestris_small_gradual_decrease_of_quality.png";
static final String DICE_IMAGE_URL = "https://upload.wikimedia.org/wikipedia/commons/4/47/PNG_transparency_demonstration_1.png";

@Test
void should_see_cat() {
Expand All @@ -39,26 +38,4 @@ void should_see_cat() {
assertThat(response.content().text())
.containsIgnoringCase("cat");
}

@Test
void should_see_dice() {

// given
ChatLanguageModel model = OllamaChatModel.builder()
.baseUrl(ollama.getEndpoint())
.timeout(Duration.ofMinutes(3))
.modelName(BAKLLAVA_MODEL)
.temperature(0.0)
.build();

// when
Response<AiMessage> response = model.generate(UserMessage.userMessage(
TextContent.from("What is on the picture?"),
ImageContent.from(DICE_IMAGE_URL)
));

// then
assertThat(response.content().text())
.containsIgnoringCase("dice");
}
}

0 comments on commit 56f6e91

Please sign in to comment.