@@ -294,7 +294,28 @@ def divide_floats(a: float, b: float) -> float:
294294 config = {'tools' : [{'url_context' : {}}]},
295295 ),
296296 ),
297- pytest_helper .TestTableItem (
297+ pytest_helper .TestTableItem (
298+ name = 'test_url_context_paywall_status' ,
299+ parameters = types ._GenerateContentParameters (
300+ model = 'gemini-2.5-flash' ,
301+ contents = t .t_contents (
302+ 'Read the content of this URL:'
303+ ' https://unsplash.com/photos/portrait-of-an-adorable-golden-retriever-puppy-studio-shot-isolated-on-black-yRYCnnQASnc'
304+ ),
305+ config = {'tools' : [{'url_context' : {}}]},
306+ ),
307+ ),
308+ pytest_helper .TestTableItem (
309+ name = 'test_url_context_unsafe_status' ,
310+ parameters = types ._GenerateContentParameters (
311+ model = 'gemini-2.5-flash' ,
312+ contents = t .t_contents (
313+ 'Fetch the content of http://0k9.me/test.html'
314+ ),
315+ config = {'tools' : [{'url_context' : {}}]},
316+ ),
317+ ),
318+ pytest_helper .TestTableItem (
298319 # https://github.com/googleapis/python-genai/issues/830
299320 # - models started returning empty thought in response to queries
300321 # containing tools.
@@ -304,11 +325,13 @@ def divide_floats(a: float, b: float) -> float:
304325 # them?
305326 # - This is also important to configm forward compatibility.
306327 # when the models start returning thought_signature, those will get
307- # dropped by the SDK leaving a `{'thought: True}` part.
328+ # dropped by the SDK leaving a `{'thought: True}` part.
308329 name = 'test_chat_tools_empty_thoughts' ,
309330 parameters = types ._GenerateContentParameters (
310331 model = 'gemini-2.5-flash-preview-05-20' ,
311- contents = [types .Content .model_validate (item ) for item in [
332+ contents = [
333+ types .Content .model_validate (item )
334+ for item in [
312335 {
313336 'parts' : [{'text' : 'Who won the 1955 world cup?' }],
314337 'role' : 'user' ,
@@ -333,7 +356,8 @@ def divide_floats(a: float, b: float) -> float:
333356 }],
334357 'role' : 'user' ,
335358 },
336- ]],
359+ ]
360+ ],
337361 config = {
338362 'tools' : [{'function_declarations' : function_declarations }],
339363 },
@@ -1417,7 +1441,7 @@ def test_tools_chat_curation(client, caplog):
14171441 sdk_logger = logging .getLogger ('google_genai.models' )
14181442 sdk_logger .setLevel (logging .ERROR )
14191443
1420- config = {
1444+ config = {
14211445 'tools' : [{'function_declarations' : function_declarations }],
14221446 }
14231447
@@ -1427,11 +1451,11 @@ def test_tools_chat_curation(client, caplog):
14271451 )
14281452
14291453 response = chat .send_message (
1430- message = 'Who won the 1955 world cup?' ,
1454+ message = 'Who won the 1955 world cup?' ,
14311455 )
14321456
14331457 response = chat .send_message (
1434- message = 'What was the population of canada in 1955?' ,
1458+ message = 'What was the population of canada in 1955?' ,
14351459 )
14361460
14371461 history = chat .get_history (curated = True )
0 commit comments