diff --git a/src/modules/aix/server/dispatch/chatGenerate/adapters/openai.chatCompletions.ts b/src/modules/aix/server/dispatch/chatGenerate/adapters/openai.chatCompletions.ts index 8448e3207..70e93d7a4 100644 --- a/src/modules/aix/server/dispatch/chatGenerate/adapters/openai.chatCompletions.ts +++ b/src/modules/aix/server/dispatch/chatGenerate/adapters/openai.chatCompletions.ts @@ -85,6 +85,11 @@ export function aixToOpenAIChatCompletions(openAIDialect: OpenAIDialects, model: payload.top_p = model.topP; } + // [OpenAI] Vendor-specific reasoning effort, for o1 models only as of 2024-12-24 + if (model.vndOaiReasoningEffort) { + payload.reasoning_effort = model.vndOaiReasoningEffort; + } + if (hotFixOpenAIo1Family) payload = _fixRequestForOpenAIO1_maxCompletionTokens(payload); diff --git a/src/modules/aix/server/dispatch/wiretypes/openai.wiretypes.ts b/src/modules/aix/server/dispatch/wiretypes/openai.wiretypes.ts index 5a1d8a701..b3648a488 100644 --- a/src/modules/aix/server/dispatch/wiretypes/openai.wiretypes.ts +++ b/src/modules/aix/server/dispatch/wiretypes/openai.wiretypes.ts @@ -233,6 +233,7 @@ export namespace OpenAIWire_API_Chat_Completions { stream_options: z.object({ include_usage: z.boolean().optional(), // If set, an additional chunk will be streamed with a 'usage' field on the entire request. }).optional(), + reasoning_effort: z.enum(['low', 'medium', 'high']).optional(), // [OpenAI, 2024-12-17] reasoning effort, o1 models only for now response_format: z.discriminatedUnion('type', [ z.object({ type: z.literal('text'), // Default