Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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