Skip to content

Commit c93e720

Browse files
authored
fix: add deprecation warning to TextEmbeddingGenerator model, espeically gemini-1.0-X and gemini-1.5-X (#1534)
1 parent bdcb1e7 commit c93e720

12 files changed

+715
-1435
lines changed

bigframes/ml/llm.py

+8
Original file line numberDiff line numberDiff line change
@@ -918,15 +918,23 @@ def to_gbq(
918918
return new_model.session.read_gbq_model(model_name)
919919

920920

921+
@typing_extensions.deprecated(
922+
"gemini-pro and gemini-1.5-X are going to be deprecated. Use gemini-2.0-X (https://cloud.google.com/python/docs/reference/bigframes/latest/bigframes.ml.llm.GeminiTextGenerator) instead. ",
923+
category=exceptions.ApiDeprecationWarning,
924+
)
921925
@log_adapter.class_logger
922926
class GeminiTextGenerator(base.RetriableRemotePredictor):
923927
"""Gemini text generator LLM model.
924928
929+
.. note::
930+
gemini-pro and gemini-1.5-X are going to be deprecated. Use gemini-2.0-X (https://cloud.google.com/python/docs/reference/bigframes/latest/bigframes.ml.llm.GeminiTextGenerator) instead.
931+
925932
Args:
926933
model_name (str, Default to "gemini-pro"):
927934
The model for natural language tasks. Accepted values are "gemini-pro", "gemini-1.5-pro-preview-0514", "gemini-1.5-flash-preview-0514", "gemini-1.5-pro-001", "gemini-1.5-pro-002", "gemini-1.5-flash-001", "gemini-1.5-flash-002" and "gemini-2.0-flash-exp". Default to "gemini-pro".
928935
929936
.. note::
937+
"gemini-pro" is going to be deprecated. Bigframes 2 will transition to using gemini-2.0-X.
930938
"gemini-2.0-flash-exp", "gemini-1.5-pro-preview-0514" and "gemini-1.5-flash-preview-0514" is subject to the "Pre-GA Offerings Terms" in the General Service Terms section of the
931939
Service Specific Terms(https://cloud.google.com/terms/service-terms#1). Pre-GA products and features are available "as is"
932940
and might have limited support. For more information, see the launch stage descriptions

notebooks/apps/synthetic_data_generation.ipynb

+43-806
Large diffs are not rendered by default.

notebooks/generative_ai/bq_dataframes_llm_code_generation.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@
430430
"source": [
431431
"from bigframes.ml.llm import GeminiTextGenerator\n",
432432
"\n",
433-
"model = GeminiTextGenerator()"
433+
"model = GeminiTextGenerator(model_name=\"gemini-1.5-flash-002\")"
434434
]
435435
},
436436
{

notebooks/generative_ai/bq_dataframes_llm_kmeans.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1614,7 +1614,7 @@
16141614
"source": [
16151615
"from bigframes.ml.llm import GeminiTextGenerator\n",
16161616
"\n",
1617-
"q_a_model = GeminiTextGenerator()"
1617+
"q_a_model = GeminiTextGenerator(model_name=\"gemini-1.5-flash-002\")"
16181618
]
16191619
},
16201620
{

0 commit comments

Comments
 (0)