Skip to content

Commit c3126aa

Browse files
committed
feat(genai): update the gemini model name
1 parent 46a0c73 commit c3126aa

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+46
-46
lines changed

discoveryengine/answer_query_sample.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# limitations under the License.
1414
#
1515

16-
# NOTE: This snippet has been partially generated by `gemini-1.5-pro-001`
16+
# NOTE: This snippet has been partially generated by `gemini-2.0-flash-001`
1717

1818
# [START genappbuilder_answer_query]
1919
from google.api_core.client_options import ClientOptions
@@ -71,7 +71,7 @@ def answer_query_sample(
7171
ignore_non_answer_seeking_query=False, # Optional: Ignore non-answer seeking query
7272
ignore_low_relevant_content=False, # Optional: Return fallback answer when content is not relevant
7373
model_spec=discoveryengine.AnswerQueryRequest.AnswerGenerationSpec.ModelSpec(
74-
model_version="gemini-1.5-flash-001/answer_gen/v2", # Optional: Model to use for answer generation
74+
model_version="gemini-2.0-flash-001/answer_gen/v2", # Optional: Model to use for answer generation
7575
),
7676
prompt_spec=discoveryengine.AnswerQueryRequest.AnswerGenerationSpec.PromptSpec(
7777
preamble="Give a detailed answer.", # Optional: Natural language instructions for customizing the answer.

discoveryengine/session_sample.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# limitations under the License.
1515
#
1616

17-
# NOTE: This snippet has been partially generated by `gemini-1.5-pro-001`
17+
# NOTE: This snippet has been partially generated by `gemini-2.0-flash-001`
1818

1919
# [START genappbuilder_create_session]
2020
from google.cloud import discoveryengine_v1 as discoveryengine

generative_ai/batch_predict/gemini_batch_predict_bigquery.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def batch_predict_gemini_createjob(output_uri: str) -> str:
3737

3838
# Submit a batch prediction job with Gemini model
3939
batch_prediction_job = BatchPredictionJob.submit(
40-
source_model="gemini-1.5-flash-002",
40+
source_model="gemini-2.0-flash-001",
4141
input_dataset=input_uri,
4242
output_uri_prefix=output_uri,
4343
)

generative_ai/batch_predict/gemini_batch_predict_gcs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def batch_predict_gemini_createjob(output_uri: str) -> str:
3838

3939
# Submit a batch prediction job with Gemini model
4040
batch_prediction_job = BatchPredictionJob.submit(
41-
source_model="gemini-1.5-flash-002",
41+
source_model="gemini-2.0-flash-001",
4242
input_dataset=input_uri,
4343
output_uri_prefix=output_uri,
4444
)

generative_ai/evaluation/pairwise_summarization_quality.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,11 @@ def evaluate_output() -> EvalResult:
5252
eval_dataset = pd.DataFrame({"prompt": [prompt]})
5353

5454
# Baseline model for pairwise comparison
55-
baseline_model = GenerativeModel("gemini-1.5-pro-001")
55+
baseline_model = GenerativeModel("gemini-2.0-flash-001")
5656

5757
# Candidate model for pairwise comparison
5858
candidate_model = GenerativeModel(
59-
"gemini-1.5-pro-002", generation_config={"temperature": 0.4}
59+
"gemini-2.0-flash-001", generation_config={"temperature": 0.4}
6060
)
6161

6262
prompt_template = MetricPromptTemplateExamples.get_prompt_template(

generative_ai/express_mode/api_key_example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def generate_content() -> None:
2121
# TODO(developer): Update below line
2222
vertexai.init(api_key="YOUR_API_KEY")
2323

24-
model = GenerativeModel("gemini-1.5-flash")
24+
model = GenerativeModel("gemini-2.0-flash-001")
2525

2626
response = model.generate_content("Explain bubble sort to me")
2727

generative_ai/image/image_example01.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def generate_text() -> str:
2626
# PROJECT_ID = "your-project-id"
2727
vertexai.init(project=PROJECT_ID, location="us-central1")
2828

29-
model = GenerativeModel("gemini-1.5-flash-002")
29+
model = GenerativeModel("gemini-2.0-flash-001")
3030

3131
response = model.generate_content(
3232
[

generative_ai/image/image_example02.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def generate_text() -> None:
2626
# PROJECT_ID = "your-project-id"
2727
vertexai.init(project=PROJECT_ID, location="us-central1")
2828

29-
model = GenerativeModel("gemini-1.5-flash-002")
29+
model = GenerativeModel("gemini-2.0-flash-001")
3030

3131
image_file = Part.from_uri(
3232
"gs://cloud-samples-data/generative-ai/image/scones.jpg", "image/jpeg"

generative_ai/labels/labels_example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def generate_content() -> GenerationResponse:
2828
# PROJECT_ID = "your-project-id"
2929
vertexai.init(project=PROJECT_ID, location="us-central1")
3030

31-
model = GenerativeModel("gemini-1.5-flash-001")
31+
model = GenerativeModel("gemini-2.0-flash-001")
3232

3333
prompt = "What is Generative AI?"
3434
response = model.generate_content(

generative_ai/prompts/prompt_create.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def prompt_create() -> Prompt:
3939
{"movie1": "The Lion King", "movie2": "Frozen"},
4040
{"movie1": "Inception", "movie2": "Interstellar"},
4141
],
42-
model_name="gemini-1.5-pro-002",
42+
model_name="gemini-2.0-flash-001",
4343
system_instruction="You are a movie critic. Answer in a short sentence.",
4444
# generation_config=GenerationConfig, # Optional,
4545
# safety_settings=SafetySetting, # Optional,

0 commit comments

Comments
 (0)