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 1616def generate_from_text_input (project_id : str ) -> str :
1717 # [START generativeaionvertexai_gemini_generate_from_text_input]
1818 import vertexai
19- from vertexai .generative_models import GenerativeModel , Part
19+ from vertexai .generative_models import GenerativeModel
2020
2121 # TODO(developer): Update and un-comment below line
2222 # project_id = "PROJECT_ID"
@@ -26,22 +26,7 @@ def generate_from_text_input(project_id: str) -> str:
2626 model = GenerativeModel (model_name = "gemini-1.0-pro-002" )
2727
2828 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?"
4530 )
4631
4732 print (response .text )
You can’t perform that action at this time.
0 commit comments