From 19adb6f4cf796bc309fe16201a24e6efc3bc0c6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A2=D0=B5=D1=82=D1=8F=D0=BD=D0=B0=20=D0=AF=D0=B3=D0=BE?= =?UTF-8?q?=D0=B4=D1=81=D1=8C=D0=BA=D0=B0?= <49729677+TetyanaYahodska@users.noreply.github.com> Date: Thu, 1 Aug 2024 17:03:08 +0200 Subject: [PATCH] fixed prompt and test (#9430) --- .../src/main/java/vertexai/gemini/StreamingQuestionAnswer.java | 2 +- vertexai/snippets/src/test/java/vertexai/gemini/SnippetsIT.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/vertexai/snippets/src/main/java/vertexai/gemini/StreamingQuestionAnswer.java b/vertexai/snippets/src/main/java/vertexai/gemini/StreamingQuestionAnswer.java index c5d69ea92d7..dd6347fd520 100644 --- a/vertexai/snippets/src/main/java/vertexai/gemini/StreamingQuestionAnswer.java +++ b/vertexai/snippets/src/main/java/vertexai/gemini/StreamingQuestionAnswer.java @@ -40,7 +40,7 @@ public static void streamingQuestion(String projectId, String location, String m GenerativeModel model = new GenerativeModel(modelName, vertexAI); // Stream the result. - model.generateContentStream("Why is the sky blue?") + model.generateContentStream("Write a story about a magic backpack.") .stream() .forEach(System.out::println); diff --git a/vertexai/snippets/src/test/java/vertexai/gemini/SnippetsIT.java b/vertexai/snippets/src/test/java/vertexai/gemini/SnippetsIT.java index 6a3abc39e44..5023db0d0e5 100644 --- a/vertexai/snippets/src/test/java/vertexai/gemini/SnippetsIT.java +++ b/vertexai/snippets/src/test/java/vertexai/gemini/SnippetsIT.java @@ -190,7 +190,7 @@ public void testSingleTurnMultimodal() throws IOException { @Test public void testStreamingQuestions() throws Exception { StreamingQuestionAnswer.streamingQuestion(PROJECT_ID, LOCATION, GEMINI_FLASH); - assertThat(bout.toString()).contains("Rayleigh scattering"); + assertThat(bout.toString()).isNotEmpty(); } @Test