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 5b7b3a1Copy full SHA for 5b7b3a1
repro.py
@@ -0,0 +1,34 @@
1
+# /// script
2
+# requires-python = ">=3.11"
3
+# dependencies = [
4
+# "google-cloud-aiplatform",
5
+# ]
6
+# ///
7
+
8
+import vertexai
9
+from vertexai.generative_models import (
10
+ Content,
11
+ GenerativeModel,
12
+ Part,
13
+)
14
15
16
+def main() -> None:
17
+ # vertexai.init(api_transport="rest")
18
+ model = GenerativeModel("gemini-1.5-flash-002")
19
+ res = list(
20
+ model.generate_content(
21
+ [
22
+ Content(
23
+ role="invalid_role",
24
+ parts=[Part.from_text("Say this is a test")],
25
+ )
26
+ ],
27
+ stream=True,
28
29
30
+ print(res)
31
32
33
+if __name__ == "__main__":
34
+ main()
0 commit comments