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