From 73ea1afa94644837aa51697511769f8c04019f13 Mon Sep 17 00:00:00 2001 From: "uri.nudelman" Date: Tue, 13 Aug 2024 18:15:30 -0400 Subject: [PATCH] Added deserialization test Signed-off-by: uri.nudelman --- .../org/opensearch/client/opensearch/model/VariantsTest.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/java-client/src/test/java/org/opensearch/client/opensearch/model/VariantsTest.java b/java-client/src/test/java/org/opensearch/client/opensearch/model/VariantsTest.java index addb6af775..f647ae56f0 100644 --- a/java-client/src/test/java/org/opensearch/client/opensearch/model/VariantsTest.java +++ b/java-client/src/test/java/org/opensearch/client/opensearch/model/VariantsTest.java @@ -234,6 +234,7 @@ public void testNeuralQueryFromJson() { + " \"neural\": {\n" + " \"passage_embedding\": {\n" + " \"query_text\": \"Hi world!\",\n" + + " \"query_image\": \"iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAA1JREFUGFdj+L+U4T8ABu8CpCYJ1DQAAAAASUVORK5CYII=\",\n" + " \"model_id\": \"bQ1J8ooBpBj3wT4HVUsb\",\n" + " \"k\": 100\n" + " }\n" @@ -245,6 +246,10 @@ public void testNeuralQueryFromJson() { assertEquals("passage_embedding", searchRequest.query().neural().field()); assertEquals("Hi world!", searchRequest.query().neural().queryText()); + assertEquals( + "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAA1JREFUGFdj+L+U4T8ABu8CpCYJ1DQAAAAASUVORK5CYII=", + searchRequest.query().neural().queryImage() + ); assertEquals("bQ1J8ooBpBj3wT4HVUsb", searchRequest.query().neural().modelId()); assertEquals(100, searchRequest.query().neural().k()); }