@@ -441,8 +441,8 @@ async def test_tool_returning_text_resource(allow_model_requests: None, agent: A
441
441
442
442
443
443
@pytest .mark .vcr ()
444
- async def test_tool_returning_text_resource_1 (allow_model_requests : None , agent : Agent ):
445
- async with agent . run_mcp_servers () :
444
+ async def test_tool_returning_text_resource_link (allow_model_requests : None , agent : Agent ):
445
+ async with agent :
446
446
result = await agent .run ('Get me the product name' )
447
447
assert result .output == snapshot ('The product name is "PydanticAI".' )
448
448
assert result .all_messages () == snapshot (
@@ -458,7 +458,7 @@ async def test_tool_returning_text_resource_1(allow_model_requests: None, agent:
458
458
ModelResponse (
459
459
parts = [
460
460
ToolCallPart (
461
- tool_name = 'get_product_name_1 ' ,
461
+ tool_name = 'get_product_name_link ' ,
462
462
args = '{}' ,
463
463
tool_call_id = 'call_LaiWltzI39sdquflqeuF0EyE' ,
464
464
)
@@ -483,7 +483,7 @@ async def test_tool_returning_text_resource_1(allow_model_requests: None, agent:
483
483
ModelRequest (
484
484
parts = [
485
485
ToolReturnPart (
486
- tool_name = 'get_product_name_1 ' ,
486
+ tool_name = 'get_product_name_link ' ,
487
487
content = 'PydanticAI' ,
488
488
tool_call_id = 'call_LaiWltzI39sdquflqeuF0EyE' ,
489
489
timestamp = IsDatetime (),
@@ -594,8 +594,10 @@ async def test_tool_returning_image_resource(allow_model_requests: None, agent:
594
594
595
595
596
596
@pytest .mark .vcr ()
597
- async def test_tool_returning_image_resource_1 (allow_model_requests : None , agent : Agent , image_content : BinaryContent ):
598
- async with agent .run_mcp_servers ():
597
+ async def test_tool_returning_image_resource_link (
598
+ allow_model_requests : None , agent : Agent , image_content : BinaryContent
599
+ ):
600
+ async with agent :
599
601
result = await agent .run ('Get me the image resource' )
600
602
assert result .output == snapshot (
601
603
'This is an image of a sliced kiwi with a vibrant green interior and black seeds.'
@@ -613,7 +615,7 @@ async def test_tool_returning_image_resource_1(allow_model_requests: None, agent
613
615
ModelResponse (
614
616
parts = [
615
617
ToolCallPart (
616
- tool_name = 'get_image_resource_1 ' ,
618
+ tool_name = 'get_image_resource_link ' ,
617
619
args = '{}' ,
618
620
tool_call_id = 'call_nFsDHYDZigO0rOHqmChZ3pmt' ,
619
621
)
@@ -638,7 +640,7 @@ async def test_tool_returning_image_resource_1(allow_model_requests: None, agent
638
640
ModelRequest (
639
641
parts = [
640
642
ToolReturnPart (
641
- tool_name = 'get_image_resource_1 ' ,
643
+ tool_name = 'get_image_resource_link ' ,
642
644
content = 'See file 1c8566' ,
643
645
tool_call_id = 'call_nFsDHYDZigO0rOHqmChZ3pmt' ,
644
646
timestamp = IsDatetime (),
@@ -728,11 +730,11 @@ async def test_tool_returning_audio_resource(
728
730
729
731
730
732
@pytest .mark .vcr ()
731
- async def test_tool_returning_audio_resource_1 (
733
+ async def test_tool_returning_audio_resource_link (
732
734
allow_model_requests : None , agent : Agent , audio_content : BinaryContent , gemini_api_key : str
733
735
):
734
736
model = GoogleModel ('gemini-2.5-pro-preview-03-25' , provider = GoogleProvider (api_key = gemini_api_key ))
735
- async with agent . run_mcp_servers () :
737
+ async with agent :
736
738
result = await agent .run ("What's the content of the audio resource?" , model = model )
737
739
assert result .output == snapshot ('The audio resource contains a voice saying "Hello, my name is Marcelo."' )
738
740
assert result .all_messages () == snapshot (
@@ -741,7 +743,7 @@ async def test_tool_returning_audio_resource_1(
741
743
parts = [UserPromptPart (content = "What's the content of the audio resource?" , timestamp = IsDatetime ())]
742
744
),
743
745
ModelResponse (
744
- parts = [ToolCallPart (tool_name = 'get_audio_resource_1 ' , args = {}, tool_call_id = IsStr ())],
746
+ parts = [ToolCallPart (tool_name = 'get_audio_resource_link ' , args = {}, tool_call_id = IsStr ())],
745
747
usage = Usage (
746
748
requests = 1 ,
747
749
request_tokens = 383 ,
@@ -756,7 +758,7 @@ async def test_tool_returning_audio_resource_1(
756
758
ModelRequest (
757
759
parts = [
758
760
ToolReturnPart (
759
- tool_name = 'get_audio_resource_1 ' ,
761
+ tool_name = 'get_audio_resource_link ' ,
760
762
content = 'See file 2d36ae' ,
761
763
tool_call_id = IsStr (),
762
764
timestamp = IsDatetime (),
0 commit comments