Skip to content

Commit

Permalink
fix: skip failing Gemini grounding test due to allowlist restrictions (
Browse files Browse the repository at this point in the history
…#11313)

* fix: skip failing test due to allowlist restrictions

* fix: linting

* fix: linting

* fix: use pytest.mark.skip syntax

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
kweinmeister and gcf-owl-bot[bot] authored Mar 19, 2024
1 parent ffdf393 commit 104a5dc
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions generative_ai/test_gemini_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

import os

import pytest
import vertexai

import gemini_chat_example
Expand All @@ -26,7 +27,6 @@
import gemini_safety_config_example
import gemini_single_turn_video_example


PROJECT_ID = os.getenv("GOOGLE_CLOUD_PROJECT")
LOCATION = "us-central1"

Expand Down Expand Up @@ -83,9 +83,10 @@ def test_gemini_count_token_example() -> None:


def test_gemini_safety_config_example() -> None:
import urllib
import typing
import http
import typing
import urllib

from vertexai.preview.generative_models import Image

def load_image_from_url(image_url: str) -> str:
Expand Down Expand Up @@ -132,9 +133,10 @@ def test_gemini_chat_example() -> None:
assert any([_ in text for _ in ("hi", "hello", "greeting")])


@pytest.mark.skip(
"Unable to test Google Search grounding due to allowlist restrictions."
)
def test_gemini_grounding_example() -> None:
# Test Vertex AI Search Grounding
# Unable to test Google Search grounding due to allowlist restrictions.
data_store_id = "test-search-engine_1689960780551"
data_store_path = f"projects/{PROJECT_ID}/locations/{LOCATION}/collections/default_collection/dataStores/{data_store_id}"
response = gemini_grounding_example.generate_text_with_grounding(
Expand Down

0 comments on commit 104a5dc

Please sign in to comment.