66from openai .types .chat import ChatCompletion
77
88from ._chat import Chat
9- from ._provider_openai import OpenAIProvider , is_reasoning_model
9+ from ._provider_openai import OpenAIProvider
1010from ._provider_openai_completions import OpenAICompletionsProvider
1111from ._utils import MISSING , MISSING_TYPE , is_testing , split_http_client_kwargs
1212
@@ -75,11 +75,10 @@ def ChatAzureOpenAI(
7575 system_prompt
7676 A system prompt to set the behavior of the assistant.
7777 reasoning
78- The reasoning effort to use. Set this for reasoning-capable models
79- (like the o-series). Since Azure uses custom deployment names rather
80- than model names, chatlas cannot automatically detect reasoning models.
81- Pass a reasoning effort string (e.g., "low", "medium", "high") or a
82- Reasoning dict to enable reasoning features.
78+ The reasoning effort (e.g., `"low"`, `"medium"`, `"high"`) for
79+ reasoning-capable models like the o and gpt-5 series. To use the default
80+ reasoning settings in a way that will work for multi-turn conversations,
81+ set this to an empty dictionary `{}`.
8382 service_tier
8483 Request a specific service tier. Options:
8584 - `"auto"` (default): uses the service tier configured in Project settings.
@@ -98,12 +97,6 @@ def ChatAzureOpenAI(
9897
9998 kwargs_chat : "ResponsesSubmitInputArgs" = {}
10099
101- # Detect reasoning models by checking if:
102- # 1. The user explicitly passed reasoning parameter, OR
103- # 2. The deployment_id matches a known reasoning model pattern (o*, gpt-5*)
104- # This allows automatic detection when deployment names match model names,
105- # while also supporting custom deployment names via the reasoning parameter.
106- detected_reasoning = reasoning is not None or is_reasoning_model (deployment_id )
107100 if reasoning is not None :
108101 if isinstance (reasoning , str ):
109102 reasoning = {"effort" : reasoning , "summary" : "auto" }
@@ -112,17 +105,14 @@ def ChatAzureOpenAI(
112105 if service_tier is not None :
113106 kwargs_chat ["service_tier" ] = service_tier
114107
115- provider = OpenAIAzureProvider (
116- endpoint = endpoint ,
117- deployment_id = deployment_id ,
118- api_version = api_version ,
119- api_key = api_key ,
120- kwargs = kwargs ,
121- )
122- provider ._is_reasoning_model = detected_reasoning
123-
124108 return Chat (
125- provider = provider ,
109+ provider = OpenAIAzureProvider (
110+ endpoint = endpoint ,
111+ deployment_id = deployment_id ,
112+ api_version = api_version ,
113+ api_key = api_key ,
114+ kwargs = kwargs ,
115+ ),
126116 system_prompt = system_prompt ,
127117 kwargs_chat = kwargs_chat ,
128118 )
0 commit comments