@@ -776,7 +776,6 @@ async def test_image_url_input(allow_model_requests: None):
776
776
)
777
777
778
778
779
- @pytest .mark .vcr ()
780
779
async def test_openai_audio_url_input (allow_model_requests : None , openai_api_key : str ):
781
780
m = OpenAIModel ('gpt-4o-audio-preview' , provider = OpenAIProvider (api_key = openai_api_key ))
782
781
agent = Agent (m )
@@ -787,7 +786,6 @@ async def test_openai_audio_url_input(allow_model_requests: None, openai_api_key
787
786
)
788
787
789
788
790
- @pytest .mark .vcr ()
791
789
async def test_document_url_input (allow_model_requests : None , openai_api_key : str ):
792
790
m = OpenAIModel ('gpt-4o' , provider = OpenAIProvider (api_key = openai_api_key ))
793
791
agent = Agent (m )
@@ -879,7 +877,6 @@ async def get_image() -> ImageUrl:
879
877
)
880
878
881
879
882
- @pytest .mark .vcr ()
883
880
async def test_image_as_binary_content_tool_response (
884
881
allow_model_requests : None , image_content : BinaryContent , openai_api_key : str
885
882
):
@@ -960,7 +957,6 @@ async def get_image() -> BinaryContent:
960
957
)
961
958
962
959
963
- @pytest .mark .vcr ()
964
960
async def test_image_as_binary_content_input (
965
961
allow_model_requests : None , image_content : BinaryContent , openai_api_key : str
966
962
):
@@ -981,7 +977,6 @@ async def test_audio_as_binary_content_input(
981
977
assert result .output == snapshot ('The name mentioned in the audio is Marcelo.' )
982
978
983
979
984
- @pytest .mark .vcr ()
985
980
async def test_document_as_binary_content_input (
986
981
allow_model_requests : None , document_content : BinaryContent , openai_api_key : str
987
982
):
@@ -1045,15 +1040,13 @@ async def get_capital(country: str) -> str:
1045
1040
assert result .output == snapshot ('The capital of England is London.' )
1046
1041
1047
1042
1048
- @pytest .mark .vcr ()
1049
1043
async def test_extra_headers (allow_model_requests : None , openai_api_key : str ):
1050
1044
# This test doesn't do anything, it's just here to ensure that calls with `extra_headers` don't cause errors, including type.
1051
1045
m = OpenAIModel ('gpt-4o' , provider = OpenAIProvider (api_key = openai_api_key ))
1052
1046
agent = Agent (m , model_settings = OpenAIModelSettings (extra_headers = {'Extra-Header-Key' : 'Extra-Header-Value' }))
1053
1047
await agent .run ('hello' )
1054
1048
1055
1049
1056
- @pytest .mark .vcr ()
1057
1050
async def test_user_id (allow_model_requests : None , openai_api_key : str ):
1058
1051
# This test doesn't do anything, it's just here to ensure that calls with `user` don't cause errors, including type.
1059
1052
# Since we use VCR, creating tests with an `httpx.Transport` is not possible.
@@ -1924,7 +1917,6 @@ async def get_temperature(city: str) -> float:
1924
1917
)
1925
1918
1926
1919
1927
- @pytest .mark .vcr ()
1928
1920
async def test_openai_responses_model_thinking_part (allow_model_requests : None , openai_api_key : str ):
1929
1921
m = OpenAIResponsesModel ('o3-mini' , provider = OpenAIProvider (api_key = openai_api_key ))
1930
1922
settings = OpenAIResponsesModelSettings (openai_reasoning_effort = 'high' , openai_reasoning_summary = 'detailed' )
@@ -2009,7 +2001,6 @@ async def test_openai_responses_model_thinking_part(allow_model_requests: None,
2009
2001
)
2010
2002
2011
2003
2012
- @pytest .mark .vcr ()
2013
2004
async def test_openai_model_thinking_part (allow_model_requests : None , openai_api_key : str ):
2014
2005
provider = OpenAIProvider (api_key = openai_api_key )
2015
2006
responses_model = OpenAIResponsesModel ('o3-mini' , provider = provider )
@@ -2098,7 +2089,6 @@ async def test_openai_model_thinking_part(allow_model_requests: None, openai_api
2098
2089
)
2099
2090
2100
2091
2101
- @pytest .mark .vcr ()
2102
2092
async def test_openai_model_thinking_part_iter (allow_model_requests : None , openai_api_key : str ):
2103
2093
provider = OpenAIProvider (api_key = openai_api_key )
2104
2094
responses_model = OpenAIResponsesModel ('o3-mini' , provider = provider )
@@ -2127,7 +2117,6 @@ async def test_openai_model_thinking_part_iter(allow_model_requests: None, opena
2127
2117
)
2128
2118
2129
2119
2130
- @pytest .mark .vcr ()
2131
2120
async def test_openai_instructions_with_logprobs (allow_model_requests : None ):
2132
2121
# Create a mock response with logprobs
2133
2122
c = completion_message (
@@ -2164,7 +2153,6 @@ async def test_openai_instructions_with_logprobs(allow_model_requests: None):
2164
2153
]
2165
2154
2166
2155
2167
- @pytest .mark .vcr ()
2168
2156
async def test_openai_web_search_tool_model_not_supported (allow_model_requests : None , openai_api_key : str ):
2169
2157
m = OpenAIModel ('gpt-4o' , provider = OpenAIProvider (api_key = openai_api_key ))
2170
2158
agent = Agent (
@@ -2175,7 +2163,6 @@ async def test_openai_web_search_tool_model_not_supported(allow_model_requests:
2175
2163
await agent .run ('What day is today?' )
2176
2164
2177
2165
2178
- @pytest .mark .vcr ()
2179
2166
async def test_openai_web_search_tool (allow_model_requests : None , openai_api_key : str ):
2180
2167
m = OpenAIModel ('gpt-4o-search-preview' , provider = OpenAIProvider (api_key = openai_api_key ))
2181
2168
agent = Agent (
@@ -2186,7 +2173,6 @@ async def test_openai_web_search_tool(allow_model_requests: None, openai_api_key
2186
2173
assert result .output == snapshot ('May 14, 2025, 8:51:29 AM ' )
2187
2174
2188
2175
2189
- @pytest .mark .vcr ()
2190
2176
async def test_openai_web_search_tool_with_user_location (allow_model_requests : None , openai_api_key : str ):
2191
2177
m = OpenAIModel ('gpt-4o-search-preview' , provider = OpenAIProvider (api_key = openai_api_key ))
2192
2178
agent = Agent (
@@ -2214,7 +2200,6 @@ async def test_openai_web_search_tool_with_user_location(allow_model_requests: N
2214
2200
""" )
2215
2201
2216
2202
2217
- @pytest .mark .vcr ()
2218
2203
async def test_reasoning_model_with_temperature (allow_model_requests : None , openai_api_key : str ):
2219
2204
m = OpenAIModel ('o3-mini' , provider = OpenAIProvider (api_key = openai_api_key ))
2220
2205
agent = Agent (m , model_settings = OpenAIModelSettings (temperature = 0.5 ))
@@ -2319,7 +2304,6 @@ def test_model_profile_strict_not_supported():
2319
2304
)
2320
2305
2321
2306
2322
- @pytest .mark .vcr
2323
2307
async def test_compatible_api_with_tool_calls_without_id (allow_model_requests : None , gemini_api_key : str ):
2324
2308
provider = OpenAIProvider (
2325
2309
openai_client = AsyncOpenAI (
@@ -2358,7 +2342,6 @@ def test_openai_response_timestamp_milliseconds(allow_model_requests: None):
2358
2342
assert response .timestamp == snapshot (datetime (2025 , 6 , 1 , 3 , 7 , 48 , tzinfo = timezone .utc ))
2359
2343
2360
2344
2361
- @pytest .mark .vcr ()
2362
2345
async def test_openai_tool_output (allow_model_requests : None , openai_api_key : str ):
2363
2346
m = OpenAIModel ('gpt-4o' , provider = OpenAIProvider (api_key = openai_api_key ))
2364
2347
@@ -2453,7 +2436,6 @@ async def get_user_country() -> str:
2453
2436
)
2454
2437
2455
2438
2456
- @pytest .mark .vcr ()
2457
2439
async def test_openai_text_output_function (allow_model_requests : None , openai_api_key : str ):
2458
2440
m = OpenAIModel ('gpt-4o' , provider = OpenAIProvider (api_key = openai_api_key ))
2459
2441
@@ -2533,7 +2515,6 @@ async def get_user_country() -> str:
2533
2515
)
2534
2516
2535
2517
2536
- @pytest .mark .vcr ()
2537
2518
async def test_openai_native_output (allow_model_requests : None , openai_api_key : str ):
2538
2519
m = OpenAIModel ('gpt-4o' , provider = OpenAIProvider (api_key = openai_api_key ))
2539
2520
@@ -2616,7 +2597,6 @@ async def get_user_country() -> str:
2616
2597
)
2617
2598
2618
2599
2619
- @pytest .mark .vcr ()
2620
2600
async def test_openai_native_output_multiple (allow_model_requests : None , openai_api_key : str ):
2621
2601
m = OpenAIModel ('gpt-4o' , provider = OpenAIProvider (api_key = openai_api_key ))
2622
2602
@@ -2705,7 +2685,6 @@ async def get_user_country() -> str:
2705
2685
)
2706
2686
2707
2687
2708
- @pytest .mark .vcr ()
2709
2688
async def test_openai_prompted_output (allow_model_requests : None , openai_api_key : str ):
2710
2689
m = OpenAIModel ('gpt-4o' , provider = OpenAIProvider (api_key = openai_api_key ))
2711
2690
@@ -2800,7 +2779,6 @@ async def get_user_country() -> str:
2800
2779
)
2801
2780
2802
2781
2803
- @pytest .mark .vcr ()
2804
2782
async def test_openai_prompted_output_multiple (allow_model_requests : None , openai_api_key : str ):
2805
2783
m = OpenAIModel ('gpt-4o' , provider = OpenAIProvider (api_key = openai_api_key ))
2806
2784
@@ -2959,7 +2937,6 @@ async def test_process_response_no_created_timestamp(allow_model_requests: None)
2959
2937
assert response_message .timestamp == IsNow (tz = timezone .utc )
2960
2938
2961
2939
2962
- @pytest .mark .anyio ()
2963
2940
async def test_tool_choice_fallback (allow_model_requests : None ) -> None :
2964
2941
profile = OpenAIModelProfile (openai_supports_tool_choice_required = False ).update (openai_model_profile ('stub' ))
2965
2942
@@ -2976,3 +2953,11 @@ async def test_tool_choice_fallback(allow_model_requests: None) -> None:
2976
2953
)
2977
2954
2978
2955
assert get_mock_chat_completion_kwargs (mock_client )[0 ]['tool_choice' ] == 'auto'
2956
+
2957
+
2958
+ async def test_openai_model_settings_temperature_ignored_on_gpt_5 (allow_model_requests : None , openai_api_key : str ):
2959
+ m = OpenAIModel ('gpt-5' , provider = OpenAIProvider (api_key = openai_api_key ))
2960
+ agent = Agent (m )
2961
+
2962
+ result = await agent .run ('What is the capital of France?' , model_settings = ModelSettings (temperature = 0.0 ))
2963
+ assert result .output == snapshot ('Paris.' )
0 commit comments