Skip to content

Commit bf826f5

Browse files
authored
chore(generative-ai): Update Chat Completions Samples to Gemini 2.0 Flash GA (GoogleCloudPlatform#13153)
Update Vertex SDK Chat Completions samples to use latest Gemini Model
1 parent 76cda15 commit bf826f5

6 files changed

+5
-17
lines changed

generative_ai/chat_completions/chat_completions_credentials_refresher.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def generate_text(project_id: str, location: str = "us-central1") -> object:
5555
)
5656

5757
response = client.chat.completions.create(
58-
model="google/gemini-1.5-flash-002",
58+
model="google/gemini-2.0-flash-001",
5959
messages=[{"role": "user", "content": "Why is the sky blue?"}],
6060
)
6161

generative_ai/chat_completions/chat_completions_non_streaming_image.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def generate_text(project_id: str, location: str = "us-central1") -> object:
3636
)
3737

3838
response = client.chat.completions.create(
39-
model="google/gemini-1.5-flash-002",
39+
model="google/gemini-2.0-flash-001",
4040
messages=[
4141
{
4242
"role": "user",

generative_ai/chat_completions/chat_completions_non_streaming_text.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def generate_text(project_id: str, location: str = "us-central1") -> object:
3535
)
3636

3737
response = client.chat.completions.create(
38-
model="google/gemini-1.5-flash-002",
38+
model="google/gemini-2.0-flash-001",
3939
messages=[{"role": "user", "content": "Why is the sky blue?"}],
4040
)
4141

generative_ai/chat_completions/chat_completions_streaming_image.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def generate_text(project_id: str, location: str = "us-central1") -> object:
3535
)
3636

3737
response = client.chat.completions.create(
38-
model="google/gemini-1.5-flash-002",
38+
model="google/gemini-2.0-flash-001",
3939
messages=[
4040
{
4141
"role": "user",

generative_ai/chat_completions/chat_completions_streaming_text.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def generate_text(project_id: str, location: str = "us-central1") -> object:
3535
)
3636

3737
response = client.chat.completions.create(
38-
model="google/gemini-1.5-flash-002",
38+
model="google/gemini-2.0-flash-001",
3939
messages=[{"role": "user", "content": "Why is the sky blue?"}],
4040
stream=True,
4141
)
Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,2 @@
1-
pandas==1.3.5; python_version == '3.7'
2-
pandas==2.0.3; python_version == '3.8'
3-
pandas==2.1.4; python_version > '3.8'
4-
pillow==10.3.0; python_version < '3.8'
5-
pillow==10.3.0; python_version >= '3.8'
6-
google-cloud-aiplatform[all]==1.78.0
7-
sentencepiece==0.2.0
81
google-auth==2.38.0
9-
anthropic[vertex]==0.28.0
10-
langchain-core==0.2.33
11-
langchain-google-vertexai==1.0.10
12-
numpy<2
132
openai==1.60.0
14-
immutabledict==4.2.0

0 commit comments

Comments
 (0)