Skip to content

Commit 6238ca2

Browse files
authored
Merge branch 'main' into feat(embeddings/multimodal)_add_sample_multimodal_embedding_image
2 parents a0722d2 + 4dbc521 commit 6238ca2

16 files changed

Lines changed: 2061 additions & 401 deletions

‎alloydb/notebooks/alloydb_scann_benchmark_glove.ipynb‎

Lines changed: 2012 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Copyright 2026 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# https://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# [START aiplatform_genai_multimodal_embedding_video]
16+
from google import genai
17+
from google.genai import types
18+
19+
20+
def embed_content() -> types.EmbedContentResponse:
21+
client = genai.Client()
22+
23+
part = types.Part(
24+
file_data=types.FileData(
25+
file_uri="gs://cloud-samples-data/vertex-ai-vision/highway_vehicles.mp4",
26+
mime_type="video/mp4",
27+
),
28+
video_metadata=types.VideoMetadata(end_offset="1s"),
29+
)
30+
31+
content = types.Content(parts=[part])
32+
33+
response = client.models.embed_content(
34+
model="gemini-embedding-2",
35+
contents=[content],
36+
)
37+
print(response)
38+
# Example response:
39+
# embeddings=[ContentEmbedding(values=[-0.0123147098, 0.0727171078, ...])]
40+
return response
41+
42+
43+
# [END aiplatform_genai_multimodal_embedding_video]

‎genai/embeddings/test_embeddings_examples.py‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import embeddings_docretrieval_with_txt
2323
import model_tuning_example
2424
import multimodal_embedding_image
25+
import multimodal_embedding_video
2526

2627
os.environ["GOOGLE_GENAI_USE_ENTERPRISE"] = "True"
2728
os.environ["GOOGLE_CLOUD_LOCATION"] = "global"
@@ -47,3 +48,8 @@ def test_model_tuning_example() -> None:
4748
def test_multimodal_embedding_image() -> None:
4849
response = multimodal_embedding_image.embed_content()
4950
assert response
51+
52+
53+
def test_multimodal_embedding_video() -> None:
54+
response = multimodal_embedding_video.embed_content()
55+
assert response

‎generative_ai/evaluation/pairwise_summarization_quality.py‎

Lines changed: 0 additions & 106 deletions
This file was deleted.

‎generative_ai/evaluation/test_evaluation.py‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,8 @@
1313
# limitations under the License.
1414

1515
import get_rouge_score
16-
import pairwise_summarization_quality
1716

1817

1918
def test_create_evaluation_task() -> None:
2019
response = get_rouge_score.get_rouge_score()
2120
assert response
22-
23-
24-
def test_pairwise_evaluation_summarization_quality() -> None:
25-
response = pairwise_summarization_quality.evaluate_output()
26-
assert response

‎generative_ai/labels/labels_example.py‎

Lines changed: 0 additions & 53 deletions
This file was deleted.

‎generative_ai/labels/noxfile_config.py‎

Lines changed: 0 additions & 42 deletions
This file was deleted.

‎generative_ai/labels/requirements-test.txt‎

Lines changed: 0 additions & 2 deletions
This file was deleted.

‎generative_ai/labels/requirements.txt‎

Lines changed: 0 additions & 1 deletion
This file was deleted.

‎generative_ai/labels/test_labels_examples.py‎

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)