Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat: add deprecation warning to GeminiTextGenerator model #1534

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Mar 25, 2025
8 changes: 8 additions & 0 deletions bigframes/ml/llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -918,15 +918,23 @@ def to_gbq(
return new_model.session.read_gbq_model(model_name)


@typing_extensions.deprecated(
"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. ",
category=exceptions.ApiDeprecationWarning,
)
@log_adapter.class_logger
class GeminiTextGenerator(base.RetriableRemotePredictor):
"""Gemini text generator LLM model.

.. note::
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.

Args:
model_name (str, Default to "gemini-pro"):
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".

.. note::
"gemini-pro" is going to be deprecated. Bigframes 2 will transition to using gemini-2.0-X.
"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
Service Specific Terms(https://cloud.google.com/terms/service-terms#1). Pre-GA products and features are available "as is"
and might have limited support. For more information, see the launch stage descriptions
Expand Down
849 changes: 43 additions & 806 deletions notebooks/apps/synthetic_data_generation.ipynb

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@
"source": [
"from bigframes.ml.llm import GeminiTextGenerator\n",
"\n",
"model = GeminiTextGenerator()"
"model = GeminiTextGenerator(model_name=\"gemini-1.5-flash-002\")"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion notebooks/generative_ai/bq_dataframes_llm_kmeans.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1614,7 +1614,7 @@
"source": [
"from bigframes.ml.llm import GeminiTextGenerator\n",
"\n",
"q_a_model = GeminiTextGenerator()"
"q_a_model = GeminiTextGenerator(model_name=\"gemini-1.5-flash-002\")"
]
},
{
Expand Down
Loading