@@ -30,23 +30,16 @@ public static void main(String[] args) throws IOException {
30
30
String projectId = "your-google-cloud-project-id" ;
31
31
String location = "us-central1" ;
32
32
String modelName = "gemini-1.0-pro-002" ;
33
- // Does the returned sentiment score match the reviewer's movie rating?
34
33
String textPrompt =
35
- "Give a score from 1 - 10 to suggest if the following movie review is"
36
- + " negative or positive (1 is most negative, 10 is most positive, 5 will be"
37
- + " neutral). Include an explanation.\n "
38
- + " The movie takes some time to build, but that is part of its beauty. By the"
39
- + " time you are hooked, this tale of friendship and hope is thrilling and"
40
- + " affecting, until the very last scene. You will find yourself rooting for"
41
- + " the hero every step of the way. This is the sharpest, most original"
42
- + " animated film I have seen in years. I would give it 8 out of 10 stars." ;
34
+ "What's a good name for a flower shop that specializes in selling bouquets of"
35
+ + " dried flowers?" ;
43
36
44
37
String output = textInput (projectId , location , modelName , textPrompt );
45
38
System .out .println (output );
46
39
}
47
40
48
41
// Passes the provided text input to the Gemini model and returns the text-only response.
49
- // For the specified textPrompt, the model returns a sentiment score for the given movie review .
42
+ // For the specified textPrompt, the model returns a list of possible store names .
50
43
public static String textInput (
51
44
String projectId , String location , String modelName , String textPrompt ) throws IOException {
52
45
// Initialize client that will be used to send requests. This client only needs
0 commit comments