-
Notifications
You must be signed in to change notification settings - Fork 603
Open
Labels
priority: p3Desirable enhancement or fix. May not be included in next release.Desirable enhancement or fix. May not be included in next release.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.‘Nice-to-have’ improvement, new feature or different behavior or design.
Description
Environment details
- Programming language: Python
- OS: macOS
- Language runtime version: 3.13.7
- Package version: google-genai 1.40.0
Steps to reproduce
- Use
UrlContext
tool to fetch a page that requires JavaScript - Receive a
UrlRetrievalStatus.URL_RETRIEVAL_STATUS_SUCCESS
in theUrlMetadata
Sample Code
from google import genai
from google.genai.types import (
Tool,
GenerateContentConfig,
UrlContext,
GoogleSearch,
)
from dotenv import load_dotenv, find_dotenv
load_dotenv(find_dotenv())
client = genai.Client()
model_id = "gemini-2.5-flash-preview-09-2025"
tools = []
tools.append(Tool(url_context=UrlContext()))
tools.append(Tool(google_search=GoogleSearch()))
response = client.models.generate_content(
model=model_id,
contents="https://msrc.microsoft.com/update-guide/vulnerability/CVE-2025-59489\nBased on this article, what is the CVSS v3.1 base score? If you cannot access the article, respond with 'No Access'.",
config=GenerateContentConfig(
tools=tools,
response_modalities=["TEXT"],
),
)
for each in response.candidates[0].content.parts:
print(each.text)
# get URLs retrieved for context
print(response.candidates[0].url_context_metadata)
# Response:
# I cannot access the content of the specific article linked.
#
# No Access
# None
Suggestion
It would be good if the status was not success, maybe another status such as Blocked or JavaScript Required would be nice.
Metadata
Metadata
Assignees
Labels
priority: p3Desirable enhancement or fix. May not be included in next release.Desirable enhancement or fix. May not be included in next release.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.‘Nice-to-have’ improvement, new feature or different behavior or design.