🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP →
Sign In

@ai-sdk/openai

Package Overview
Dependencies
Maintainers
3
Versions
609
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ai-sdk/openai - npm Package Compare versions

Comparing version
4.0.10
to
4.0.11
+20
-1
dist/index.d.ts

@@ -12,3 +12,3 @@ import * as _ai_sdk_provider from '@ai-sdk/provider';

user?: string | undefined;
reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | undefined;
maxCompletionTokens?: number | undefined;

@@ -22,2 +22,6 @@ store?: boolean | undefined;

promptCacheKey?: string | undefined;
promptCacheOptions?: {
mode?: "explicit" | "implicit" | undefined;
ttl?: "30m" | undefined;
} | undefined;
promptCacheRetention?: "in_memory" | "24h" | undefined;

@@ -249,2 +253,3 @@ safetyIdentifier?: string | undefined;

cached_tokens?: number | null | undefined;
cache_write_tokens?: number | null | undefined;
orchestration_input_tokens?: number | null | undefined;

@@ -261,2 +266,5 @@ orchestration_input_cached_tokens?: number | null | undefined;

} | null | undefined;
reasoning?: {
context?: string | null | undefined;
} | null | undefined;
service_tier?: string | null | undefined;

@@ -280,2 +288,3 @@ };

cached_tokens?: number | null | undefined;
cache_write_tokens?: number | null | undefined;
orchestration_input_tokens?: number | null | undefined;

@@ -289,2 +298,5 @@ orchestration_input_cached_tokens?: number | null | undefined;

} | null | undefined;
reasoning?: {
context?: string | null | undefined;
} | null | undefined;
service_tier?: string | null | undefined;

@@ -1081,4 +1093,10 @@ };

promptCacheKey?: string | null | undefined;
promptCacheOptions?: {
mode?: "explicit" | "implicit" | undefined;
ttl?: "30m" | undefined;
} | undefined;
promptCacheRetention?: "in_memory" | "24h" | null | undefined;
reasoningEffort?: string | null | undefined;
reasoningMode?: "standard" | "pro" | undefined;
reasoningContext?: "auto" | "current_turn" | "all_turns" | undefined;
reasoningSummary?: string | null | undefined;

@@ -1279,2 +1297,3 @@ safetyIdentifier?: string | null | undefined;

serviceTier?: string;
reasoningContext?: string;
};

@@ -1281,0 +1300,0 @@ type ResponsesReasoningProviderMetadata = {

@@ -12,3 +12,3 @@ import * as _ai_sdk_provider from '@ai-sdk/provider';

user?: string | undefined;
reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | undefined;
reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | undefined;
maxCompletionTokens?: number | undefined;

@@ -22,2 +22,6 @@ store?: boolean | undefined;

promptCacheKey?: string | undefined;
promptCacheOptions?: {
mode?: "explicit" | "implicit" | undefined;
ttl?: "30m" | undefined;
} | undefined;
promptCacheRetention?: "in_memory" | "24h" | undefined;

@@ -370,2 +374,3 @@ safetyIdentifier?: string | undefined;

cached_tokens?: number | null | undefined;
cache_write_tokens?: number | null | undefined;
orchestration_input_tokens?: number | null | undefined;

@@ -382,2 +387,5 @@ orchestration_input_cached_tokens?: number | null | undefined;

} | null | undefined;
reasoning?: {
context?: string | null | undefined;
} | null | undefined;
service_tier?: string | null | undefined;

@@ -401,2 +409,3 @@ };

cached_tokens?: number | null | undefined;
cache_write_tokens?: number | null | undefined;
orchestration_input_tokens?: number | null | undefined;

@@ -410,2 +419,5 @@ orchestration_input_cached_tokens?: number | null | undefined;

} | null | undefined;
reasoning?: {
context?: string | null | undefined;
} | null | undefined;
service_tier?: string | null | undefined;

@@ -819,2 +831,3 @@ };

serviceTier?: string;
reasoningContext?: string;
};

@@ -821,0 +834,0 @@ type ResponsesReasoningProviderMetadata = {

+3
-3
{
"name": "@ai-sdk/openai",
"version": "4.0.10",
"version": "4.0.11",
"type": "module",

@@ -38,4 +38,4 @@ "license": "Apache-2.0",

"dependencies": {
"@ai-sdk/provider-utils": "5.0.7",
"@ai-sdk/provider": "4.0.3"
"@ai-sdk/provider": "4.0.3",
"@ai-sdk/provider-utils": "5.0.7"
},

@@ -42,0 +42,0 @@ "devDependencies": {

@@ -9,2 +9,3 @@ import type { LanguageModelV4Usage } from '@ai-sdk/provider';

cached_tokens?: number | null;
cache_write_tokens?: number | null;
} | null;

@@ -41,2 +42,4 @@ completion_tokens_details?: {

const cachedTokens = usage.prompt_tokens_details?.cached_tokens ?? 0;
const cacheWriteTokens =
usage.prompt_tokens_details?.cache_write_tokens ?? undefined;
const reasoningTokens =

@@ -48,5 +51,5 @@ usage.completion_tokens_details?.reasoning_tokens ?? 0;

total: promptTokens,
noCache: promptTokens - cachedTokens,
noCache: promptTokens - cachedTokens - (cacheWriteTokens ?? 0),
cacheRead: cachedTokens,
cacheWrite: undefined,
cacheWrite: cacheWriteTokens,
},

@@ -53,0 +56,0 @@ outputTokens: {

@@ -5,2 +5,3 @@ import {

type LanguageModelV4Prompt,
type SharedV4ProviderOptions,
} from '@ai-sdk/provider';

@@ -19,2 +20,12 @@ import type { OpenAIChatPrompt } from './openai-chat-prompt';

type OpenAIPromptCacheBreakpoint = { mode: 'explicit' };
function getPromptCacheBreakpoint(
providerOptions: SharedV4ProviderOptions | undefined,
): OpenAIPromptCacheBreakpoint | undefined {
return providerOptions?.openai?.promptCacheBreakpoint as
| OpenAIPromptCacheBreakpoint
| undefined;
}
export function convertToOpenAIChatMessages({

@@ -33,3 +44,3 @@ prompt,

for (const { role, content } of prompt) {
for (const { role, content, providerOptions } of prompt) {
switch (role) {

@@ -39,7 +50,35 @@ case 'system': {

case 'system': {
messages.push({ role: 'system', content });
const promptCacheBreakpoint =
getPromptCacheBreakpoint(providerOptions);
messages.push({
role: 'system',
content:
promptCacheBreakpoint == null
? content
: [
{
type: 'text',
text: content,
prompt_cache_breakpoint: promptCacheBreakpoint,
},
],
});
break;
}
case 'developer': {
messages.push({ role: 'developer', content });
const promptCacheBreakpoint =
getPromptCacheBreakpoint(providerOptions);
messages.push({
role: 'developer',
content:
promptCacheBreakpoint == null
? content
: [
{
type: 'text',
text: content,
prompt_cache_breakpoint: promptCacheBreakpoint,
},
],
});
break;

@@ -65,3 +104,7 @@ }

case 'user': {
if (content.length === 1 && content[0].type === 'text') {
if (
content.length === 1 &&
content[0].type === 'text' &&
getPromptCacheBreakpoint(content[0].providerOptions) == null
) {
messages.push({ role: 'user', content: content[0].text });

@@ -76,5 +119,17 @@ break;

case 'text': {
return { type: 'text', text: part.text };
const promptCacheBreakpoint = getPromptCacheBreakpoint(
part.providerOptions,
);
return {
type: 'text',
text: part.text,
...(promptCacheBreakpoint != null && {
prompt_cache_breakpoint: promptCacheBreakpoint,
}),
};
}
case 'file': {
const promptCacheBreakpoint = getPromptCacheBreakpoint(
part.providerOptions,
);
switch (part.data.type) {

@@ -90,2 +145,5 @@ case 'reference': {

},
...(promptCacheBreakpoint != null && {
prompt_cache_breakpoint: promptCacheBreakpoint,
}),
};

@@ -113,2 +171,5 @@ }

},
...(promptCacheBreakpoint != null && {
prompt_cache_breakpoint: promptCacheBreakpoint,
}),
};

@@ -132,2 +193,5 @@ } else if (topLevel === 'audio') {

},
...(promptCacheBreakpoint != null && {
prompt_cache_breakpoint: promptCacheBreakpoint,
}),
};

@@ -143,2 +207,5 @@ }

},
...(promptCacheBreakpoint != null && {
prompt_cache_breakpoint: promptCacheBreakpoint,
}),
};

@@ -174,2 +241,5 @@ }

},
...(promptCacheBreakpoint != null && {
prompt_cache_breakpoint: promptCacheBreakpoint,
}),
};

@@ -189,2 +259,8 @@ }

let text = '';
const textParts: Array<{
type: 'text';
text: string;
prompt_cache_breakpoint?: OpenAIPromptCacheBreakpoint;
}> = [];
let hasPromptCacheBreakpoint = false;
const toolCalls: Array<{

@@ -199,3 +275,14 @@ id: string;

case 'text': {
const promptCacheBreakpoint = getPromptCacheBreakpoint(
part.providerOptions,
);
text += part.text;
textParts.push({
type: 'text',
text: part.text,
...(promptCacheBreakpoint != null && {
prompt_cache_breakpoint: promptCacheBreakpoint,
}),
});
hasPromptCacheBreakpoint ||= promptCacheBreakpoint != null;
break;

@@ -219,3 +306,7 @@ }

role: 'assistant',
content: toolCalls.length > 0 ? text || null : text,
content: hasPromptCacheBreakpoint
? textParts
: toolCalls.length > 0
? text || null
: text,
tool_calls: toolCalls.length > 0 ? toolCalls : undefined,

@@ -233,2 +324,9 @@ });

const output = toolResponse.output;
const promptCacheBreakpoint =
(output.type === 'content'
? output.value
.map(part => getPromptCacheBreakpoint(part.providerOptions))
.find(breakpoint => breakpoint != null)
: getPromptCacheBreakpoint(output.providerOptions)) ??
getPromptCacheBreakpoint(toolResponse.providerOptions);

@@ -254,3 +352,12 @@ let contentValue: string;

tool_call_id: toolResponse.toolCallId,
content: contentValue,
content:
promptCacheBreakpoint == null
? contentValue
: [
{
type: 'text',
text: contentValue,
prompt_cache_breakpoint: promptCacheBreakpoint,
},
],
});

@@ -257,0 +364,0 @@ }

@@ -95,2 +95,3 @@ import type { JSONSchema7 } from '@ai-sdk/provider';

cached_tokens: z.number().nullish(),
cache_write_tokens: z.number().nullish(),
})

@@ -184,2 +185,3 @@ .nullish(),

cached_tokens: z.number().nullish(),
cache_write_tokens: z.number().nullish(),
})

@@ -186,0 +188,0 @@ .nullish(),

@@ -112,3 +112,3 @@ import {

reasoningEffort: z
.enum(['none', 'minimal', 'low', 'medium', 'high', 'xhigh'])
.enum(['none', 'minimal', 'low', 'medium', 'high', 'xhigh', 'max'])
.optional(),

@@ -168,7 +168,21 @@

/**
* Prompt cache behavior for GPT-5.6 and later models.
* `mode` controls whether OpenAI also places an implicit breakpoint.
* `ttl` sets the minimum cache lifetime and currently only supports 30 minutes.
*/
promptCacheOptions: z
.object({
mode: z.enum(['implicit', 'explicit']).optional(),
ttl: z.literal('30m').optional(),
})
.optional(),
/**
* The retention policy for the prompt cache.
* - 'in_memory': Default. Standard prompt caching behavior.
* - '24h': Extended prompt caching that keeps cached prefixes active for up to 24 hours.
* Currently only available for 5.1 series models.
* Available for models before GPT-5.6 that support extended caching.
*
* @deprecated For GPT-5.6 and later models, use `promptCacheOptions.ttl`.
*
* @default 'in_memory'

@@ -175,0 +189,0 @@ */

@@ -199,2 +199,3 @@ import type {

prompt_cache_key: openaiOptions.promptCacheKey,
prompt_cache_options: openaiOptions.promptCacheOptions,
prompt_cache_retention: openaiOptions.promptCacheRetention,

@@ -201,0 +202,0 @@ safety_identifier: openaiOptions.safetyIdentifier,

@@ -12,3 +12,3 @@ export type OpenAIChatPrompt = Array<ChatCompletionMessage>;

role: 'system';
content: string;
content: string | Array<ChatCompletionContentPartText>;
}

@@ -18,3 +18,3 @@

role: 'developer';
content: string;
content: string | Array<ChatCompletionContentPartText>;
}

@@ -36,2 +36,3 @@

text: string;
prompt_cache_breakpoint?: { mode: 'explicit' };
}

@@ -42,2 +43,3 @@

image_url: { url: string };
prompt_cache_breakpoint?: { mode: 'explicit' };
}

@@ -48,2 +50,3 @@

input_audio: { data: string; format: 'wav' | 'mp3' };
prompt_cache_breakpoint?: { mode: 'explicit' };
}

@@ -54,2 +57,3 @@

file: { filename: string; file_data: string } | { file_id: string };
prompt_cache_breakpoint?: { mode: 'explicit' };
}

@@ -59,3 +63,3 @@

role: 'assistant';
content?: string | null;
content?: string | null | Array<ChatCompletionContentPartText>;
tool_calls?: Array<ChatCompletionMessageToolCall>;

@@ -75,4 +79,4 @@ }

role: 'tool';
content: string;
content: string | Array<ChatCompletionContentPartText>;
tool_call_id: string;
}

@@ -8,2 +8,3 @@ import type { LanguageModelV4Usage } from '@ai-sdk/provider';

cached_tokens?: number | null;
cache_write_tokens?: number | null;
orchestration_input_tokens?: number | null;

@@ -41,2 +42,4 @@ orchestration_input_cached_tokens?: number | null;

const cachedTokens = usage.input_tokens_details?.cached_tokens ?? 0;
const cacheWriteTokens =
usage.input_tokens_details?.cache_write_tokens ?? undefined;
const reasoningTokens = usage.output_tokens_details?.reasoning_tokens ?? 0;

@@ -47,5 +50,5 @@

total: inputTokens,
noCache: inputTokens - cachedTokens,
noCache: inputTokens - cachedTokens - (cacheWriteTokens ?? 0),
cacheRead: cachedTokens,
cacheWrite: undefined,
cacheWrite: cacheWriteTokens,
},

@@ -52,0 +55,0 @@ outputTokens: {

import {
UnsupportedFunctionalityError,
type LanguageModelV4Prompt,
type SharedV4ProviderOptions,
type LanguageModelV4ToolApprovalResponsePart,

@@ -44,2 +45,13 @@ type SharedV4Warning,

type OpenAIPromptCacheBreakpoint = { mode: 'explicit' };
function getPromptCacheBreakpoint(
providerOptions: SharedV4ProviderOptions | undefined,
providerOptionsName: string,
): OpenAIPromptCacheBreakpoint | undefined {
return providerOptions?.[providerOptionsName]?.promptCacheBreakpoint as
| OpenAIPromptCacheBreakpoint
| undefined;
}
/**

@@ -93,3 +105,3 @@ * This is soft-deprecated. Use provider references instead. Kept for backward compatibility

for (const { role, content } of prompt) {
for (const { role, content, providerOptions } of prompt) {
switch (role) {

@@ -99,7 +111,39 @@ case 'system': {

case 'system': {
input.push({ role: 'system', content });
const promptCacheBreakpoint = getPromptCacheBreakpoint(
providerOptions,
providerOptionsName,
);
input.push({
role: 'system',
content:
promptCacheBreakpoint == null
? content
: [
{
type: 'input_text',
text: content,
prompt_cache_breakpoint: promptCacheBreakpoint,
},
],
});
break;
}
case 'developer': {
input.push({ role: 'developer', content });
const promptCacheBreakpoint = getPromptCacheBreakpoint(
providerOptions,
providerOptionsName,
);
input.push({
role: 'developer',
content:
promptCacheBreakpoint == null
? content
: [
{
type: 'input_text',
text: content,
prompt_cache_breakpoint: promptCacheBreakpoint,
},
],
});
break;

@@ -130,5 +174,19 @@ }

case 'text': {
return { type: 'input_text', text: part.text };
const promptCacheBreakpoint = getPromptCacheBreakpoint(
part.providerOptions,
providerOptionsName,
);
return {
type: 'input_text',
text: part.text,
...(promptCacheBreakpoint != null && {
prompt_cache_breakpoint: promptCacheBreakpoint,
}),
};
}
case 'file': {
const promptCacheBreakpoint = getPromptCacheBreakpoint(
part.providerOptions,
providerOptionsName,
);
switch (part.data.type) {

@@ -148,2 +206,5 @@ case 'reference': {

?.imageDetail,
...(promptCacheBreakpoint != null && {
prompt_cache_breakpoint: promptCacheBreakpoint,
}),
};

@@ -155,2 +216,5 @@ }

file_id: fileId,
...(promptCacheBreakpoint != null && {
prompt_cache_breakpoint: promptCacheBreakpoint,
}),
};

@@ -181,2 +245,5 @@ }

?.imageDetail,
...(promptCacheBreakpoint != null && {
prompt_cache_breakpoint: promptCacheBreakpoint,
}),
};

@@ -188,2 +255,5 @@ } else {

file_url: part.data.url.toString(),
...(promptCacheBreakpoint != null && {
prompt_cache_breakpoint: promptCacheBreakpoint,
}),
};

@@ -215,2 +285,5 @@ }

}),
...(promptCacheBreakpoint != null && {
prompt_cache_breakpoint: promptCacheBreakpoint,
}),
};

@@ -825,5 +898,15 @@ }

.map(item => {
const promptCacheBreakpoint = getPromptCacheBreakpoint(
item.providerOptions,
providerOptionsName,
);
switch (item.type) {
case 'text':
return { type: 'input_text' as const, text: item.text };
return {
type: 'input_text' as const,
text: item.text,
...(promptCacheBreakpoint != null && {
prompt_cache_breakpoint: promptCacheBreakpoint,
}),
};
case 'file': {

@@ -844,2 +927,5 @@ const topLevel = getTopLevelMediaType(item.mediaType);

detail: imageDetail,
...(promptCacheBreakpoint != null && {
prompt_cache_breakpoint: promptCacheBreakpoint,
}),
};

@@ -851,2 +937,5 @@ }

file_data: `data:${fullMediaType};base64,${convertToBase64(item.data.data)}`,
...(promptCacheBreakpoint != null && {
prompt_cache_breakpoint: promptCacheBreakpoint,
}),
};

@@ -861,2 +950,5 @@ }

detail: imageDetail,
...(promptCacheBreakpoint != null && {
prompt_cache_breakpoint: promptCacheBreakpoint,
}),
};

@@ -867,2 +959,5 @@ }

file_url: item.data.url.toString(),
...(promptCacheBreakpoint != null && {
prompt_cache_breakpoint: promptCacheBreakpoint,
}),
};

@@ -914,5 +1009,15 @@ }

.map(item => {
const promptCacheBreakpoint = getPromptCacheBreakpoint(
item.providerOptions,
providerOptionsName,
);
switch (item.type) {
case 'text': {
return { type: 'input_text' as const, text: item.text };
return {
type: 'input_text' as const,
text: item.text,
...(promptCacheBreakpoint != null && {
prompt_cache_breakpoint: promptCacheBreakpoint,
}),
};
}

@@ -935,2 +1040,5 @@

detail: imageDetail,
...(promptCacheBreakpoint != null && {
prompt_cache_breakpoint: promptCacheBreakpoint,
}),
};

@@ -942,2 +1050,5 @@ }

file_data: `data:${fullMediaType};base64,${convertToBase64(item.data.data)}`,
...(promptCacheBreakpoint != null && {
prompt_cache_breakpoint: promptCacheBreakpoint,
}),
};

@@ -952,2 +1063,5 @@ }

detail: imageDetail,
...(promptCacheBreakpoint != null && {
prompt_cache_breakpoint: promptCacheBreakpoint,
}),
};

@@ -958,2 +1072,5 @@ }

file_url: item.data.url.toString(),
...(promptCacheBreakpoint != null && {
prompt_cache_breakpoint: promptCacheBreakpoint,
}),
};

@@ -960,0 +1077,0 @@ }

@@ -76,3 +76,9 @@ import type { JSONObject, JSONSchema7, JSONValue } from '@ai-sdk/provider';

role: 'system' | 'developer';
content: string;
content:
| string
| Array<{
type: 'input_text';
text: string;
prompt_cache_breakpoint?: { mode: 'explicit' };
}>;
};

@@ -83,8 +89,33 @@

content: Array<
| { type: 'input_text'; text: string }
| { type: 'input_image'; image_url: string }
| { type: 'input_image'; file_id: string }
| { type: 'input_file'; file_url: string }
| { type: 'input_file'; filename: string; file_data: string }
| { type: 'input_file'; file_id: string }
| {
type: 'input_text';
text: string;
prompt_cache_breakpoint?: { mode: 'explicit' };
}
| {
type: 'input_image';
image_url: string;
prompt_cache_breakpoint?: { mode: 'explicit' };
}
| {
type: 'input_image';
file_id: string;
prompt_cache_breakpoint?: { mode: 'explicit' };
}
| {
type: 'input_file';
file_url: string;
prompt_cache_breakpoint?: { mode: 'explicit' };
}
| {
type: 'input_file';
filename: string;
file_data: string;
prompt_cache_breakpoint?: { mode: 'explicit' };
}
| {
type: 'input_file';
file_id: string;
prompt_cache_breakpoint?: { mode: 'explicit' };
}
>;

@@ -115,6 +146,23 @@ };

| Array<
| { type: 'input_text'; text: string }
| { type: 'input_image'; image_url: string }
| { type: 'input_file'; filename: string; file_data: string }
| { type: 'input_file'; file_url: string }
| {
type: 'input_text';
text: string;
prompt_cache_breakpoint?: { mode: 'explicit' };
}
| {
type: 'input_image';
image_url: string;
prompt_cache_breakpoint?: { mode: 'explicit' };
}
| {
type: 'input_file';
filename: string;
file_data: string;
prompt_cache_breakpoint?: { mode: 'explicit' };
}
| {
type: 'input_file';
file_url: string;
prompt_cache_breakpoint?: { mode: 'explicit' };
}
>;

@@ -540,2 +588,3 @@ };

cached_tokens: z.number().nullish(),
cache_write_tokens: z.number().nullish(),
orchestration_input_tokens: z.number().nullish(),

@@ -553,2 +602,7 @@ orchestration_input_cached_tokens: z.number().nullish(),

}),
reasoning: z
.object({
context: z.string().nullish(),
})
.nullish(),
service_tier: z.string().nullish(),

@@ -574,2 +628,3 @@ }),

cached_tokens: z.number().nullish(),
cache_write_tokens: z.number().nullish(),
orchestration_input_tokens: z.number().nullish(),

@@ -588,2 +643,7 @@ orchestration_input_cached_tokens: z.number().nullish(),

.nullish(),
reasoning: z
.object({
context: z.string().nullish(),
})
.nullish(),
service_tier: z.string().nullish(),

@@ -1436,2 +1496,7 @@ }),

service_tier: z.string().nullish(),
reasoning: z
.object({
context: z.string().nullish(),
})
.nullish(),
incomplete_details: z.object({ reason: z.string() }).nullish(),

@@ -1444,2 +1509,3 @@ usage: z

cached_tokens: z.number().nullish(),
cache_write_tokens: z.number().nullish(),
orchestration_input_tokens: z.number().nullish(),

@@ -1446,0 +1512,0 @@ orchestration_input_cached_tokens: z.number().nullish(),

@@ -234,7 +234,21 @@ import {

/**
* Prompt cache behavior for GPT-5.6 and later models.
* `mode` controls whether OpenAI also places an implicit breakpoint.
* `ttl` sets the minimum cache lifetime and currently only supports 30 minutes.
*/
promptCacheOptions: z
.object({
mode: z.enum(['implicit', 'explicit']).optional(),
ttl: z.literal('30m').optional(),
})
.optional(),
/**
* The retention policy for the prompt cache.
* - 'in_memory': Default. Standard prompt caching behavior.
* - '24h': Extended prompt caching that keeps cached prefixes active for up to 24 hours.
* Currently only available for 5.1 series models.
* Available for models before GPT-5.6 that support extended caching.
*
* @deprecated For GPT-5.6 and later models, use `promptCacheOptions.ttl`.
*
* @default 'in_memory'

@@ -247,8 +261,4 @@ */

* `providerOptions` to set the `reasoningEffort` option, this model setting will be ignored.
* Valid values: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh'
*
* The 'none' type for `reasoningEffort` is only available for OpenAI's GPT-5.1
* models. Also, the 'xhigh' type for `reasoningEffort` is only available for
* OpenAI's GPT-5.1-Codex-Max model. Setting `reasoningEffort` to 'none' or 'xhigh' with unsupported models will result in
* an error.
* GPT-5.6 supports 'none' | 'low' | 'medium' | 'high' | 'xhigh' | 'max'.
* Supported values vary by model.
*/

@@ -258,2 +268,17 @@ reasoningEffort: z.string().nullish(),

/**
* Controls how much model work GPT-5.6 performs before returning a final answer.
* `standard` is the default. `pro` increases quality, latency, and token usage.
*/
reasoningMode: z.enum(['standard', 'pro']).optional(),
/**
* Controls which available reasoning items GPT-5.6 can use.
* `auto` uses the model default, `current_turn` excludes reasoning from earlier
* turns, and `all_turns` makes compatible earlier reasoning available.
*/
reasoningContext: z
.enum(['auto', 'current_turn', 'all_turns'])
.optional(),
/**
* Controls reasoning summary output from the model.

@@ -260,0 +285,0 @@ * Set to "auto" to automatically receive the richest level available,

@@ -18,2 +18,3 @@ import type {

serviceTier?: string;
reasoningContext?: string;
};

@@ -20,0 +21,0 @@

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display