@@ -294,7 +294,28 @@ def divide_floats(a: float, b: float) -> float:
294
294
config = {'tools' : [{'url_context' : {}}]},
295
295
),
296
296
),
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 (
298
319
# https://github.com/googleapis/python-genai/issues/830
299
320
# - models started returning empty thought in response to queries
300
321
# containing tools.
@@ -304,11 +325,13 @@ def divide_floats(a: float, b: float) -> float:
304
325
# them?
305
326
# - This is also important to configm forward compatibility.
306
327
# 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.
308
329
name = 'test_chat_tools_empty_thoughts' ,
309
330
parameters = types ._GenerateContentParameters (
310
331
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 [
312
335
{
313
336
'parts' : [{'text' : 'Who won the 1955 world cup?' }],
314
337
'role' : 'user' ,
@@ -333,7 +356,8 @@ def divide_floats(a: float, b: float) -> float:
333
356
}],
334
357
'role' : 'user' ,
335
358
},
336
- ]],
359
+ ]
360
+ ],
337
361
config = {
338
362
'tools' : [{'function_declarations' : function_declarations }],
339
363
},
@@ -1417,7 +1441,7 @@ def test_tools_chat_curation(client, caplog):
1417
1441
sdk_logger = logging .getLogger ('google_genai.models' )
1418
1442
sdk_logger .setLevel (logging .ERROR )
1419
1443
1420
- config = {
1444
+ config = {
1421
1445
'tools' : [{'function_declarations' : function_declarations }],
1422
1446
}
1423
1447
@@ -1427,11 +1451,11 @@ def test_tools_chat_curation(client, caplog):
1427
1451
)
1428
1452
1429
1453
response = chat .send_message (
1430
- message = 'Who won the 1955 world cup?' ,
1454
+ message = 'Who won the 1955 world cup?' ,
1431
1455
)
1432
1456
1433
1457
response = chat .send_message (
1434
- message = 'What was the population of canada in 1955?' ,
1458
+ message = 'What was the population of canada in 1955?' ,
1435
1459
)
1436
1460
1437
1461
history = chat .get_history (curated = True )
0 commit comments