Skip to content

Commit 2e3090b

Browse files
vertex-sdk-botcopybara-github
authored andcommitted
fix: LLM - Fixed the handling of the TextEmbeddingInput.task_type parameter.
PiperOrigin-RevId: 560854460
1 parent 4f66472 commit 2e3090b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

tests/unit/aiplatform/test_language_models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2359,12 +2359,12 @@ def test_text_embedding(self):
23592359
{"content": "What is life?"},
23602360
{
23612361
"content": "Foo",
2362-
"taskType": "RETRIEVAL_DOCUMENT",
2362+
"task_type": "RETRIEVAL_DOCUMENT",
23632363
"title": "Bar",
23642364
},
23652365
{
23662366
"content": "Baz",
2367-
"taskType": "CLASSIFICATION",
2367+
"task_type": "CLASSIFICATION",
23682368
},
23692369
]
23702370
prediction_parameters = mock_predict.call_args[1]["parameters"]

vertexai/language_models/_language_models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1084,7 +1084,7 @@ def get_embeddings(self,
10841084
if isinstance(text, TextEmbeddingInput):
10851085
instance = {"content": text.text}
10861086
if text.task_type:
1087-
instance["taskType"] = text.task_type
1087+
instance["task_type"] = text.task_type
10881088
if text.title:
10891089
instance["title"] = text.title
10901090
elif isinstance(text, str):

0 commit comments

Comments
 (0)