do not log images

This commit is contained in:
LangChain4j 2024-10-09 10:34:04 +02:00
parent f23140b627
commit bdfe769e69
1 changed files with 15 additions and 7 deletions

View File

@ -63,6 +63,14 @@ class VertexAiGeminiChatModelIT {
.logResponses(true)
.build();
ChatLanguageModel imageModel = VertexAiGeminiChatModel.builder()
.project(System.getenv("GCP_PROJECT_ID"))
.location(System.getenv("GCP_LOCATION"))
.modelName(GEMINI_1_5_PRO)
.logRequests(false) // images are huge in logs
.logResponses(true)
.build();
@Test
void should_generate_response() {
@ -202,7 +210,7 @@ class VertexAiGeminiChatModelIT {
);
// when
Response<AiMessage> response = model.generate(userMessage);
Response<AiMessage> response = imageModel.generate(userMessage);
// then
assertThat(response.content().text()).containsIgnoringCase("cat");
@ -218,7 +226,7 @@ class VertexAiGeminiChatModelIT {
);
// when
Response<AiMessage> response = model.generate(userMessage);
Response<AiMessage> response = imageModel.generate(userMessage);
// then
assertThat(response.content().text()).containsIgnoringCase("cat");
@ -235,7 +243,7 @@ class VertexAiGeminiChatModelIT {
);
// when
Response<AiMessage> response = model.generate(userMessage);
Response<AiMessage> response = imageModel.generate(userMessage);
// then
assertThat(response.content().text()).containsIgnoringCase("cat");
@ -252,7 +260,7 @@ class VertexAiGeminiChatModelIT {
);
// when
Response<AiMessage> response = model.generate(userMessage);
Response<AiMessage> response = imageModel.generate(userMessage);
// then
assertThat(response.content().text())
@ -271,7 +279,7 @@ class VertexAiGeminiChatModelIT {
);
// when
Response<AiMessage> response = model.generate(userMessage);
Response<AiMessage> response = imageModel.generate(userMessage);
// then
assertThat(response.content().text())
@ -292,7 +300,7 @@ class VertexAiGeminiChatModelIT {
);
// when
Response<AiMessage> response = model.generate(userMessage);
Response<AiMessage> response = imageModel.generate(userMessage);
// then
assertThat(response.content().text())
@ -312,7 +320,7 @@ class VertexAiGeminiChatModelIT {
);
// when
Response<AiMessage> response = model.generate(userMessage);
Response<AiMessage> response = imageModel.generate(userMessage);
// then
assertThat(response.content().text())