Skip to content

Commit e63fdcb

Browse files
markpollackleijendary
authored andcommitted
Fix VertexAiMultimodalEmbeddingModelIT test by separating documents
The Document class requires exactly one of text or media to be specified. Updated textImageAndVideoEmbedding test to create separate Document instances for text, image, and video content instead of combining them in a single document. Signed-off-by: leijendary <[email protected]>
1 parent 8fda238 commit e63fdcb

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

models/spring-ai-vertex-ai-embedding/src/test/java/org/springframework/ai/vertexai/embedding/multimodal/VertexAiMultimodalEmbeddingModelIT.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,7 @@ void videoEmbedding() {
189189
@Test
190190
void textImageAndVideoEmbedding() {
191191

192-
var textDocument = Document.builder()
193-
.text("Hello World")
194-
.build();
192+
var textDocument = Document.builder().text("Hello World").build();
195193

196194
var imageDocument = Document.builder()
197195
.media(new Media(MimeTypeUtils.IMAGE_PNG, new ClassPathResource("/test.image.png")))
@@ -201,7 +199,8 @@ void textImageAndVideoEmbedding() {
201199
.media(new Media(new MimeType("video", "mp4"), new ClassPathResource("/test.video.mp4")))
202200
.build();
203201

204-
DocumentEmbeddingRequest embeddingRequest = new DocumentEmbeddingRequest(List.of(textDocument, imageDocument, videoDocument));
202+
DocumentEmbeddingRequest embeddingRequest = new DocumentEmbeddingRequest(
203+
List.of(textDocument, imageDocument, videoDocument));
205204

206205
EmbeddingResponse embeddingResponse = this.multiModelEmbeddingModel.call(embeddingRequest);
207206
assertThat(embeddingResponse.getResults()).hasSize(3);

0 commit comments

Comments
 (0)