Skip to content

Commit

Permalink
Support for per-model OpenAI Reasoning Effort settings. #698
Browse files Browse the repository at this point in the history
  • Loading branch information
enricoros committed Dec 25, 2024
1 parent f52e350 commit 557886f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 557886f

Please sign in to comment.