File tree Expand file tree Collapse file tree 1 file changed +2
-17
lines changed Expand file tree Collapse file tree 1 file changed +2
-17
lines changed Original file line number Diff line number Diff line change 16
16
def generate_from_text_input (project_id : str ) -> str :
17
17
# [START generativeaionvertexai_gemini_generate_from_text_input]
18
18
import vertexai
19
- from vertexai .generative_models import GenerativeModel , Part
19
+ from vertexai .generative_models import GenerativeModel
20
20
21
21
# TODO(developer): Update and un-comment below line
22
22
# project_id = "PROJECT_ID"
@@ -26,22 +26,7 @@ def generate_from_text_input(project_id: str) -> str:
26
26
model = GenerativeModel (model_name = "gemini-1.0-pro-002" )
27
27
28
28
response = model .generate_content (
29
- [
30
- # Does the returned sentiment score match the reviewer's movie rating?
31
- Part .from_text (
32
- """Give a score from 1 - 10 to suggest if the
33
- following movie review is negative or positive (1 is most
34
- negative, 10 is most positive, 5 will be neutral). Include an
35
- explanation.
36
-
37
- The movie takes some time to build, but that is part of its beauty.
38
- By the time you are hooked, this tale of friendship and hope is
39
- thrilling and affecting, until the very last scene. You will find
40
- yourself rooting for the hero every step of the way. This is the
41
- sharpest, most original animated film I have seen in years.
42
- I would give it 8 out of 10 stars."""
43
- )
44
- ]
29
+ "What's a good name for a flower shop that specializes in selling bouquets of dried flowers?"
45
30
)
46
31
47
32
print (response .text )
You can’t perform that action at this time.
0 commit comments