Skip to content

Commit 5abf4ac

Browse files
committed
add deprecation warning to TextEmbeddingGenerator model, espeically gemini-1.0-X and gemini-1.5-X
1 parent 578081e commit 5abf4ac

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

bigframes/ml/llm.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ def to_gbq(self, model_name: str, replace: bool = False) -> PaLM2TextGenerator:
452452

453453

454454
@typing_extensions.deprecated(
455-
"PaLM2TextEmbeddingGenerator has been deprecated. Use TextEmbeddingGenerator(https://cloud.google.com/python/docs/reference/bigframes/latest/bigframes.ml.llm.TextEmbeddingGenerator) instead. ",
455+
"PaLM2TextEmbeddingGenerator has been deprecated, textembedding-gecko are going to be deprecated. Use TextEmbeddingGenerator(https://cloud.google.com/python/docs/reference/bigframes/latest/bigframes.ml.llm.TextEmbeddingGenerator) instead. ",
456456
category=exceptions.ApiDeprecationWarning,
457457
)
458458
@log_adapter.class_logger
@@ -918,10 +918,17 @@ def to_gbq(
918918
return new_model.session.read_gbq_model(model_name)
919919

920920

921+
@typing_extensions.deprecated(
922+
"gemini-1.0-X 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-1.0-X and gemini-1.5-X are going to be deprecated. Use GeminiTextGenerator(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".

tests/system/small/ml/test_llm.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1022,6 +1022,21 @@ def test_palm2_text_embedding_deprecated():
10221022
pass
10231023

10241024

1025+
@pytest.mark.parametrize(
1026+
"model_name",
1027+
(
1028+
"gemini-1.5-pro-001",
1029+
"gemini-1.5-pro-002",
1030+
"gemini-1.5-flash-001",
1031+
"gemini-1.5-flash-002",
1032+
"gemini-1.0-pro",
1033+
),
1034+
)
1035+
def test_gemini_text_generator_deprecated(model_name):
1036+
with pytest.warns(exceptions.ApiDeprecationWarning):
1037+
llm.GeminiTextGenerator(model_name=model_name)
1038+
1039+
10251040
@pytest.mark.parametrize(
10261041
"model_name",
10271042
(

0 commit comments

Comments
 (0)