File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -90,14 +90,12 @@ class Recipe(TypedDict):
90
90
recipe_name : str
91
91
grade : Grade
92
92
93
-
94
93
model = genai .GenerativeModel ("gemini-1.5-pro-latest" )
95
94
96
95
result = model .generate_content (
97
96
"List about 10 cookie recipes, grade them based on popularity" ,
98
97
generation_config = genai .GenerationConfig (
99
- response_mime_type = "application/json" ,
100
- response_schema = list [Recipe ]
98
+ response_mime_type = "application/json" , response_schema = list [Recipe ]
101
99
),
102
100
)
103
101
print (result ) # [{"grade": "a+", "recipe_name": "Chocolate Chip Cookies"}, ...]
@@ -121,7 +119,6 @@ def test_json_enum_raw(self):
121
119
print (result ) # "Keyboard"
122
120
# [END json_enum_raw]
123
121
124
-
125
122
def test_x_enum (self ):
126
123
# [START x_enum]
127
124
import enum
@@ -163,5 +160,6 @@ def test_x_enum_raw(self):
163
160
print (result ) # "Keyboard"
164
161
# [END x_enum_raw]
165
162
163
+
166
164
if __name__ == "__main__" :
167
165
absltest .main ()
You can’t perform that action at this time.
0 commit comments