We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 81eaea5 commit d52c6c0Copy full SHA for d52c6c0
repro.py
@@ -0,0 +1,36 @@
1
+# /// script
2
+# requires-python = ">=3.9, <3.13"
3
+# dependencies = [
4
+# "google-cloud-aiplatform >= 1.64",
5
+# "numpy>=2",
6
+# "shapely>=2",
7
+# ]
8
+# ///
9
+
10
+import vertexai
11
+from vertexai.generative_models import (
12
+ Content,
13
+ GenerativeModel,
14
+ Part,
15
+)
16
17
18
+def main() -> None:
19
+ vertexai.init(api_transport="rest")
20
+ model = GenerativeModel("gemini-1.5-flash-002")
21
+ res = list(
22
+ model.generate_content(
23
+ [
24
+ Content(
25
+ role="invalid_role",
26
+ parts=[Part.from_text("Say this is a test")],
27
+ )
28
+ ],
29
+ stream=True,
30
31
32
+ print(res)
33
34
35
+if __name__ == "__main__":
36
+ main()
0 commit comments