@@ -70,8 +70,8 @@ export class OpenAiHandler extends BaseProvider implements SingleCompletionHandl
7070 // Azure API shape slightly differs from the core API shape:
7171 // https://github.com/openai/openai-node?tab=readme-ov-file#microsoft-azure-openai
7272
73- // Determine if we're using the Responses API flavor for Azure
74- const flavor = this . _resolveApiFlavor ( this . options . openAiApiFlavor , this . options . openAiBaseUrl ?? "" )
73+ // Determine if we're using the Responses API flavor for Azure (auto-detect by URL only)
74+ const flavor = this . _resolveApiFlavor ( this . options . openAiBaseUrl ?? "" )
7575 const isResponsesFlavor =
7676 flavor === "responses" ||
7777 this . _isAzureOpenAiResponses ( this . options . openAiBaseUrl ) ||
@@ -127,8 +127,8 @@ export class OpenAiHandler extends BaseProvider implements SingleCompletionHandl
127127 const deepseekReasoner = modelId . includes ( "deepseek-reasoner" ) || enabledR1Format
128128 const ark = modelUrl . includes ( ".volces.com" )
129129
130- // Decide API flavor (manual override > auto-detect by URL)
131- const flavor = this . _resolveApiFlavor ( this . options . openAiApiFlavor , modelUrl )
130+ // Decide API flavor (auto-detect by URL)
131+ const flavor = this . _resolveApiFlavor ( modelUrl )
132132
133133 // If Responses API is selected, use the Responses payload and endpoint
134134 if ( flavor === "responses" ) {
@@ -373,7 +373,7 @@ export class OpenAiHandler extends BaseProvider implements SingleCompletionHandl
373373 async completePrompt ( prompt : string ) : Promise < string > {
374374 try {
375375 const isAzureAiInference = this . _isAzureAiInference ( this . options . openAiBaseUrl )
376- const flavor = this . _resolveApiFlavor ( this . options . openAiApiFlavor , this . options . openAiBaseUrl ?? "" )
376+ const flavor = this . _resolveApiFlavor ( this . options . openAiBaseUrl ?? "" )
377377 const model = this . getModel ( )
378378 const modelInfo = model . info
379379
@@ -644,12 +644,7 @@ export class OpenAiHandler extends BaseProvider implements SingleCompletionHandl
644644
645645 // --- Responses helpers ---
646646
647- private _resolveApiFlavor (
648- override : "auto" | "responses" | "chat" | undefined ,
649- baseUrl : string ,
650- ) : "responses" | "chat" {
651- if ( override === "responses" ) return "responses"
652- if ( override === "chat" ) return "chat"
647+ private _resolveApiFlavor ( baseUrl : string ) : "responses" | "chat" {
653648 // Auto-detect by URL path
654649 const url = this . _safeParseUrl ( baseUrl )
655650 const path = url ?. pathname || ""
0 commit comments