@ai-sdk/openai 3.0.117 → 3.0.119
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/dist/index.d.mts +5 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +1135 -1066
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1120 -1050
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +1252 -1183
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +1237 -1167
- package/dist/internal/index.mjs.map +1 -1
- package/docs/03-openai.mdx +83 -34
- package/package.json +3 -3
- package/src/index.ts +1 -0
- package/src/responses/convert-to-openai-responses-input.ts +39 -0
- package/src/responses/openai-responses-language-model.ts +63 -14
- package/src/responses/openai-responses-options.ts +22 -0
package/dist/internal/index.mjs
CHANGED
|
@@ -2756,6 +2756,7 @@ var OpenAISpeechModel = class {
|
|
|
2756
2756
|
|
|
2757
2757
|
// src/responses/openai-responses-language-model.ts
|
|
2758
2758
|
import {
|
|
2759
|
+
UnsupportedFunctionalityError as UnsupportedFunctionalityError6,
|
|
2759
2760
|
APICallError as APICallError2
|
|
2760
2761
|
} from "@ai-sdk/provider";
|
|
2761
2762
|
import {
|
|
@@ -2819,47 +2820,348 @@ import {
|
|
|
2819
2820
|
parseProviderOptions as parseProviderOptions7,
|
|
2820
2821
|
validateTypes
|
|
2821
2822
|
} from "@ai-sdk/provider-utils";
|
|
2822
|
-
import { z as
|
|
2823
|
+
import { z as z18 } from "zod/v4";
|
|
2823
2824
|
|
|
2824
|
-
// src/
|
|
2825
|
+
// src/responses/openai-responses-options.ts
|
|
2825
2826
|
import {
|
|
2826
|
-
createProviderToolFactoryWithOutputSchema,
|
|
2827
2827
|
lazySchema as lazySchema12,
|
|
2828
2828
|
zodSchema as zodSchema12
|
|
2829
2829
|
} from "@ai-sdk/provider-utils";
|
|
2830
2830
|
import { z as z13 } from "zod/v4";
|
|
2831
|
-
var
|
|
2831
|
+
var TOP_LOGPROBS_MAX = 20;
|
|
2832
|
+
var openaiResponsesReasoningModelIds = [
|
|
2833
|
+
"o1",
|
|
2834
|
+
"o1-2024-12-17",
|
|
2835
|
+
"o3",
|
|
2836
|
+
"o3-2025-04-16",
|
|
2837
|
+
"o3-mini",
|
|
2838
|
+
"o3-mini-2025-01-31",
|
|
2839
|
+
"o4-mini",
|
|
2840
|
+
"o4-mini-2025-04-16",
|
|
2841
|
+
"gpt-5",
|
|
2842
|
+
"gpt-5-2025-08-07",
|
|
2843
|
+
"gpt-5-codex",
|
|
2844
|
+
"gpt-5-mini",
|
|
2845
|
+
"gpt-5-mini-2025-08-07",
|
|
2846
|
+
"gpt-5-nano",
|
|
2847
|
+
"gpt-5-nano-2025-08-07",
|
|
2848
|
+
"gpt-5-pro",
|
|
2849
|
+
"gpt-5-pro-2025-10-06",
|
|
2850
|
+
"gpt-5.1",
|
|
2851
|
+
"gpt-5.1-chat-latest",
|
|
2852
|
+
"gpt-5.1-codex-mini",
|
|
2853
|
+
"gpt-5.1-codex",
|
|
2854
|
+
"gpt-5.1-codex-max",
|
|
2855
|
+
"gpt-5.2",
|
|
2856
|
+
"gpt-5.2-chat-latest",
|
|
2857
|
+
"gpt-5.2-pro",
|
|
2858
|
+
"gpt-5.2-codex",
|
|
2859
|
+
"gpt-5.3-chat-latest",
|
|
2860
|
+
"gpt-5.3-codex",
|
|
2861
|
+
"gpt-5.4",
|
|
2862
|
+
"gpt-5.4-2026-03-05",
|
|
2863
|
+
"gpt-5.4-mini",
|
|
2864
|
+
"gpt-5.4-mini-2026-03-17",
|
|
2865
|
+
"gpt-5.4-nano",
|
|
2866
|
+
"gpt-5.4-nano-2026-03-17",
|
|
2867
|
+
"gpt-5.4-pro",
|
|
2868
|
+
"gpt-5.4-pro-2026-03-05",
|
|
2869
|
+
"gpt-5.5",
|
|
2870
|
+
"gpt-5.5-2026-04-23",
|
|
2871
|
+
"gpt-5.6",
|
|
2872
|
+
"gpt-5.6-luna",
|
|
2873
|
+
"gpt-5.6-sol",
|
|
2874
|
+
"gpt-5.6-terra",
|
|
2875
|
+
"gpt-6-astra",
|
|
2876
|
+
"gpt-6-luna",
|
|
2877
|
+
"gpt-6-sol"
|
|
2878
|
+
];
|
|
2879
|
+
var openaiResponsesModelIds = [
|
|
2880
|
+
"gpt-4.1",
|
|
2881
|
+
"gpt-4.1-2025-04-14",
|
|
2882
|
+
"gpt-4.1-mini",
|
|
2883
|
+
"gpt-4.1-mini-2025-04-14",
|
|
2884
|
+
"gpt-4.1-nano",
|
|
2885
|
+
"gpt-4.1-nano-2025-04-14",
|
|
2886
|
+
"gpt-4o",
|
|
2887
|
+
"gpt-4o-2024-05-13",
|
|
2888
|
+
"gpt-4o-2024-08-06",
|
|
2889
|
+
"gpt-4o-2024-11-20",
|
|
2890
|
+
"gpt-4o-audio-preview",
|
|
2891
|
+
"gpt-4o-audio-preview-2024-12-17",
|
|
2892
|
+
"gpt-4o-search-preview",
|
|
2893
|
+
"gpt-4o-search-preview-2025-03-11",
|
|
2894
|
+
"gpt-4o-mini-search-preview",
|
|
2895
|
+
"gpt-4o-mini-search-preview-2025-03-11",
|
|
2896
|
+
"gpt-4o-mini",
|
|
2897
|
+
"gpt-4o-mini-2024-07-18",
|
|
2898
|
+
"gpt-3.5-turbo-0125",
|
|
2899
|
+
"gpt-3.5-turbo",
|
|
2900
|
+
"gpt-3.5-turbo-1106",
|
|
2901
|
+
"gpt-5-chat-latest",
|
|
2902
|
+
...openaiResponsesReasoningModelIds
|
|
2903
|
+
];
|
|
2904
|
+
var openaiLanguageModelResponsesOptionsSchema = lazySchema12(
|
|
2905
|
+
() => zodSchema12(
|
|
2906
|
+
z13.object({
|
|
2907
|
+
/**
|
|
2908
|
+
* The ID of the OpenAI Conversation to continue.
|
|
2909
|
+
* You must create a conversation first via the OpenAI API.
|
|
2910
|
+
* Cannot be used in conjunction with `previousResponseId`.
|
|
2911
|
+
* Defaults to `undefined`.
|
|
2912
|
+
* @see https://platform.openai.com/docs/api-reference/conversations/create
|
|
2913
|
+
*/
|
|
2914
|
+
conversation: z13.string().nullish(),
|
|
2915
|
+
/**
|
|
2916
|
+
* The set of extra fields to include in the response (advanced, usually not needed).
|
|
2917
|
+
* Example values: 'reasoning.encrypted_content', 'file_search_call.results', 'web_search_call.results', 'message.output_text.logprobs'.
|
|
2918
|
+
*/
|
|
2919
|
+
include: z13.array(
|
|
2920
|
+
z13.enum([
|
|
2921
|
+
"reasoning.encrypted_content",
|
|
2922
|
+
// handled internally by default, only needed for unknown reasoning models
|
|
2923
|
+
"file_search_call.results",
|
|
2924
|
+
"web_search_call.results",
|
|
2925
|
+
"message.output_text.logprobs"
|
|
2926
|
+
])
|
|
2927
|
+
).nullish(),
|
|
2928
|
+
/**
|
|
2929
|
+
* Instructions for the model.
|
|
2930
|
+
* They can be used to change the system or developer message when continuing a conversation using the `previousResponseId` option.
|
|
2931
|
+
* Defaults to `undefined`.
|
|
2932
|
+
*/
|
|
2933
|
+
instructions: z13.string().nullish(),
|
|
2934
|
+
/**
|
|
2935
|
+
* Return the log probabilities of the tokens. Including logprobs will increase
|
|
2936
|
+
* the response size and can slow down response times. However, it can
|
|
2937
|
+
* be useful to better understand how the model is behaving.
|
|
2938
|
+
*
|
|
2939
|
+
* Setting to true will return the log probabilities of the tokens that
|
|
2940
|
+
* were generated.
|
|
2941
|
+
*
|
|
2942
|
+
* Setting to a number will return the log probabilities of the top n
|
|
2943
|
+
* tokens that were generated.
|
|
2944
|
+
*
|
|
2945
|
+
* @see https://platform.openai.com/docs/api-reference/responses/create
|
|
2946
|
+
* @see https://cookbook.openai.com/examples/using_logprobs
|
|
2947
|
+
*/
|
|
2948
|
+
logprobs: z13.union([z13.boolean(), z13.number().min(1).max(TOP_LOGPROBS_MAX)]).optional(),
|
|
2949
|
+
/**
|
|
2950
|
+
* The maximum number of total calls to built-in tools that can be processed in a response.
|
|
2951
|
+
* This maximum number applies across all built-in tool calls, not per individual tool.
|
|
2952
|
+
* Any further attempts to call a tool by the model will be ignored.
|
|
2953
|
+
*/
|
|
2954
|
+
maxToolCalls: z13.number().nullish(),
|
|
2955
|
+
/**
|
|
2956
|
+
* Additional metadata to store with the generation.
|
|
2957
|
+
*/
|
|
2958
|
+
metadata: z13.any().nullish(),
|
|
2959
|
+
/**
|
|
2960
|
+
* Whether to use parallel tool calls. Defaults to `true`.
|
|
2961
|
+
*/
|
|
2962
|
+
parallelToolCalls: z13.boolean().nullish(),
|
|
2963
|
+
/**
|
|
2964
|
+
* The ID of the previous response. You can use it to continue a conversation.
|
|
2965
|
+
* Defaults to `undefined`.
|
|
2966
|
+
*/
|
|
2967
|
+
previousResponseId: z13.string().nullish(),
|
|
2968
|
+
/**
|
|
2969
|
+
* Sets a cache key to tie this prompt to cached prefixes for better caching performance.
|
|
2970
|
+
*/
|
|
2971
|
+
promptCacheKey: z13.string().nullish(),
|
|
2972
|
+
/**
|
|
2973
|
+
* Prompt cache behavior for GPT-5.6 and later models.
|
|
2974
|
+
* `mode` controls whether OpenAI also places an implicit breakpoint.
|
|
2975
|
+
* `ttl` sets the minimum cache lifetime and currently only supports 30 minutes.
|
|
2976
|
+
*/
|
|
2977
|
+
promptCacheOptions: z13.object({
|
|
2978
|
+
mode: z13.enum(["implicit", "explicit"]).optional(),
|
|
2979
|
+
ttl: z13.literal("30m").optional()
|
|
2980
|
+
}).optional(),
|
|
2981
|
+
/**
|
|
2982
|
+
* The retention policy for the prompt cache.
|
|
2983
|
+
* - 'in_memory': Default. Standard prompt caching behavior.
|
|
2984
|
+
* - '24h': Extended prompt caching that keeps cached prefixes active for up to 24 hours.
|
|
2985
|
+
* Available for models before GPT-5.6 that support extended caching.
|
|
2986
|
+
*
|
|
2987
|
+
* @deprecated For GPT-5.6 and later models, use `promptCacheOptions.ttl`.
|
|
2988
|
+
*
|
|
2989
|
+
* @default 'in_memory'
|
|
2990
|
+
*/
|
|
2991
|
+
promptCacheRetention: z13.enum(["in_memory", "24h"]).nullish(),
|
|
2992
|
+
/**
|
|
2993
|
+
* Reasoning effort for reasoning models. Defaults to `medium`. If you use
|
|
2994
|
+
* `providerOptions` to set the `reasoningEffort` option, this model setting will be ignored.
|
|
2995
|
+
* GPT-5.6 supports 'none' | 'low' | 'medium' | 'high' | 'xhigh' | 'max'.
|
|
2996
|
+
* GPT-6 and later models support 'low' | 'medium' | 'high' | 'xhigh' | 'max'.
|
|
2997
|
+
* Supported values vary by model.
|
|
2998
|
+
*/
|
|
2999
|
+
reasoningEffort: z13.string().nullish(),
|
|
3000
|
+
/**
|
|
3001
|
+
* Updates the reasoning effort for GPT-6 and later models starting with this response
|
|
3002
|
+
* without changing the request-level reasoning effort. This preserves the
|
|
3003
|
+
* request prefix for prompt caching.
|
|
3004
|
+
*
|
|
3005
|
+
* Only supported by GPT-6 and later models in standard, single-agent mode. Cannot be
|
|
3006
|
+
* combined with automatic truncation.
|
|
3007
|
+
*/
|
|
3008
|
+
reasoningEffortUpdate: z13.enum(["low", "medium", "high", "xhigh", "max"]).optional(),
|
|
3009
|
+
/**
|
|
3010
|
+
* Controls how much model work GPT-5.6 performs before returning a final answer.
|
|
3011
|
+
* `standard` is the default. `pro` increases quality, latency, and token usage.
|
|
3012
|
+
*/
|
|
3013
|
+
reasoningMode: z13.enum(["standard", "pro"]).optional(),
|
|
3014
|
+
/**
|
|
3015
|
+
* Controls which available reasoning items GPT-5.6 can use.
|
|
3016
|
+
* `auto` uses the model default, `current_turn` excludes reasoning from earlier
|
|
3017
|
+
* turns, and `all_turns` makes compatible earlier reasoning available.
|
|
3018
|
+
*/
|
|
3019
|
+
reasoningContext: z13.enum(["auto", "current_turn", "all_turns"]).optional(),
|
|
3020
|
+
/**
|
|
3021
|
+
* Controls reasoning summary output from the model.
|
|
3022
|
+
* Set to "auto" to automatically receive the richest level available,
|
|
3023
|
+
* or "detailed" for comprehensive summaries.
|
|
3024
|
+
*/
|
|
3025
|
+
reasoningSummary: z13.string().nullish(),
|
|
3026
|
+
/**
|
|
3027
|
+
* The identifier for safety monitoring and tracking.
|
|
3028
|
+
*/
|
|
3029
|
+
safetyIdentifier: z13.string().nullish(),
|
|
3030
|
+
/**
|
|
3031
|
+
* Service tier for the request.
|
|
3032
|
+
* Set to 'flex' for 50% cheaper processing at the cost of increased latency (available for o3, o4-mini, and gpt-5 models).
|
|
3033
|
+
* Set to 'priority' for faster processing with Enterprise access (available for gpt-4, gpt-5, gpt-5-mini, o3, o4-mini; gpt-5-nano is not supported).
|
|
3034
|
+
* Set to 'fast' for the same tier as 'priority' (OpenAI's newer name for it).
|
|
3035
|
+
*
|
|
3036
|
+
* Defaults to 'auto'.
|
|
3037
|
+
*/
|
|
3038
|
+
serviceTier: z13.enum(["auto", "flex", "priority", "fast", "default"]).nullish(),
|
|
3039
|
+
/**
|
|
3040
|
+
* Whether to store the generation. Defaults to `true`.
|
|
3041
|
+
*/
|
|
3042
|
+
store: z13.boolean().nullish(),
|
|
3043
|
+
/**
|
|
3044
|
+
* Whether to pass through non-image file types as generic input files.
|
|
3045
|
+
*
|
|
3046
|
+
* By default, inline file inputs are restricted to images and PDFs.
|
|
3047
|
+
* Enable this when the target OpenAI Responses model supports additional
|
|
3048
|
+
* file media types, such as text/csv.
|
|
3049
|
+
*/
|
|
3050
|
+
passThroughUnsupportedFiles: z13.boolean().optional(),
|
|
3051
|
+
/**
|
|
3052
|
+
* Whether to use strict JSON schema validation.
|
|
3053
|
+
* Defaults to `true`.
|
|
3054
|
+
*/
|
|
3055
|
+
strictJsonSchema: z13.boolean().nullish(),
|
|
3056
|
+
/**
|
|
3057
|
+
* Controls the verbosity of the model's responses. Lower values ('low') will result
|
|
3058
|
+
* in more concise responses, while higher values ('high') will result in more verbose responses.
|
|
3059
|
+
* Valid values: 'low', 'medium', 'high'.
|
|
3060
|
+
*/
|
|
3061
|
+
textVerbosity: z13.enum(["low", "medium", "high"]).nullish(),
|
|
3062
|
+
/**
|
|
3063
|
+
* Controls output truncation. 'auto' (default) performs truncation automatically;
|
|
3064
|
+
* 'disabled' turns truncation off.
|
|
3065
|
+
*/
|
|
3066
|
+
truncation: z13.enum(["auto", "disabled"]).nullish(),
|
|
3067
|
+
/**
|
|
3068
|
+
* A unique identifier representing your end-user, which can help OpenAI to
|
|
3069
|
+
* monitor and detect abuse.
|
|
3070
|
+
* Defaults to `undefined`.
|
|
3071
|
+
* @see https://platform.openai.com/docs/guides/safety-best-practices/end-user-ids
|
|
3072
|
+
*/
|
|
3073
|
+
user: z13.string().nullish(),
|
|
3074
|
+
/**
|
|
3075
|
+
* Override the system message mode for this model.
|
|
3076
|
+
* - 'system': Use the 'system' role for system messages (default for most models)
|
|
3077
|
+
* - 'developer': Use the 'developer' role for system messages (used by reasoning models)
|
|
3078
|
+
* - 'remove': Remove system messages entirely
|
|
3079
|
+
*
|
|
3080
|
+
* If not specified, the mode is automatically determined based on the model.
|
|
3081
|
+
*/
|
|
3082
|
+
systemMessageMode: z13.enum(["system", "developer", "remove"]).optional(),
|
|
3083
|
+
/**
|
|
3084
|
+
* Force treating this model as a reasoning model.
|
|
3085
|
+
*
|
|
3086
|
+
* This is useful for "stealth" reasoning models (e.g. via a custom baseURL)
|
|
3087
|
+
* where the model ID is not recognized by the SDK's allowlist.
|
|
3088
|
+
*
|
|
3089
|
+
* When enabled, the SDK applies reasoning-model parameter compatibility rules
|
|
3090
|
+
* and defaults `systemMessageMode` to `developer` unless overridden.
|
|
3091
|
+
*/
|
|
3092
|
+
forceReasoning: z13.boolean().optional(),
|
|
3093
|
+
/**
|
|
3094
|
+
* Restrict the callable tools to a subset while keeping the full tools
|
|
3095
|
+
* list intact, so prompt caching is preserved across requests with
|
|
3096
|
+
* different allowlists.
|
|
3097
|
+
*
|
|
3098
|
+
* When set, this overrides the request-level `toolChoice` and emits
|
|
3099
|
+
* `tool_choice: { type: "allowed_tools", mode, tools }` on the wire.
|
|
3100
|
+
*
|
|
3101
|
+
* @see https://developers.openai.com/api/reference/resources/responses/methods/create#(resource)%20responses%20%3E%20(model)%20tool_choice_allowed%20%3E%20(schema)
|
|
3102
|
+
*/
|
|
3103
|
+
allowedTools: z13.object({
|
|
3104
|
+
toolNames: z13.array(z13.string()).min(1),
|
|
3105
|
+
mode: z13.enum(["auto", "required"]).optional()
|
|
3106
|
+
}).optional()
|
|
3107
|
+
})
|
|
3108
|
+
)
|
|
3109
|
+
);
|
|
3110
|
+
var openaiResponsesSystemMessageOptionsSchema = lazySchema12(
|
|
2832
3111
|
() => zodSchema12(
|
|
2833
3112
|
z13.object({
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
3113
|
+
/**
|
|
3114
|
+
* Emit a configuration update at this position in Responses history.
|
|
3115
|
+
* Requires empty system message content and the same supported
|
|
3116
|
+
* configuration as the request-level reasoningEffortUpdate option.
|
|
3117
|
+
* Unsupported historical updates throw instead of being omitted.
|
|
3118
|
+
*
|
|
3119
|
+
* @see https://developers.openai.com/api/docs/guides/reasoning#change-reasoning-mid-conversation
|
|
3120
|
+
*/
|
|
3121
|
+
reasoningEffortUpdate: z13.enum(["low", "medium", "high", "xhigh", "max"]).optional()
|
|
3122
|
+
})
|
|
3123
|
+
)
|
|
3124
|
+
);
|
|
3125
|
+
|
|
3126
|
+
// src/tool/apply-patch.ts
|
|
3127
|
+
import {
|
|
3128
|
+
createProviderToolFactoryWithOutputSchema,
|
|
3129
|
+
lazySchema as lazySchema13,
|
|
3130
|
+
zodSchema as zodSchema13
|
|
3131
|
+
} from "@ai-sdk/provider-utils";
|
|
3132
|
+
import { z as z14 } from "zod/v4";
|
|
3133
|
+
var applyPatchInputSchema = lazySchema13(
|
|
3134
|
+
() => zodSchema13(
|
|
3135
|
+
z14.object({
|
|
3136
|
+
callId: z14.string(),
|
|
3137
|
+
operation: z14.discriminatedUnion("type", [
|
|
3138
|
+
z14.object({
|
|
3139
|
+
type: z14.literal("create_file"),
|
|
3140
|
+
path: z14.string(),
|
|
3141
|
+
diff: z14.string()
|
|
2840
3142
|
}),
|
|
2841
|
-
|
|
2842
|
-
type:
|
|
2843
|
-
path:
|
|
3143
|
+
z14.object({
|
|
3144
|
+
type: z14.literal("delete_file"),
|
|
3145
|
+
path: z14.string()
|
|
2844
3146
|
}),
|
|
2845
|
-
|
|
2846
|
-
type:
|
|
2847
|
-
path:
|
|
2848
|
-
diff:
|
|
3147
|
+
z14.object({
|
|
3148
|
+
type: z14.literal("update_file"),
|
|
3149
|
+
path: z14.string(),
|
|
3150
|
+
diff: z14.string()
|
|
2849
3151
|
})
|
|
2850
3152
|
])
|
|
2851
3153
|
})
|
|
2852
3154
|
)
|
|
2853
3155
|
);
|
|
2854
|
-
var applyPatchOutputSchema =
|
|
2855
|
-
() =>
|
|
2856
|
-
|
|
2857
|
-
status:
|
|
2858
|
-
output:
|
|
3156
|
+
var applyPatchOutputSchema = lazySchema13(
|
|
3157
|
+
() => zodSchema13(
|
|
3158
|
+
z14.object({
|
|
3159
|
+
status: z14.enum(["completed", "failed"]),
|
|
3160
|
+
output: z14.string().optional()
|
|
2859
3161
|
})
|
|
2860
3162
|
)
|
|
2861
3163
|
);
|
|
2862
|
-
var applyPatchArgsSchema =
|
|
3164
|
+
var applyPatchArgsSchema = lazySchema13(() => zodSchema13(z14.object({})));
|
|
2863
3165
|
var applyPatchToolFactory = createProviderToolFactoryWithOutputSchema({
|
|
2864
3166
|
id: "openai.apply_patch",
|
|
2865
3167
|
inputSchema: applyPatchInputSchema,
|
|
@@ -2870,26 +3172,26 @@ var applyPatch = applyPatchToolFactory;
|
|
|
2870
3172
|
// src/tool/local-shell.ts
|
|
2871
3173
|
import {
|
|
2872
3174
|
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema2,
|
|
2873
|
-
lazySchema as
|
|
2874
|
-
zodSchema as
|
|
3175
|
+
lazySchema as lazySchema14,
|
|
3176
|
+
zodSchema as zodSchema14
|
|
2875
3177
|
} from "@ai-sdk/provider-utils";
|
|
2876
|
-
import { z as
|
|
2877
|
-
var localShellInputSchema =
|
|
2878
|
-
() =>
|
|
2879
|
-
|
|
2880
|
-
action:
|
|
2881
|
-
type:
|
|
2882
|
-
command:
|
|
2883
|
-
timeoutMs:
|
|
2884
|
-
user:
|
|
2885
|
-
workingDirectory:
|
|
2886
|
-
env:
|
|
3178
|
+
import { z as z15 } from "zod/v4";
|
|
3179
|
+
var localShellInputSchema = lazySchema14(
|
|
3180
|
+
() => zodSchema14(
|
|
3181
|
+
z15.object({
|
|
3182
|
+
action: z15.object({
|
|
3183
|
+
type: z15.literal("exec"),
|
|
3184
|
+
command: z15.array(z15.string()),
|
|
3185
|
+
timeoutMs: z15.number().optional(),
|
|
3186
|
+
user: z15.string().optional(),
|
|
3187
|
+
workingDirectory: z15.string().optional(),
|
|
3188
|
+
env: z15.record(z15.string(), z15.string()).optional()
|
|
2887
3189
|
})
|
|
2888
3190
|
})
|
|
2889
3191
|
)
|
|
2890
3192
|
);
|
|
2891
|
-
var localShellOutputSchema =
|
|
2892
|
-
() =>
|
|
3193
|
+
var localShellOutputSchema = lazySchema14(
|
|
3194
|
+
() => zodSchema14(z15.object({ output: z15.string() }))
|
|
2893
3195
|
);
|
|
2894
3196
|
var localShell = createProviderToolFactoryWithOutputSchema2({
|
|
2895
3197
|
id: "openai.local_shell",
|
|
@@ -2900,91 +3202,91 @@ var localShell = createProviderToolFactoryWithOutputSchema2({
|
|
|
2900
3202
|
// src/tool/shell.ts
|
|
2901
3203
|
import {
|
|
2902
3204
|
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema3,
|
|
2903
|
-
lazySchema as
|
|
2904
|
-
zodSchema as
|
|
3205
|
+
lazySchema as lazySchema15,
|
|
3206
|
+
zodSchema as zodSchema15
|
|
2905
3207
|
} from "@ai-sdk/provider-utils";
|
|
2906
|
-
import { z as
|
|
2907
|
-
var shellInputSchema =
|
|
2908
|
-
() =>
|
|
2909
|
-
|
|
2910
|
-
action:
|
|
2911
|
-
commands:
|
|
2912
|
-
timeoutMs:
|
|
2913
|
-
maxOutputLength:
|
|
3208
|
+
import { z as z16 } from "zod/v4";
|
|
3209
|
+
var shellInputSchema = lazySchema15(
|
|
3210
|
+
() => zodSchema15(
|
|
3211
|
+
z16.object({
|
|
3212
|
+
action: z16.object({
|
|
3213
|
+
commands: z16.array(z16.string()),
|
|
3214
|
+
timeoutMs: z16.number().optional(),
|
|
3215
|
+
maxOutputLength: z16.number().optional()
|
|
2914
3216
|
})
|
|
2915
3217
|
})
|
|
2916
3218
|
)
|
|
2917
3219
|
);
|
|
2918
|
-
var shellOutputSchema =
|
|
2919
|
-
() =>
|
|
2920
|
-
|
|
2921
|
-
output:
|
|
2922
|
-
|
|
2923
|
-
stdout:
|
|
2924
|
-
stderr:
|
|
2925
|
-
outcome:
|
|
2926
|
-
|
|
2927
|
-
|
|
3220
|
+
var shellOutputSchema = lazySchema15(
|
|
3221
|
+
() => zodSchema15(
|
|
3222
|
+
z16.object({
|
|
3223
|
+
output: z16.array(
|
|
3224
|
+
z16.object({
|
|
3225
|
+
stdout: z16.string(),
|
|
3226
|
+
stderr: z16.string(),
|
|
3227
|
+
outcome: z16.discriminatedUnion("type", [
|
|
3228
|
+
z16.object({ type: z16.literal("timeout") }),
|
|
3229
|
+
z16.object({ type: z16.literal("exit"), exitCode: z16.number() })
|
|
2928
3230
|
])
|
|
2929
3231
|
})
|
|
2930
3232
|
)
|
|
2931
3233
|
})
|
|
2932
3234
|
)
|
|
2933
3235
|
);
|
|
2934
|
-
var shellSkillsSchema =
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
type:
|
|
2938
|
-
skillId:
|
|
2939
|
-
version:
|
|
3236
|
+
var shellSkillsSchema = z16.array(
|
|
3237
|
+
z16.discriminatedUnion("type", [
|
|
3238
|
+
z16.object({
|
|
3239
|
+
type: z16.literal("skillReference"),
|
|
3240
|
+
skillId: z16.string(),
|
|
3241
|
+
version: z16.string().optional()
|
|
2940
3242
|
}),
|
|
2941
|
-
|
|
2942
|
-
type:
|
|
2943
|
-
name:
|
|
2944
|
-
description:
|
|
2945
|
-
source:
|
|
2946
|
-
type:
|
|
2947
|
-
mediaType:
|
|
2948
|
-
data:
|
|
3243
|
+
z16.object({
|
|
3244
|
+
type: z16.literal("inline"),
|
|
3245
|
+
name: z16.string(),
|
|
3246
|
+
description: z16.string(),
|
|
3247
|
+
source: z16.object({
|
|
3248
|
+
type: z16.literal("base64"),
|
|
3249
|
+
mediaType: z16.literal("application/zip"),
|
|
3250
|
+
data: z16.string()
|
|
2949
3251
|
})
|
|
2950
3252
|
})
|
|
2951
3253
|
])
|
|
2952
3254
|
).optional();
|
|
2953
|
-
var shellArgsSchema =
|
|
2954
|
-
() =>
|
|
2955
|
-
|
|
2956
|
-
environment:
|
|
2957
|
-
|
|
2958
|
-
type:
|
|
2959
|
-
fileIds:
|
|
2960
|
-
memoryLimit:
|
|
2961
|
-
networkPolicy:
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
type:
|
|
2965
|
-
allowedDomains:
|
|
2966
|
-
domainSecrets:
|
|
2967
|
-
|
|
2968
|
-
domain:
|
|
2969
|
-
name:
|
|
2970
|
-
value:
|
|
3255
|
+
var shellArgsSchema = lazySchema15(
|
|
3256
|
+
() => zodSchema15(
|
|
3257
|
+
z16.object({
|
|
3258
|
+
environment: z16.union([
|
|
3259
|
+
z16.object({
|
|
3260
|
+
type: z16.literal("containerAuto"),
|
|
3261
|
+
fileIds: z16.array(z16.string()).optional(),
|
|
3262
|
+
memoryLimit: z16.enum(["1g", "4g", "16g", "64g"]).optional(),
|
|
3263
|
+
networkPolicy: z16.discriminatedUnion("type", [
|
|
3264
|
+
z16.object({ type: z16.literal("disabled") }),
|
|
3265
|
+
z16.object({
|
|
3266
|
+
type: z16.literal("allowlist"),
|
|
3267
|
+
allowedDomains: z16.array(z16.string()),
|
|
3268
|
+
domainSecrets: z16.array(
|
|
3269
|
+
z16.object({
|
|
3270
|
+
domain: z16.string(),
|
|
3271
|
+
name: z16.string(),
|
|
3272
|
+
value: z16.string()
|
|
2971
3273
|
})
|
|
2972
3274
|
).optional()
|
|
2973
3275
|
})
|
|
2974
3276
|
]).optional(),
|
|
2975
3277
|
skills: shellSkillsSchema
|
|
2976
3278
|
}),
|
|
2977
|
-
|
|
2978
|
-
type:
|
|
2979
|
-
containerId:
|
|
3279
|
+
z16.object({
|
|
3280
|
+
type: z16.literal("containerReference"),
|
|
3281
|
+
containerId: z16.string()
|
|
2980
3282
|
}),
|
|
2981
|
-
|
|
2982
|
-
type:
|
|
2983
|
-
skills:
|
|
2984
|
-
|
|
2985
|
-
name:
|
|
2986
|
-
description:
|
|
2987
|
-
path:
|
|
3283
|
+
z16.object({
|
|
3284
|
+
type: z16.literal("local").optional(),
|
|
3285
|
+
skills: z16.array(
|
|
3286
|
+
z16.object({
|
|
3287
|
+
name: z16.string(),
|
|
3288
|
+
description: z16.string(),
|
|
3289
|
+
path: z16.string()
|
|
2988
3290
|
})
|
|
2989
3291
|
).optional()
|
|
2990
3292
|
})
|
|
@@ -3001,31 +3303,31 @@ var shell = createProviderToolFactoryWithOutputSchema3({
|
|
|
3001
3303
|
// src/tool/tool-search.ts
|
|
3002
3304
|
import {
|
|
3003
3305
|
createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema4,
|
|
3004
|
-
lazySchema as
|
|
3005
|
-
zodSchema as
|
|
3306
|
+
lazySchema as lazySchema16,
|
|
3307
|
+
zodSchema as zodSchema16
|
|
3006
3308
|
} from "@ai-sdk/provider-utils";
|
|
3007
|
-
import { z as
|
|
3008
|
-
var toolSearchArgsSchema =
|
|
3009
|
-
() =>
|
|
3010
|
-
|
|
3011
|
-
execution:
|
|
3012
|
-
description:
|
|
3013
|
-
parameters:
|
|
3309
|
+
import { z as z17 } from "zod/v4";
|
|
3310
|
+
var toolSearchArgsSchema = lazySchema16(
|
|
3311
|
+
() => zodSchema16(
|
|
3312
|
+
z17.object({
|
|
3313
|
+
execution: z17.enum(["server", "client"]).optional(),
|
|
3314
|
+
description: z17.string().optional(),
|
|
3315
|
+
parameters: z17.record(z17.string(), z17.unknown()).optional()
|
|
3014
3316
|
})
|
|
3015
3317
|
)
|
|
3016
3318
|
);
|
|
3017
|
-
var toolSearchInputSchema =
|
|
3018
|
-
() =>
|
|
3019
|
-
|
|
3020
|
-
arguments:
|
|
3021
|
-
call_id:
|
|
3319
|
+
var toolSearchInputSchema = lazySchema16(
|
|
3320
|
+
() => zodSchema16(
|
|
3321
|
+
z17.object({
|
|
3322
|
+
arguments: z17.unknown().optional(),
|
|
3323
|
+
call_id: z17.string().nullish()
|
|
3022
3324
|
})
|
|
3023
3325
|
)
|
|
3024
3326
|
);
|
|
3025
|
-
var toolSearchOutputSchema =
|
|
3026
|
-
() =>
|
|
3027
|
-
|
|
3028
|
-
tools:
|
|
3327
|
+
var toolSearchOutputSchema = lazySchema16(
|
|
3328
|
+
() => zodSchema16(
|
|
3329
|
+
z17.object({
|
|
3330
|
+
tools: z17.array(z17.record(z17.string(), z17.unknown()))
|
|
3029
3331
|
})
|
|
3030
3332
|
)
|
|
3031
3333
|
);
|
|
@@ -3316,6 +3618,7 @@ async function convertToOpenAIResponsesInput({
|
|
|
3316
3618
|
store,
|
|
3317
3619
|
hasConversation = false,
|
|
3318
3620
|
hasPreviousResponseId = false,
|
|
3621
|
+
configurationUpdateUnsupportedReason,
|
|
3319
3622
|
hasLocalShellTool = false,
|
|
3320
3623
|
hasShellTool = false,
|
|
3321
3624
|
hasApplyPatchTool = false,
|
|
@@ -3335,6 +3638,33 @@ async function convertToOpenAIResponsesInput({
|
|
|
3335
3638
|
for (const { role, content, providerOptions } of prompt) {
|
|
3336
3639
|
switch (role) {
|
|
3337
3640
|
case "system": {
|
|
3641
|
+
let options = await parseProviderOptions7({
|
|
3642
|
+
provider: providerOptionsName,
|
|
3643
|
+
providerOptions,
|
|
3644
|
+
schema: openaiResponsesSystemMessageOptionsSchema
|
|
3645
|
+
});
|
|
3646
|
+
if (options == null && providerOptionsName !== "openai") {
|
|
3647
|
+
options = await parseProviderOptions7({
|
|
3648
|
+
provider: "openai",
|
|
3649
|
+
providerOptions,
|
|
3650
|
+
schema: openaiResponsesSystemMessageOptionsSchema
|
|
3651
|
+
});
|
|
3652
|
+
}
|
|
3653
|
+
const effort = options == null ? void 0 : options.reasoningEffortUpdate;
|
|
3654
|
+
if (effort != null) {
|
|
3655
|
+
const unsupportedReason = content !== "" ? "Message-level reasoningEffortUpdate requires empty system message content." : configurationUpdateUnsupportedReason;
|
|
3656
|
+
if (unsupportedReason != null) {
|
|
3657
|
+
throw new UnsupportedFunctionalityError4({
|
|
3658
|
+
functionality: "Message-level reasoningEffortUpdate",
|
|
3659
|
+
message: unsupportedReason
|
|
3660
|
+
});
|
|
3661
|
+
}
|
|
3662
|
+
input.push({
|
|
3663
|
+
type: "configuration_update",
|
|
3664
|
+
reasoning: { effort }
|
|
3665
|
+
});
|
|
3666
|
+
break;
|
|
3667
|
+
}
|
|
3338
3668
|
switch (systemMessageMode) {
|
|
3339
3669
|
case "system": {
|
|
3340
3670
|
const promptCacheBreakpoint = getPromptCacheBreakpoint2(
|
|
@@ -4051,9 +4381,9 @@ ${text}`,
|
|
|
4051
4381
|
}
|
|
4052
4382
|
return { input, warnings };
|
|
4053
4383
|
}
|
|
4054
|
-
var openaiResponsesReasoningProviderOptionsSchema =
|
|
4055
|
-
itemId:
|
|
4056
|
-
reasoningEncryptedContent:
|
|
4384
|
+
var openaiResponsesReasoningProviderOptionsSchema = z18.object({
|
|
4385
|
+
itemId: z18.string().nullish(),
|
|
4386
|
+
reasoningEncryptedContent: z18.string().nullish()
|
|
4057
4387
|
});
|
|
4058
4388
|
|
|
4059
4389
|
// src/responses/map-openai-responses-finish-reason.ts
|
|
@@ -4076,77 +4406,77 @@ function mapOpenAIResponseFinishReason({
|
|
|
4076
4406
|
|
|
4077
4407
|
// src/responses/openai-responses-api.ts
|
|
4078
4408
|
import {
|
|
4079
|
-
lazySchema as
|
|
4080
|
-
zodSchema as
|
|
4409
|
+
lazySchema as lazySchema17,
|
|
4410
|
+
zodSchema as zodSchema17
|
|
4081
4411
|
} from "@ai-sdk/provider-utils";
|
|
4082
|
-
import { z as
|
|
4083
|
-
var jsonValueSchema =
|
|
4084
|
-
() =>
|
|
4085
|
-
|
|
4086
|
-
|
|
4087
|
-
|
|
4088
|
-
|
|
4089
|
-
|
|
4090
|
-
|
|
4412
|
+
import { z as z19 } from "zod/v4";
|
|
4413
|
+
var jsonValueSchema = z19.lazy(
|
|
4414
|
+
() => z19.union([
|
|
4415
|
+
z19.string(),
|
|
4416
|
+
z19.number(),
|
|
4417
|
+
z19.boolean(),
|
|
4418
|
+
z19.null(),
|
|
4419
|
+
z19.array(jsonValueSchema),
|
|
4420
|
+
z19.record(z19.string(), jsonValueSchema.optional())
|
|
4091
4421
|
])
|
|
4092
4422
|
);
|
|
4093
|
-
var jsonObjectSchema =
|
|
4094
|
-
var openaiResponsesUsageSchema =
|
|
4423
|
+
var jsonObjectSchema = z19.record(z19.string(), jsonValueSchema.optional());
|
|
4424
|
+
var openaiResponsesUsageSchema = z19.intersection(
|
|
4095
4425
|
jsonObjectSchema,
|
|
4096
|
-
|
|
4097
|
-
input_tokens:
|
|
4098
|
-
input_tokens_details:
|
|
4426
|
+
z19.object({
|
|
4427
|
+
input_tokens: z19.number(),
|
|
4428
|
+
input_tokens_details: z19.intersection(
|
|
4099
4429
|
jsonObjectSchema,
|
|
4100
|
-
|
|
4101
|
-
cached_tokens:
|
|
4102
|
-
cache_write_tokens:
|
|
4103
|
-
orchestration_input_tokens:
|
|
4104
|
-
orchestration_input_cached_tokens:
|
|
4430
|
+
z19.object({
|
|
4431
|
+
cached_tokens: z19.number().nullish(),
|
|
4432
|
+
cache_write_tokens: z19.number().nullish(),
|
|
4433
|
+
orchestration_input_tokens: z19.number().nullish(),
|
|
4434
|
+
orchestration_input_cached_tokens: z19.number().nullish()
|
|
4105
4435
|
})
|
|
4106
4436
|
).nullish(),
|
|
4107
|
-
output_tokens:
|
|
4108
|
-
output_tokens_details:
|
|
4437
|
+
output_tokens: z19.number(),
|
|
4438
|
+
output_tokens_details: z19.intersection(
|
|
4109
4439
|
jsonObjectSchema,
|
|
4110
|
-
|
|
4111
|
-
reasoning_tokens:
|
|
4112
|
-
orchestration_output_tokens:
|
|
4440
|
+
z19.object({
|
|
4441
|
+
reasoning_tokens: z19.number().nullish(),
|
|
4442
|
+
orchestration_output_tokens: z19.number().nullish()
|
|
4113
4443
|
})
|
|
4114
4444
|
).nullish(),
|
|
4115
|
-
total_tokens:
|
|
4445
|
+
total_tokens: z19.number().optional()
|
|
4116
4446
|
})
|
|
4117
4447
|
);
|
|
4118
4448
|
function isRecord(value) {
|
|
4119
4449
|
return value != null && typeof value === "object" && !Array.isArray(value);
|
|
4120
4450
|
}
|
|
4121
|
-
var openaiResponsesLocalShellCallSchema =
|
|
4122
|
-
type:
|
|
4123
|
-
id:
|
|
4124
|
-
call_id:
|
|
4125
|
-
action:
|
|
4126
|
-
type:
|
|
4127
|
-
command:
|
|
4128
|
-
timeout_ms:
|
|
4129
|
-
user:
|
|
4130
|
-
working_directory:
|
|
4131
|
-
env:
|
|
4451
|
+
var openaiResponsesLocalShellCallSchema = z19.object({
|
|
4452
|
+
type: z19.literal("local_shell_call"),
|
|
4453
|
+
id: z19.string(),
|
|
4454
|
+
call_id: z19.string(),
|
|
4455
|
+
action: z19.object({
|
|
4456
|
+
type: z19.literal("exec"),
|
|
4457
|
+
command: z19.array(z19.string()),
|
|
4458
|
+
timeout_ms: z19.number().optional(),
|
|
4459
|
+
user: z19.string().optional(),
|
|
4460
|
+
working_directory: z19.string().optional(),
|
|
4461
|
+
env: z19.record(z19.string(), z19.string()).optional()
|
|
4132
4462
|
})
|
|
4133
4463
|
});
|
|
4134
|
-
var openaiResponsesNestedErrorChunkSchema =
|
|
4135
|
-
type:
|
|
4136
|
-
sequence_number:
|
|
4137
|
-
error:
|
|
4138
|
-
type:
|
|
4139
|
-
code:
|
|
4140
|
-
message:
|
|
4141
|
-
param:
|
|
4464
|
+
var openaiResponsesNestedErrorChunkSchema = z19.object({
|
|
4465
|
+
type: z19.literal("error"),
|
|
4466
|
+
sequence_number: z19.number(),
|
|
4467
|
+
error: z19.object({
|
|
4468
|
+
type: z19.string(),
|
|
4469
|
+
code: z19.string(),
|
|
4470
|
+
message: z19.string(),
|
|
4471
|
+
param: z19.string().nullish()
|
|
4142
4472
|
})
|
|
4143
4473
|
});
|
|
4144
|
-
var openaiResponsesErrorChunkSchema =
|
|
4145
|
-
type:
|
|
4146
|
-
sequence_number:
|
|
4147
|
-
code:
|
|
4148
|
-
message:
|
|
4149
|
-
param:
|
|
4474
|
+
var openaiResponsesErrorChunkSchema = z19.object({
|
|
4475
|
+
type: z19.literal("error"),
|
|
4476
|
+
sequence_number: z19.number(),
|
|
4477
|
+
code: z19.string().nullish(),
|
|
4478
|
+
message: z19.string(),
|
|
4479
|
+
param: z19.string().nullish()
|
|
4150
4480
|
});
|
|
4151
4481
|
var openaiResponsesModeledChunkTypes = /* @__PURE__ */ new Set([
|
|
4152
4482
|
"error",
|
|
@@ -4202,1105 +4532,819 @@ function isModeledOpenAIResponsesChunk(value) {
|
|
|
4202
4532
|
}
|
|
4203
4533
|
return openaiResponsesModeledOutputItemTypes.has(value.item.type);
|
|
4204
4534
|
}
|
|
4205
|
-
var openaiResponsesChunkSchema =
|
|
4206
|
-
() =>
|
|
4207
|
-
|
|
4208
|
-
|
|
4209
|
-
type:
|
|
4210
|
-
item_id:
|
|
4211
|
-
delta:
|
|
4212
|
-
logprobs:
|
|
4213
|
-
|
|
4214
|
-
token:
|
|
4215
|
-
logprob:
|
|
4216
|
-
top_logprobs:
|
|
4217
|
-
|
|
4218
|
-
token:
|
|
4219
|
-
logprob:
|
|
4535
|
+
var openaiResponsesChunkSchema = lazySchema17(
|
|
4536
|
+
() => zodSchema17(
|
|
4537
|
+
z19.union([
|
|
4538
|
+
z19.object({
|
|
4539
|
+
type: z19.literal("response.output_text.delta"),
|
|
4540
|
+
item_id: z19.string(),
|
|
4541
|
+
delta: z19.string(),
|
|
4542
|
+
logprobs: z19.array(
|
|
4543
|
+
z19.object({
|
|
4544
|
+
token: z19.string(),
|
|
4545
|
+
logprob: z19.number(),
|
|
4546
|
+
top_logprobs: z19.array(
|
|
4547
|
+
z19.object({
|
|
4548
|
+
token: z19.string(),
|
|
4549
|
+
logprob: z19.number()
|
|
4220
4550
|
})
|
|
4221
4551
|
)
|
|
4222
4552
|
})
|
|
4223
4553
|
).nullish()
|
|
4224
4554
|
}),
|
|
4225
|
-
|
|
4226
|
-
type:
|
|
4227
|
-
response:
|
|
4228
|
-
incomplete_details:
|
|
4555
|
+
z19.object({
|
|
4556
|
+
type: z19.enum(["response.completed", "response.incomplete"]),
|
|
4557
|
+
response: z19.object({
|
|
4558
|
+
incomplete_details: z19.object({ reason: z19.string() }).nullish(),
|
|
4229
4559
|
usage: openaiResponsesUsageSchema.nullish(),
|
|
4230
|
-
reasoning:
|
|
4231
|
-
context:
|
|
4560
|
+
reasoning: z19.object({
|
|
4561
|
+
context: z19.string().nullish()
|
|
4232
4562
|
}).nullish(),
|
|
4233
|
-
service_tier:
|
|
4563
|
+
service_tier: z19.string().nullish()
|
|
4234
4564
|
})
|
|
4235
4565
|
}),
|
|
4236
|
-
|
|
4237
|
-
type:
|
|
4238
|
-
sequence_number:
|
|
4239
|
-
response:
|
|
4240
|
-
error:
|
|
4241
|
-
code:
|
|
4242
|
-
message:
|
|
4566
|
+
z19.object({
|
|
4567
|
+
type: z19.literal("response.failed"),
|
|
4568
|
+
sequence_number: z19.number(),
|
|
4569
|
+
response: z19.object({
|
|
4570
|
+
error: z19.object({
|
|
4571
|
+
code: z19.string().nullish(),
|
|
4572
|
+
message: z19.string()
|
|
4243
4573
|
}).nullish(),
|
|
4244
|
-
incomplete_details:
|
|
4574
|
+
incomplete_details: z19.object({ reason: z19.string() }).nullish(),
|
|
4245
4575
|
usage: openaiResponsesUsageSchema.nullish(),
|
|
4246
|
-
reasoning:
|
|
4247
|
-
context:
|
|
4576
|
+
reasoning: z19.object({
|
|
4577
|
+
context: z19.string().nullish()
|
|
4248
4578
|
}).nullish(),
|
|
4249
|
-
service_tier:
|
|
4579
|
+
service_tier: z19.string().nullish()
|
|
4250
4580
|
})
|
|
4251
4581
|
}),
|
|
4252
|
-
|
|
4253
|
-
type:
|
|
4254
|
-
response:
|
|
4255
|
-
id:
|
|
4256
|
-
created_at:
|
|
4257
|
-
model:
|
|
4258
|
-
service_tier:
|
|
4582
|
+
z19.object({
|
|
4583
|
+
type: z19.literal("response.created"),
|
|
4584
|
+
response: z19.object({
|
|
4585
|
+
id: z19.string(),
|
|
4586
|
+
created_at: z19.number(),
|
|
4587
|
+
model: z19.string(),
|
|
4588
|
+
service_tier: z19.string().nullish()
|
|
4259
4589
|
})
|
|
4260
4590
|
}),
|
|
4261
|
-
|
|
4262
|
-
type:
|
|
4263
|
-
output_index:
|
|
4264
|
-
item:
|
|
4265
|
-
|
|
4266
|
-
type:
|
|
4267
|
-
id:
|
|
4268
|
-
phase:
|
|
4591
|
+
z19.object({
|
|
4592
|
+
type: z19.literal("response.output_item.added"),
|
|
4593
|
+
output_index: z19.number(),
|
|
4594
|
+
item: z19.discriminatedUnion("type", [
|
|
4595
|
+
z19.object({
|
|
4596
|
+
type: z19.literal("message"),
|
|
4597
|
+
id: z19.string(),
|
|
4598
|
+
phase: z19.enum(["commentary", "final_answer"]).nullish()
|
|
4269
4599
|
}),
|
|
4270
|
-
|
|
4271
|
-
type:
|
|
4272
|
-
id:
|
|
4273
|
-
encrypted_content:
|
|
4600
|
+
z19.object({
|
|
4601
|
+
type: z19.literal("reasoning"),
|
|
4602
|
+
id: z19.string(),
|
|
4603
|
+
encrypted_content: z19.string().nullish()
|
|
4274
4604
|
}),
|
|
4275
|
-
|
|
4276
|
-
type:
|
|
4277
|
-
id:
|
|
4278
|
-
call_id:
|
|
4279
|
-
name:
|
|
4280
|
-
arguments:
|
|
4281
|
-
async:
|
|
4282
|
-
namespace:
|
|
4605
|
+
z19.object({
|
|
4606
|
+
type: z19.literal("function_call"),
|
|
4607
|
+
id: z19.string(),
|
|
4608
|
+
call_id: z19.string(),
|
|
4609
|
+
name: z19.string(),
|
|
4610
|
+
arguments: z19.string(),
|
|
4611
|
+
async: z19.boolean().nullish(),
|
|
4612
|
+
namespace: z19.string().nullish()
|
|
4283
4613
|
}),
|
|
4284
|
-
|
|
4285
|
-
type:
|
|
4286
|
-
id:
|
|
4287
|
-
status:
|
|
4614
|
+
z19.object({
|
|
4615
|
+
type: z19.literal("web_search_call"),
|
|
4616
|
+
id: z19.string(),
|
|
4617
|
+
status: z19.string()
|
|
4288
4618
|
}),
|
|
4289
|
-
|
|
4290
|
-
type:
|
|
4291
|
-
id:
|
|
4292
|
-
status:
|
|
4619
|
+
z19.object({
|
|
4620
|
+
type: z19.literal("computer_call"),
|
|
4621
|
+
id: z19.string(),
|
|
4622
|
+
status: z19.string()
|
|
4293
4623
|
}),
|
|
4294
|
-
|
|
4295
|
-
type:
|
|
4296
|
-
id:
|
|
4624
|
+
z19.object({
|
|
4625
|
+
type: z19.literal("file_search_call"),
|
|
4626
|
+
id: z19.string()
|
|
4297
4627
|
}),
|
|
4298
4628
|
openaiResponsesLocalShellCallSchema,
|
|
4299
|
-
|
|
4300
|
-
type:
|
|
4301
|
-
id:
|
|
4629
|
+
z19.object({
|
|
4630
|
+
type: z19.literal("image_generation_call"),
|
|
4631
|
+
id: z19.string()
|
|
4302
4632
|
}),
|
|
4303
|
-
|
|
4304
|
-
type:
|
|
4305
|
-
id:
|
|
4306
|
-
container_id:
|
|
4307
|
-
code:
|
|
4308
|
-
outputs:
|
|
4309
|
-
|
|
4310
|
-
|
|
4311
|
-
|
|
4633
|
+
z19.object({
|
|
4634
|
+
type: z19.literal("code_interpreter_call"),
|
|
4635
|
+
id: z19.string(),
|
|
4636
|
+
container_id: z19.string(),
|
|
4637
|
+
code: z19.string().nullable(),
|
|
4638
|
+
outputs: z19.array(
|
|
4639
|
+
z19.discriminatedUnion("type", [
|
|
4640
|
+
z19.object({ type: z19.literal("logs"), logs: z19.string() }),
|
|
4641
|
+
z19.object({ type: z19.literal("image"), url: z19.string() })
|
|
4312
4642
|
])
|
|
4313
4643
|
).nullable(),
|
|
4314
|
-
status:
|
|
4644
|
+
status: z19.string()
|
|
4315
4645
|
}),
|
|
4316
|
-
|
|
4317
|
-
type:
|
|
4318
|
-
id:
|
|
4319
|
-
status:
|
|
4320
|
-
approval_request_id:
|
|
4646
|
+
z19.object({
|
|
4647
|
+
type: z19.literal("mcp_call"),
|
|
4648
|
+
id: z19.string(),
|
|
4649
|
+
status: z19.string(),
|
|
4650
|
+
approval_request_id: z19.string().nullish()
|
|
4321
4651
|
}),
|
|
4322
|
-
|
|
4323
|
-
type:
|
|
4324
|
-
id:
|
|
4652
|
+
z19.object({
|
|
4653
|
+
type: z19.literal("mcp_list_tools"),
|
|
4654
|
+
id: z19.string()
|
|
4325
4655
|
}),
|
|
4326
|
-
|
|
4327
|
-
type:
|
|
4328
|
-
id:
|
|
4656
|
+
z19.object({
|
|
4657
|
+
type: z19.literal("mcp_approval_request"),
|
|
4658
|
+
id: z19.string()
|
|
4329
4659
|
}),
|
|
4330
|
-
|
|
4331
|
-
type:
|
|
4332
|
-
id:
|
|
4333
|
-
call_id:
|
|
4334
|
-
status:
|
|
4335
|
-
operation:
|
|
4336
|
-
|
|
4337
|
-
type:
|
|
4338
|
-
path:
|
|
4339
|
-
diff:
|
|
4660
|
+
z19.object({
|
|
4661
|
+
type: z19.literal("apply_patch_call"),
|
|
4662
|
+
id: z19.string(),
|
|
4663
|
+
call_id: z19.string(),
|
|
4664
|
+
status: z19.enum(["in_progress", "completed"]),
|
|
4665
|
+
operation: z19.discriminatedUnion("type", [
|
|
4666
|
+
z19.object({
|
|
4667
|
+
type: z19.literal("create_file"),
|
|
4668
|
+
path: z19.string(),
|
|
4669
|
+
diff: z19.string()
|
|
4340
4670
|
}),
|
|
4341
|
-
|
|
4342
|
-
type:
|
|
4343
|
-
path:
|
|
4671
|
+
z19.object({
|
|
4672
|
+
type: z19.literal("delete_file"),
|
|
4673
|
+
path: z19.string()
|
|
4344
4674
|
}),
|
|
4345
|
-
|
|
4346
|
-
type:
|
|
4347
|
-
path:
|
|
4348
|
-
diff:
|
|
4675
|
+
z19.object({
|
|
4676
|
+
type: z19.literal("update_file"),
|
|
4677
|
+
path: z19.string(),
|
|
4678
|
+
diff: z19.string()
|
|
4349
4679
|
})
|
|
4350
4680
|
])
|
|
4351
4681
|
}),
|
|
4352
|
-
|
|
4353
|
-
type:
|
|
4354
|
-
id:
|
|
4355
|
-
call_id:
|
|
4356
|
-
name:
|
|
4357
|
-
input:
|
|
4358
|
-
async:
|
|
4682
|
+
z19.object({
|
|
4683
|
+
type: z19.literal("custom_tool_call"),
|
|
4684
|
+
id: z19.string(),
|
|
4685
|
+
call_id: z19.string(),
|
|
4686
|
+
name: z19.string(),
|
|
4687
|
+
input: z19.string(),
|
|
4688
|
+
async: z19.boolean().nullish()
|
|
4359
4689
|
}),
|
|
4360
|
-
|
|
4361
|
-
type:
|
|
4362
|
-
id:
|
|
4363
|
-
call_id:
|
|
4364
|
-
status:
|
|
4365
|
-
action:
|
|
4366
|
-
commands:
|
|
4690
|
+
z19.object({
|
|
4691
|
+
type: z19.literal("shell_call"),
|
|
4692
|
+
id: z19.string(),
|
|
4693
|
+
call_id: z19.string(),
|
|
4694
|
+
status: z19.enum(["in_progress", "completed", "incomplete"]),
|
|
4695
|
+
action: z19.object({
|
|
4696
|
+
commands: z19.array(z19.string())
|
|
4367
4697
|
})
|
|
4368
4698
|
}),
|
|
4369
|
-
|
|
4370
|
-
type:
|
|
4371
|
-
id:
|
|
4372
|
-
call_id:
|
|
4373
|
-
status:
|
|
4374
|
-
output:
|
|
4375
|
-
|
|
4376
|
-
stdout:
|
|
4377
|
-
stderr:
|
|
4378
|
-
outcome:
|
|
4379
|
-
|
|
4380
|
-
|
|
4381
|
-
type:
|
|
4382
|
-
exit_code:
|
|
4699
|
+
z19.object({
|
|
4700
|
+
type: z19.literal("shell_call_output"),
|
|
4701
|
+
id: z19.string(),
|
|
4702
|
+
call_id: z19.string(),
|
|
4703
|
+
status: z19.enum(["in_progress", "completed", "incomplete"]),
|
|
4704
|
+
output: z19.array(
|
|
4705
|
+
z19.object({
|
|
4706
|
+
stdout: z19.string(),
|
|
4707
|
+
stderr: z19.string(),
|
|
4708
|
+
outcome: z19.discriminatedUnion("type", [
|
|
4709
|
+
z19.object({ type: z19.literal("timeout") }),
|
|
4710
|
+
z19.object({
|
|
4711
|
+
type: z19.literal("exit"),
|
|
4712
|
+
exit_code: z19.number()
|
|
4383
4713
|
})
|
|
4384
4714
|
])
|
|
4385
4715
|
})
|
|
4386
4716
|
)
|
|
4387
4717
|
}),
|
|
4388
|
-
|
|
4389
|
-
type:
|
|
4390
|
-
id:
|
|
4391
|
-
execution:
|
|
4392
|
-
call_id:
|
|
4393
|
-
status:
|
|
4394
|
-
arguments:
|
|
4718
|
+
z19.object({
|
|
4719
|
+
type: z19.literal("tool_search_call"),
|
|
4720
|
+
id: z19.string(),
|
|
4721
|
+
execution: z19.enum(["server", "client"]),
|
|
4722
|
+
call_id: z19.string().nullable(),
|
|
4723
|
+
status: z19.enum(["in_progress", "completed", "incomplete"]),
|
|
4724
|
+
arguments: z19.unknown()
|
|
4395
4725
|
}),
|
|
4396
|
-
|
|
4397
|
-
type:
|
|
4398
|
-
id:
|
|
4399
|
-
execution:
|
|
4400
|
-
call_id:
|
|
4401
|
-
status:
|
|
4402
|
-
tools:
|
|
4726
|
+
z19.object({
|
|
4727
|
+
type: z19.literal("tool_search_output"),
|
|
4728
|
+
id: z19.string(),
|
|
4729
|
+
execution: z19.enum(["server", "client"]),
|
|
4730
|
+
call_id: z19.string().nullable(),
|
|
4731
|
+
status: z19.enum(["in_progress", "completed", "incomplete"]),
|
|
4732
|
+
tools: z19.array(z19.record(z19.string(), jsonValueSchema.optional()))
|
|
4403
4733
|
})
|
|
4404
4734
|
])
|
|
4405
4735
|
}),
|
|
4406
|
-
|
|
4407
|
-
type:
|
|
4408
|
-
output_index:
|
|
4409
|
-
item:
|
|
4410
|
-
|
|
4411
|
-
type:
|
|
4412
|
-
id:
|
|
4413
|
-
phase:
|
|
4736
|
+
z19.object({
|
|
4737
|
+
type: z19.literal("response.output_item.done"),
|
|
4738
|
+
output_index: z19.number(),
|
|
4739
|
+
item: z19.discriminatedUnion("type", [
|
|
4740
|
+
z19.object({
|
|
4741
|
+
type: z19.literal("message"),
|
|
4742
|
+
id: z19.string(),
|
|
4743
|
+
phase: z19.enum(["commentary", "final_answer"]).nullish()
|
|
4414
4744
|
}),
|
|
4415
|
-
|
|
4416
|
-
type:
|
|
4417
|
-
id:
|
|
4418
|
-
encrypted_content:
|
|
4745
|
+
z19.object({
|
|
4746
|
+
type: z19.literal("reasoning"),
|
|
4747
|
+
id: z19.string(),
|
|
4748
|
+
encrypted_content: z19.string().nullish()
|
|
4419
4749
|
}),
|
|
4420
|
-
|
|
4421
|
-
type:
|
|
4422
|
-
id:
|
|
4423
|
-
call_id:
|
|
4424
|
-
name:
|
|
4425
|
-
arguments:
|
|
4426
|
-
async:
|
|
4427
|
-
status:
|
|
4428
|
-
namespace:
|
|
4750
|
+
z19.object({
|
|
4751
|
+
type: z19.literal("function_call"),
|
|
4752
|
+
id: z19.string(),
|
|
4753
|
+
call_id: z19.string(),
|
|
4754
|
+
name: z19.string(),
|
|
4755
|
+
arguments: z19.string(),
|
|
4756
|
+
async: z19.boolean().nullish(),
|
|
4757
|
+
status: z19.enum(["in_progress", "completed", "incomplete"]),
|
|
4758
|
+
namespace: z19.string().nullish()
|
|
4429
4759
|
}),
|
|
4430
|
-
|
|
4431
|
-
type:
|
|
4432
|
-
id:
|
|
4433
|
-
call_id:
|
|
4434
|
-
name:
|
|
4435
|
-
input:
|
|
4436
|
-
async:
|
|
4437
|
-
status:
|
|
4760
|
+
z19.object({
|
|
4761
|
+
type: z19.literal("custom_tool_call"),
|
|
4762
|
+
id: z19.string(),
|
|
4763
|
+
call_id: z19.string(),
|
|
4764
|
+
name: z19.string(),
|
|
4765
|
+
input: z19.string(),
|
|
4766
|
+
async: z19.boolean().nullish(),
|
|
4767
|
+
status: z19.enum(["in_progress", "completed", "incomplete"])
|
|
4438
4768
|
}),
|
|
4439
|
-
|
|
4440
|
-
type:
|
|
4441
|
-
id:
|
|
4442
|
-
code:
|
|
4443
|
-
container_id:
|
|
4444
|
-
outputs:
|
|
4445
|
-
|
|
4446
|
-
|
|
4447
|
-
|
|
4769
|
+
z19.object({
|
|
4770
|
+
type: z19.literal("code_interpreter_call"),
|
|
4771
|
+
id: z19.string(),
|
|
4772
|
+
code: z19.string().nullable(),
|
|
4773
|
+
container_id: z19.string(),
|
|
4774
|
+
outputs: z19.array(
|
|
4775
|
+
z19.discriminatedUnion("type", [
|
|
4776
|
+
z19.object({ type: z19.literal("logs"), logs: z19.string() }),
|
|
4777
|
+
z19.object({ type: z19.literal("image"), url: z19.string() })
|
|
4448
4778
|
])
|
|
4449
4779
|
).nullable()
|
|
4450
4780
|
}),
|
|
4451
|
-
|
|
4452
|
-
type:
|
|
4453
|
-
id:
|
|
4454
|
-
result:
|
|
4781
|
+
z19.object({
|
|
4782
|
+
type: z19.literal("image_generation_call"),
|
|
4783
|
+
id: z19.string(),
|
|
4784
|
+
result: z19.string()
|
|
4455
4785
|
}),
|
|
4456
|
-
|
|
4457
|
-
type:
|
|
4458
|
-
id:
|
|
4459
|
-
status:
|
|
4460
|
-
action:
|
|
4461
|
-
|
|
4462
|
-
type:
|
|
4463
|
-
query:
|
|
4464
|
-
queries:
|
|
4465
|
-
sources:
|
|
4466
|
-
|
|
4467
|
-
|
|
4468
|
-
|
|
4786
|
+
z19.object({
|
|
4787
|
+
type: z19.literal("web_search_call"),
|
|
4788
|
+
id: z19.string(),
|
|
4789
|
+
status: z19.string(),
|
|
4790
|
+
action: z19.discriminatedUnion("type", [
|
|
4791
|
+
z19.object({
|
|
4792
|
+
type: z19.literal("search"),
|
|
4793
|
+
query: z19.string().nullish(),
|
|
4794
|
+
queries: z19.array(z19.string()).nullish(),
|
|
4795
|
+
sources: z19.array(
|
|
4796
|
+
z19.discriminatedUnion("type", [
|
|
4797
|
+
z19.object({ type: z19.literal("url"), url: z19.string() }),
|
|
4798
|
+
z19.object({ type: z19.literal("api"), name: z19.string() })
|
|
4469
4799
|
])
|
|
4470
4800
|
).nullish()
|
|
4471
4801
|
}),
|
|
4472
|
-
|
|
4473
|
-
type:
|
|
4474
|
-
url:
|
|
4802
|
+
z19.object({
|
|
4803
|
+
type: z19.literal("open_page"),
|
|
4804
|
+
url: z19.string().nullish()
|
|
4475
4805
|
}),
|
|
4476
|
-
|
|
4477
|
-
type:
|
|
4478
|
-
url:
|
|
4479
|
-
pattern:
|
|
4806
|
+
z19.object({
|
|
4807
|
+
type: z19.literal("find_in_page"),
|
|
4808
|
+
url: z19.string().nullish(),
|
|
4809
|
+
pattern: z19.string().nullish()
|
|
4480
4810
|
})
|
|
4481
4811
|
]).nullish()
|
|
4482
4812
|
}),
|
|
4483
|
-
|
|
4484
|
-
type:
|
|
4485
|
-
id:
|
|
4486
|
-
queries:
|
|
4487
|
-
results:
|
|
4488
|
-
|
|
4489
|
-
attributes:
|
|
4490
|
-
|
|
4491
|
-
|
|
4813
|
+
z19.object({
|
|
4814
|
+
type: z19.literal("file_search_call"),
|
|
4815
|
+
id: z19.string(),
|
|
4816
|
+
queries: z19.array(z19.string()),
|
|
4817
|
+
results: z19.array(
|
|
4818
|
+
z19.object({
|
|
4819
|
+
attributes: z19.record(
|
|
4820
|
+
z19.string(),
|
|
4821
|
+
z19.union([z19.string(), z19.number(), z19.boolean()])
|
|
4492
4822
|
),
|
|
4493
|
-
file_id:
|
|
4494
|
-
filename:
|
|
4495
|
-
score:
|
|
4496
|
-
text:
|
|
4823
|
+
file_id: z19.string(),
|
|
4824
|
+
filename: z19.string(),
|
|
4825
|
+
score: z19.number(),
|
|
4826
|
+
text: z19.string()
|
|
4497
4827
|
})
|
|
4498
4828
|
).nullish()
|
|
4499
4829
|
}),
|
|
4500
4830
|
openaiResponsesLocalShellCallSchema,
|
|
4501
|
-
|
|
4502
|
-
type:
|
|
4503
|
-
id:
|
|
4504
|
-
status:
|
|
4831
|
+
z19.object({
|
|
4832
|
+
type: z19.literal("computer_call"),
|
|
4833
|
+
id: z19.string(),
|
|
4834
|
+
status: z19.literal("completed")
|
|
4505
4835
|
}),
|
|
4506
|
-
|
|
4507
|
-
type:
|
|
4508
|
-
id:
|
|
4509
|
-
status:
|
|
4510
|
-
arguments:
|
|
4511
|
-
name:
|
|
4512
|
-
server_label:
|
|
4513
|
-
output:
|
|
4514
|
-
error:
|
|
4515
|
-
|
|
4516
|
-
|
|
4517
|
-
type:
|
|
4518
|
-
code:
|
|
4519
|
-
message:
|
|
4836
|
+
z19.object({
|
|
4837
|
+
type: z19.literal("mcp_call"),
|
|
4838
|
+
id: z19.string(),
|
|
4839
|
+
status: z19.string(),
|
|
4840
|
+
arguments: z19.string(),
|
|
4841
|
+
name: z19.string(),
|
|
4842
|
+
server_label: z19.string(),
|
|
4843
|
+
output: z19.string().nullish(),
|
|
4844
|
+
error: z19.union([
|
|
4845
|
+
z19.string(),
|
|
4846
|
+
z19.object({
|
|
4847
|
+
type: z19.string().optional(),
|
|
4848
|
+
code: z19.union([z19.number(), z19.string()]).optional(),
|
|
4849
|
+
message: z19.string().optional()
|
|
4520
4850
|
}).loose()
|
|
4521
4851
|
]).nullish(),
|
|
4522
|
-
approval_request_id:
|
|
4852
|
+
approval_request_id: z19.string().nullish()
|
|
4523
4853
|
}),
|
|
4524
|
-
|
|
4525
|
-
type:
|
|
4526
|
-
id:
|
|
4527
|
-
server_label:
|
|
4528
|
-
tools:
|
|
4529
|
-
|
|
4530
|
-
name:
|
|
4531
|
-
description:
|
|
4532
|
-
input_schema:
|
|
4533
|
-
annotations:
|
|
4854
|
+
z19.object({
|
|
4855
|
+
type: z19.literal("mcp_list_tools"),
|
|
4856
|
+
id: z19.string(),
|
|
4857
|
+
server_label: z19.string(),
|
|
4858
|
+
tools: z19.array(
|
|
4859
|
+
z19.object({
|
|
4860
|
+
name: z19.string(),
|
|
4861
|
+
description: z19.string().optional(),
|
|
4862
|
+
input_schema: z19.any(),
|
|
4863
|
+
annotations: z19.record(z19.string(), z19.unknown()).optional()
|
|
4534
4864
|
})
|
|
4535
4865
|
),
|
|
4536
|
-
error:
|
|
4537
|
-
|
|
4538
|
-
|
|
4539
|
-
type:
|
|
4540
|
-
code:
|
|
4541
|
-
message:
|
|
4866
|
+
error: z19.union([
|
|
4867
|
+
z19.string(),
|
|
4868
|
+
z19.object({
|
|
4869
|
+
type: z19.string().optional(),
|
|
4870
|
+
code: z19.union([z19.number(), z19.string()]).optional(),
|
|
4871
|
+
message: z19.string().optional()
|
|
4542
4872
|
}).loose()
|
|
4543
4873
|
]).optional()
|
|
4544
4874
|
}),
|
|
4545
|
-
|
|
4546
|
-
type:
|
|
4547
|
-
id:
|
|
4548
|
-
server_label:
|
|
4549
|
-
name:
|
|
4550
|
-
arguments:
|
|
4551
|
-
approval_request_id:
|
|
4875
|
+
z19.object({
|
|
4876
|
+
type: z19.literal("mcp_approval_request"),
|
|
4877
|
+
id: z19.string(),
|
|
4878
|
+
server_label: z19.string(),
|
|
4879
|
+
name: z19.string(),
|
|
4880
|
+
arguments: z19.string(),
|
|
4881
|
+
approval_request_id: z19.string().optional()
|
|
4552
4882
|
}),
|
|
4553
|
-
|
|
4554
|
-
type:
|
|
4555
|
-
id:
|
|
4556
|
-
call_id:
|
|
4557
|
-
status:
|
|
4558
|
-
operation:
|
|
4559
|
-
|
|
4560
|
-
type:
|
|
4561
|
-
path:
|
|
4562
|
-
diff:
|
|
4883
|
+
z19.object({
|
|
4884
|
+
type: z19.literal("apply_patch_call"),
|
|
4885
|
+
id: z19.string(),
|
|
4886
|
+
call_id: z19.string(),
|
|
4887
|
+
status: z19.enum(["in_progress", "completed"]),
|
|
4888
|
+
operation: z19.discriminatedUnion("type", [
|
|
4889
|
+
z19.object({
|
|
4890
|
+
type: z19.literal("create_file"),
|
|
4891
|
+
path: z19.string(),
|
|
4892
|
+
diff: z19.string()
|
|
4563
4893
|
}),
|
|
4564
|
-
|
|
4565
|
-
type:
|
|
4566
|
-
path:
|
|
4894
|
+
z19.object({
|
|
4895
|
+
type: z19.literal("delete_file"),
|
|
4896
|
+
path: z19.string()
|
|
4567
4897
|
}),
|
|
4568
|
-
|
|
4569
|
-
type:
|
|
4570
|
-
path:
|
|
4571
|
-
diff:
|
|
4898
|
+
z19.object({
|
|
4899
|
+
type: z19.literal("update_file"),
|
|
4900
|
+
path: z19.string(),
|
|
4901
|
+
diff: z19.string()
|
|
4572
4902
|
})
|
|
4573
4903
|
])
|
|
4574
4904
|
}),
|
|
4575
|
-
|
|
4576
|
-
type:
|
|
4577
|
-
id:
|
|
4578
|
-
call_id:
|
|
4579
|
-
status:
|
|
4580
|
-
action:
|
|
4581
|
-
commands:
|
|
4905
|
+
z19.object({
|
|
4906
|
+
type: z19.literal("shell_call"),
|
|
4907
|
+
id: z19.string(),
|
|
4908
|
+
call_id: z19.string(),
|
|
4909
|
+
status: z19.enum(["in_progress", "completed", "incomplete"]),
|
|
4910
|
+
action: z19.object({
|
|
4911
|
+
commands: z19.array(z19.string())
|
|
4582
4912
|
})
|
|
4583
4913
|
}),
|
|
4584
|
-
|
|
4585
|
-
type:
|
|
4586
|
-
id:
|
|
4587
|
-
call_id:
|
|
4588
|
-
status:
|
|
4589
|
-
output:
|
|
4590
|
-
|
|
4591
|
-
stdout:
|
|
4592
|
-
stderr:
|
|
4593
|
-
outcome:
|
|
4594
|
-
|
|
4595
|
-
|
|
4596
|
-
type:
|
|
4597
|
-
exit_code:
|
|
4914
|
+
z19.object({
|
|
4915
|
+
type: z19.literal("shell_call_output"),
|
|
4916
|
+
id: z19.string(),
|
|
4917
|
+
call_id: z19.string(),
|
|
4918
|
+
status: z19.enum(["in_progress", "completed", "incomplete"]),
|
|
4919
|
+
output: z19.array(
|
|
4920
|
+
z19.object({
|
|
4921
|
+
stdout: z19.string(),
|
|
4922
|
+
stderr: z19.string(),
|
|
4923
|
+
outcome: z19.discriminatedUnion("type", [
|
|
4924
|
+
z19.object({ type: z19.literal("timeout") }),
|
|
4925
|
+
z19.object({
|
|
4926
|
+
type: z19.literal("exit"),
|
|
4927
|
+
exit_code: z19.number()
|
|
4598
4928
|
})
|
|
4599
4929
|
])
|
|
4600
4930
|
})
|
|
4601
4931
|
)
|
|
4602
4932
|
}),
|
|
4603
|
-
|
|
4604
|
-
type:
|
|
4605
|
-
id:
|
|
4606
|
-
execution:
|
|
4607
|
-
call_id:
|
|
4608
|
-
status:
|
|
4609
|
-
arguments:
|
|
4933
|
+
z19.object({
|
|
4934
|
+
type: z19.literal("tool_search_call"),
|
|
4935
|
+
id: z19.string(),
|
|
4936
|
+
execution: z19.enum(["server", "client"]),
|
|
4937
|
+
call_id: z19.string().nullable(),
|
|
4938
|
+
status: z19.enum(["in_progress", "completed", "incomplete"]),
|
|
4939
|
+
arguments: z19.unknown()
|
|
4610
4940
|
}),
|
|
4611
|
-
|
|
4612
|
-
type:
|
|
4613
|
-
id:
|
|
4614
|
-
execution:
|
|
4615
|
-
call_id:
|
|
4616
|
-
status:
|
|
4617
|
-
tools:
|
|
4941
|
+
z19.object({
|
|
4942
|
+
type: z19.literal("tool_search_output"),
|
|
4943
|
+
id: z19.string(),
|
|
4944
|
+
execution: z19.enum(["server", "client"]),
|
|
4945
|
+
call_id: z19.string().nullable(),
|
|
4946
|
+
status: z19.enum(["in_progress", "completed", "incomplete"]),
|
|
4947
|
+
tools: z19.array(z19.record(z19.string(), jsonValueSchema.optional()))
|
|
4618
4948
|
})
|
|
4619
4949
|
])
|
|
4620
4950
|
}),
|
|
4621
|
-
|
|
4622
|
-
type:
|
|
4623
|
-
item_id:
|
|
4624
|
-
output_index:
|
|
4625
|
-
delta:
|
|
4951
|
+
z19.object({
|
|
4952
|
+
type: z19.literal("response.function_call_arguments.delta"),
|
|
4953
|
+
item_id: z19.string(),
|
|
4954
|
+
output_index: z19.number(),
|
|
4955
|
+
delta: z19.string()
|
|
4626
4956
|
}),
|
|
4627
|
-
|
|
4957
|
+
z19.object({
|
|
4628
4958
|
// `name` is documented as required but omitted from live API events:
|
|
4629
4959
|
// https://github.com/openai/openai-openapi/issues/545
|
|
4630
|
-
type:
|
|
4631
|
-
item_id:
|
|
4632
|
-
output_index:
|
|
4633
|
-
arguments:
|
|
4960
|
+
type: z19.literal("response.function_call_arguments.done"),
|
|
4961
|
+
item_id: z19.string(),
|
|
4962
|
+
output_index: z19.number(),
|
|
4963
|
+
arguments: z19.string()
|
|
4634
4964
|
}),
|
|
4635
|
-
|
|
4636
|
-
type:
|
|
4637
|
-
item_id:
|
|
4638
|
-
output_index:
|
|
4639
|
-
delta:
|
|
4965
|
+
z19.object({
|
|
4966
|
+
type: z19.literal("response.custom_tool_call_input.delta"),
|
|
4967
|
+
item_id: z19.string(),
|
|
4968
|
+
output_index: z19.number(),
|
|
4969
|
+
delta: z19.string()
|
|
4640
4970
|
}),
|
|
4641
|
-
|
|
4642
|
-
type:
|
|
4643
|
-
item_id:
|
|
4644
|
-
output_index:
|
|
4645
|
-
partial_image_b64:
|
|
4971
|
+
z19.object({
|
|
4972
|
+
type: z19.literal("response.image_generation_call.partial_image"),
|
|
4973
|
+
item_id: z19.string(),
|
|
4974
|
+
output_index: z19.number(),
|
|
4975
|
+
partial_image_b64: z19.string()
|
|
4646
4976
|
}),
|
|
4647
|
-
|
|
4648
|
-
type:
|
|
4649
|
-
item_id:
|
|
4650
|
-
output_index:
|
|
4651
|
-
delta:
|
|
4977
|
+
z19.object({
|
|
4978
|
+
type: z19.literal("response.code_interpreter_call_code.delta"),
|
|
4979
|
+
item_id: z19.string(),
|
|
4980
|
+
output_index: z19.number(),
|
|
4981
|
+
delta: z19.string()
|
|
4652
4982
|
}),
|
|
4653
|
-
|
|
4654
|
-
type:
|
|
4655
|
-
item_id:
|
|
4656
|
-
output_index:
|
|
4657
|
-
code:
|
|
4983
|
+
z19.object({
|
|
4984
|
+
type: z19.literal("response.code_interpreter_call_code.done"),
|
|
4985
|
+
item_id: z19.string(),
|
|
4986
|
+
output_index: z19.number(),
|
|
4987
|
+
code: z19.string()
|
|
4658
4988
|
}),
|
|
4659
|
-
|
|
4660
|
-
type:
|
|
4661
|
-
annotation:
|
|
4662
|
-
|
|
4663
|
-
type:
|
|
4664
|
-
start_index:
|
|
4665
|
-
end_index:
|
|
4666
|
-
url:
|
|
4667
|
-
title:
|
|
4989
|
+
z19.object({
|
|
4990
|
+
type: z19.literal("response.output_text.annotation.added"),
|
|
4991
|
+
annotation: z19.discriminatedUnion("type", [
|
|
4992
|
+
z19.object({
|
|
4993
|
+
type: z19.literal("url_citation"),
|
|
4994
|
+
start_index: z19.number(),
|
|
4995
|
+
end_index: z19.number(),
|
|
4996
|
+
url: z19.string(),
|
|
4997
|
+
title: z19.string()
|
|
4668
4998
|
}),
|
|
4669
|
-
|
|
4670
|
-
type:
|
|
4671
|
-
file_id:
|
|
4672
|
-
filename:
|
|
4673
|
-
index:
|
|
4999
|
+
z19.object({
|
|
5000
|
+
type: z19.literal("file_citation"),
|
|
5001
|
+
file_id: z19.string(),
|
|
5002
|
+
filename: z19.string(),
|
|
5003
|
+
index: z19.number()
|
|
4674
5004
|
}),
|
|
4675
|
-
|
|
4676
|
-
type:
|
|
4677
|
-
container_id:
|
|
4678
|
-
file_id:
|
|
4679
|
-
filename:
|
|
4680
|
-
start_index:
|
|
4681
|
-
end_index:
|
|
5005
|
+
z19.object({
|
|
5006
|
+
type: z19.literal("container_file_citation"),
|
|
5007
|
+
container_id: z19.string(),
|
|
5008
|
+
file_id: z19.string(),
|
|
5009
|
+
filename: z19.string(),
|
|
5010
|
+
start_index: z19.number(),
|
|
5011
|
+
end_index: z19.number()
|
|
4682
5012
|
}),
|
|
4683
|
-
|
|
4684
|
-
type:
|
|
4685
|
-
file_id:
|
|
4686
|
-
index:
|
|
5013
|
+
z19.object({
|
|
5014
|
+
type: z19.literal("file_path"),
|
|
5015
|
+
file_id: z19.string(),
|
|
5016
|
+
index: z19.number()
|
|
4687
5017
|
})
|
|
4688
5018
|
])
|
|
4689
5019
|
}),
|
|
4690
|
-
|
|
4691
|
-
type:
|
|
4692
|
-
item_id:
|
|
4693
|
-
summary_index:
|
|
4694
|
-
}),
|
|
4695
|
-
z18.object({
|
|
4696
|
-
type: z18.literal("response.reasoning_summary_text.delta"),
|
|
4697
|
-
item_id: z18.string(),
|
|
4698
|
-
summary_index: z18.number(),
|
|
4699
|
-
delta: z18.string()
|
|
4700
|
-
}),
|
|
4701
|
-
z18.object({
|
|
4702
|
-
type: z18.literal("response.reasoning_summary_part.done"),
|
|
4703
|
-
item_id: z18.string(),
|
|
4704
|
-
summary_index: z18.number()
|
|
4705
|
-
}),
|
|
4706
|
-
z18.object({
|
|
4707
|
-
type: z18.literal("response.apply_patch_call_operation_diff.delta"),
|
|
4708
|
-
item_id: z18.string(),
|
|
4709
|
-
output_index: z18.number(),
|
|
4710
|
-
delta: z18.string(),
|
|
4711
|
-
obfuscation: z18.string().nullish()
|
|
5020
|
+
z19.object({
|
|
5021
|
+
type: z19.literal("response.reasoning_summary_part.added"),
|
|
5022
|
+
item_id: z19.string(),
|
|
5023
|
+
summary_index: z19.number()
|
|
4712
5024
|
}),
|
|
4713
|
-
|
|
4714
|
-
type:
|
|
4715
|
-
item_id:
|
|
4716
|
-
|
|
4717
|
-
|
|
5025
|
+
z19.object({
|
|
5026
|
+
type: z19.literal("response.reasoning_summary_text.delta"),
|
|
5027
|
+
item_id: z19.string(),
|
|
5028
|
+
summary_index: z19.number(),
|
|
5029
|
+
delta: z19.string()
|
|
4718
5030
|
}),
|
|
4719
|
-
|
|
4720
|
-
|
|
4721
|
-
|
|
4722
|
-
|
|
4723
|
-
})
|
|
4724
|
-
|
|
4725
|
-
|
|
4726
|
-
|
|
4727
|
-
|
|
4728
|
-
|
|
4729
|
-
|
|
4730
|
-
)
|
|
4731
|
-
|
|
4732
|
-
|
|
4733
|
-
|
|
4734
|
-
|
|
4735
|
-
|
|
4736
|
-
|
|
4737
|
-
|
|
4738
|
-
|
|
4739
|
-
|
|
4740
|
-
|
|
4741
|
-
}).
|
|
4742
|
-
|
|
4743
|
-
|
|
4744
|
-
|
|
4745
|
-
|
|
4746
|
-
|
|
4747
|
-
|
|
4748
|
-
|
|
4749
|
-
|
|
4750
|
-
content: z18.array(
|
|
4751
|
-
z18.object({
|
|
4752
|
-
type: z18.literal("output_text"),
|
|
4753
|
-
text: z18.string(),
|
|
4754
|
-
logprobs: z18.array(
|
|
4755
|
-
z18.object({
|
|
4756
|
-
token: z18.string(),
|
|
4757
|
-
logprob: z18.number(),
|
|
4758
|
-
top_logprobs: z18.array(
|
|
4759
|
-
z18.object({
|
|
4760
|
-
token: z18.string(),
|
|
4761
|
-
logprob: z18.number()
|
|
4762
|
-
})
|
|
4763
|
-
)
|
|
4764
|
-
})
|
|
4765
|
-
).nullish(),
|
|
4766
|
-
annotations: z18.array(
|
|
4767
|
-
z18.discriminatedUnion("type", [
|
|
4768
|
-
z18.object({
|
|
4769
|
-
type: z18.literal("url_citation"),
|
|
4770
|
-
start_index: z18.number(),
|
|
4771
|
-
end_index: z18.number(),
|
|
4772
|
-
url: z18.string(),
|
|
4773
|
-
title: z18.string()
|
|
4774
|
-
}),
|
|
4775
|
-
z18.object({
|
|
4776
|
-
type: z18.literal("file_citation"),
|
|
4777
|
-
file_id: z18.string(),
|
|
4778
|
-
filename: z18.string(),
|
|
4779
|
-
index: z18.number()
|
|
4780
|
-
}),
|
|
4781
|
-
z18.object({
|
|
4782
|
-
type: z18.literal("container_file_citation"),
|
|
4783
|
-
container_id: z18.string(),
|
|
4784
|
-
file_id: z18.string(),
|
|
4785
|
-
filename: z18.string(),
|
|
4786
|
-
start_index: z18.number(),
|
|
4787
|
-
end_index: z18.number()
|
|
4788
|
-
}),
|
|
4789
|
-
z18.object({
|
|
4790
|
-
type: z18.literal("file_path"),
|
|
4791
|
-
file_id: z18.string(),
|
|
4792
|
-
index: z18.number()
|
|
4793
|
-
})
|
|
4794
|
-
])
|
|
4795
|
-
)
|
|
4796
|
-
})
|
|
4797
|
-
)
|
|
4798
|
-
}),
|
|
4799
|
-
z18.object({
|
|
4800
|
-
type: z18.literal("web_search_call"),
|
|
4801
|
-
id: z18.string(),
|
|
4802
|
-
status: z18.string(),
|
|
4803
|
-
action: z18.discriminatedUnion("type", [
|
|
4804
|
-
z18.object({
|
|
4805
|
-
type: z18.literal("search"),
|
|
4806
|
-
query: z18.string().nullish(),
|
|
4807
|
-
queries: z18.array(z18.string()).nullish(),
|
|
4808
|
-
sources: z18.array(
|
|
4809
|
-
z18.discriminatedUnion("type", [
|
|
4810
|
-
z18.object({ type: z18.literal("url"), url: z18.string() }),
|
|
4811
|
-
z18.object({
|
|
4812
|
-
type: z18.literal("api"),
|
|
4813
|
-
name: z18.string()
|
|
4814
|
-
})
|
|
4815
|
-
])
|
|
4816
|
-
).nullish()
|
|
4817
|
-
}),
|
|
4818
|
-
z18.object({
|
|
4819
|
-
type: z18.literal("open_page"),
|
|
4820
|
-
url: z18.string().nullish()
|
|
4821
|
-
}),
|
|
4822
|
-
z18.object({
|
|
4823
|
-
type: z18.literal("find_in_page"),
|
|
4824
|
-
url: z18.string().nullish(),
|
|
4825
|
-
pattern: z18.string().nullish()
|
|
4826
|
-
})
|
|
4827
|
-
]).nullish()
|
|
4828
|
-
}),
|
|
4829
|
-
z18.object({
|
|
4830
|
-
type: z18.literal("file_search_call"),
|
|
4831
|
-
id: z18.string(),
|
|
4832
|
-
queries: z18.array(z18.string()),
|
|
4833
|
-
results: z18.array(
|
|
4834
|
-
z18.object({
|
|
4835
|
-
attributes: z18.record(
|
|
4836
|
-
z18.string(),
|
|
4837
|
-
z18.union([z18.string(), z18.number(), z18.boolean()])
|
|
4838
|
-
),
|
|
4839
|
-
file_id: z18.string(),
|
|
4840
|
-
filename: z18.string(),
|
|
4841
|
-
score: z18.number(),
|
|
4842
|
-
text: z18.string()
|
|
4843
|
-
})
|
|
4844
|
-
).nullish()
|
|
4845
|
-
}),
|
|
4846
|
-
z18.object({
|
|
4847
|
-
type: z18.literal("code_interpreter_call"),
|
|
4848
|
-
id: z18.string(),
|
|
4849
|
-
code: z18.string().nullable(),
|
|
4850
|
-
container_id: z18.string(),
|
|
4851
|
-
outputs: z18.array(
|
|
4852
|
-
z18.discriminatedUnion("type", [
|
|
4853
|
-
z18.object({ type: z18.literal("logs"), logs: z18.string() }),
|
|
4854
|
-
z18.object({ type: z18.literal("image"), url: z18.string() })
|
|
4855
|
-
])
|
|
4856
|
-
).nullable()
|
|
4857
|
-
}),
|
|
4858
|
-
z18.object({
|
|
4859
|
-
type: z18.literal("image_generation_call"),
|
|
4860
|
-
id: z18.string(),
|
|
4861
|
-
result: z18.string()
|
|
4862
|
-
}),
|
|
4863
|
-
openaiResponsesLocalShellCallSchema,
|
|
4864
|
-
z18.object({
|
|
4865
|
-
type: z18.literal("function_call"),
|
|
4866
|
-
call_id: z18.string(),
|
|
4867
|
-
name: z18.string(),
|
|
4868
|
-
arguments: z18.string(),
|
|
4869
|
-
id: z18.string(),
|
|
4870
|
-
async: z18.boolean().nullish(),
|
|
4871
|
-
namespace: z18.string().nullish()
|
|
4872
|
-
}),
|
|
4873
|
-
z18.object({
|
|
4874
|
-
type: z18.literal("custom_tool_call"),
|
|
4875
|
-
call_id: z18.string(),
|
|
4876
|
-
name: z18.string(),
|
|
4877
|
-
input: z18.string(),
|
|
4878
|
-
id: z18.string(),
|
|
4879
|
-
async: z18.boolean().nullish()
|
|
4880
|
-
}),
|
|
4881
|
-
z18.object({
|
|
4882
|
-
type: z18.literal("computer_call"),
|
|
4883
|
-
id: z18.string(),
|
|
4884
|
-
status: z18.string().optional()
|
|
4885
|
-
}),
|
|
4886
|
-
z18.object({
|
|
4887
|
-
type: z18.literal("reasoning"),
|
|
4888
|
-
id: z18.string(),
|
|
4889
|
-
encrypted_content: z18.string().nullish(),
|
|
4890
|
-
summary: z18.array(
|
|
4891
|
-
z18.object({
|
|
4892
|
-
type: z18.literal("summary_text"),
|
|
4893
|
-
text: z18.string()
|
|
4894
|
-
})
|
|
4895
|
-
)
|
|
4896
|
-
}),
|
|
4897
|
-
z18.object({
|
|
4898
|
-
type: z18.literal("mcp_call"),
|
|
4899
|
-
id: z18.string(),
|
|
4900
|
-
status: z18.string(),
|
|
4901
|
-
arguments: z18.string(),
|
|
4902
|
-
name: z18.string(),
|
|
4903
|
-
server_label: z18.string(),
|
|
4904
|
-
output: z18.string().nullish(),
|
|
4905
|
-
error: z18.union([
|
|
4906
|
-
z18.string(),
|
|
4907
|
-
z18.object({
|
|
4908
|
-
type: z18.string().optional(),
|
|
4909
|
-
code: z18.union([z18.number(), z18.string()]).optional(),
|
|
4910
|
-
message: z18.string().optional()
|
|
4911
|
-
}).loose()
|
|
4912
|
-
]).nullish(),
|
|
4913
|
-
approval_request_id: z18.string().nullish()
|
|
4914
|
-
}),
|
|
4915
|
-
z18.object({
|
|
4916
|
-
type: z18.literal("mcp_list_tools"),
|
|
4917
|
-
id: z18.string(),
|
|
4918
|
-
server_label: z18.string(),
|
|
4919
|
-
tools: z18.array(
|
|
4920
|
-
z18.object({
|
|
4921
|
-
name: z18.string(),
|
|
4922
|
-
description: z18.string().optional(),
|
|
4923
|
-
input_schema: z18.any(),
|
|
4924
|
-
annotations: z18.record(z18.string(), z18.unknown()).optional()
|
|
4925
|
-
})
|
|
4926
|
-
),
|
|
4927
|
-
error: z18.union([
|
|
4928
|
-
z18.string(),
|
|
4929
|
-
z18.object({
|
|
4930
|
-
type: z18.string().optional(),
|
|
4931
|
-
code: z18.union([z18.number(), z18.string()]).optional(),
|
|
4932
|
-
message: z18.string().optional()
|
|
4933
|
-
}).loose()
|
|
4934
|
-
]).optional()
|
|
4935
|
-
}),
|
|
4936
|
-
z18.object({
|
|
4937
|
-
type: z18.literal("mcp_approval_request"),
|
|
4938
|
-
id: z18.string(),
|
|
4939
|
-
server_label: z18.string(),
|
|
4940
|
-
name: z18.string(),
|
|
4941
|
-
arguments: z18.string(),
|
|
4942
|
-
approval_request_id: z18.string().optional()
|
|
4943
|
-
}),
|
|
4944
|
-
z18.object({
|
|
4945
|
-
type: z18.literal("apply_patch_call"),
|
|
4946
|
-
id: z18.string(),
|
|
4947
|
-
call_id: z18.string(),
|
|
4948
|
-
status: z18.enum(["in_progress", "completed"]),
|
|
4949
|
-
operation: z18.discriminatedUnion("type", [
|
|
4950
|
-
z18.object({
|
|
4951
|
-
type: z18.literal("create_file"),
|
|
4952
|
-
path: z18.string(),
|
|
4953
|
-
diff: z18.string()
|
|
4954
|
-
}),
|
|
4955
|
-
z18.object({
|
|
4956
|
-
type: z18.literal("delete_file"),
|
|
4957
|
-
path: z18.string()
|
|
4958
|
-
}),
|
|
4959
|
-
z18.object({
|
|
4960
|
-
type: z18.literal("update_file"),
|
|
4961
|
-
path: z18.string(),
|
|
4962
|
-
diff: z18.string()
|
|
4963
|
-
})
|
|
4964
|
-
])
|
|
4965
|
-
}),
|
|
4966
|
-
z18.object({
|
|
4967
|
-
type: z18.literal("shell_call"),
|
|
4968
|
-
id: z18.string(),
|
|
4969
|
-
call_id: z18.string(),
|
|
4970
|
-
status: z18.enum(["in_progress", "completed", "incomplete"]),
|
|
4971
|
-
action: z18.object({
|
|
4972
|
-
commands: z18.array(z18.string())
|
|
4973
|
-
})
|
|
4974
|
-
}),
|
|
4975
|
-
z18.object({
|
|
4976
|
-
type: z18.literal("shell_call_output"),
|
|
4977
|
-
id: z18.string(),
|
|
4978
|
-
call_id: z18.string(),
|
|
4979
|
-
status: z18.enum(["in_progress", "completed", "incomplete"]),
|
|
4980
|
-
output: z18.array(
|
|
4981
|
-
z18.object({
|
|
4982
|
-
stdout: z18.string(),
|
|
4983
|
-
stderr: z18.string(),
|
|
4984
|
-
outcome: z18.discriminatedUnion("type", [
|
|
4985
|
-
z18.object({ type: z18.literal("timeout") }),
|
|
4986
|
-
z18.object({
|
|
4987
|
-
type: z18.literal("exit"),
|
|
4988
|
-
exit_code: z18.number()
|
|
4989
|
-
})
|
|
4990
|
-
])
|
|
4991
|
-
})
|
|
4992
|
-
)
|
|
4993
|
-
}),
|
|
4994
|
-
z18.object({
|
|
4995
|
-
type: z18.literal("tool_search_call"),
|
|
4996
|
-
id: z18.string(),
|
|
4997
|
-
execution: z18.enum(["server", "client"]),
|
|
4998
|
-
call_id: z18.string().nullable(),
|
|
4999
|
-
status: z18.enum(["in_progress", "completed", "incomplete"]),
|
|
5000
|
-
arguments: z18.unknown()
|
|
5001
|
-
}),
|
|
5002
|
-
z18.object({
|
|
5003
|
-
type: z18.literal("tool_search_output"),
|
|
5004
|
-
id: z18.string(),
|
|
5005
|
-
execution: z18.enum(["server", "client"]),
|
|
5006
|
-
call_id: z18.string().nullable(),
|
|
5007
|
-
status: z18.enum(["in_progress", "completed", "incomplete"]),
|
|
5008
|
-
tools: z18.array(z18.record(z18.string(), jsonValueSchema.optional()))
|
|
5009
|
-
})
|
|
5010
|
-
])
|
|
5011
|
-
).optional(),
|
|
5012
|
-
service_tier: z18.string().nullish(),
|
|
5013
|
-
reasoning: z18.object({
|
|
5014
|
-
context: z18.string().nullish()
|
|
5015
|
-
}).nullish(),
|
|
5016
|
-
incomplete_details: z18.object({ reason: z18.string() }).nullish(),
|
|
5017
|
-
usage: openaiResponsesUsageSchema.nullish()
|
|
5018
|
-
})
|
|
5019
|
-
)
|
|
5020
|
-
);
|
|
5021
|
-
|
|
5022
|
-
// src/responses/openai-responses-options.ts
|
|
5023
|
-
import {
|
|
5024
|
-
lazySchema as lazySchema17,
|
|
5025
|
-
zodSchema as zodSchema17
|
|
5026
|
-
} from "@ai-sdk/provider-utils";
|
|
5027
|
-
import { z as z19 } from "zod/v4";
|
|
5028
|
-
var TOP_LOGPROBS_MAX = 20;
|
|
5029
|
-
var openaiResponsesReasoningModelIds = [
|
|
5030
|
-
"o1",
|
|
5031
|
-
"o1-2024-12-17",
|
|
5032
|
-
"o3",
|
|
5033
|
-
"o3-2025-04-16",
|
|
5034
|
-
"o3-mini",
|
|
5035
|
-
"o3-mini-2025-01-31",
|
|
5036
|
-
"o4-mini",
|
|
5037
|
-
"o4-mini-2025-04-16",
|
|
5038
|
-
"gpt-5",
|
|
5039
|
-
"gpt-5-2025-08-07",
|
|
5040
|
-
"gpt-5-codex",
|
|
5041
|
-
"gpt-5-mini",
|
|
5042
|
-
"gpt-5-mini-2025-08-07",
|
|
5043
|
-
"gpt-5-nano",
|
|
5044
|
-
"gpt-5-nano-2025-08-07",
|
|
5045
|
-
"gpt-5-pro",
|
|
5046
|
-
"gpt-5-pro-2025-10-06",
|
|
5047
|
-
"gpt-5.1",
|
|
5048
|
-
"gpt-5.1-chat-latest",
|
|
5049
|
-
"gpt-5.1-codex-mini",
|
|
5050
|
-
"gpt-5.1-codex",
|
|
5051
|
-
"gpt-5.1-codex-max",
|
|
5052
|
-
"gpt-5.2",
|
|
5053
|
-
"gpt-5.2-chat-latest",
|
|
5054
|
-
"gpt-5.2-pro",
|
|
5055
|
-
"gpt-5.2-codex",
|
|
5056
|
-
"gpt-5.3-chat-latest",
|
|
5057
|
-
"gpt-5.3-codex",
|
|
5058
|
-
"gpt-5.4",
|
|
5059
|
-
"gpt-5.4-2026-03-05",
|
|
5060
|
-
"gpt-5.4-mini",
|
|
5061
|
-
"gpt-5.4-mini-2026-03-17",
|
|
5062
|
-
"gpt-5.4-nano",
|
|
5063
|
-
"gpt-5.4-nano-2026-03-17",
|
|
5064
|
-
"gpt-5.4-pro",
|
|
5065
|
-
"gpt-5.4-pro-2026-03-05",
|
|
5066
|
-
"gpt-5.5",
|
|
5067
|
-
"gpt-5.5-2026-04-23",
|
|
5068
|
-
"gpt-5.6",
|
|
5069
|
-
"gpt-5.6-luna",
|
|
5070
|
-
"gpt-5.6-sol",
|
|
5071
|
-
"gpt-5.6-terra",
|
|
5072
|
-
"gpt-6-astra",
|
|
5073
|
-
"gpt-6-luna",
|
|
5074
|
-
"gpt-6-sol"
|
|
5075
|
-
];
|
|
5076
|
-
var openaiResponsesModelIds = [
|
|
5077
|
-
"gpt-4.1",
|
|
5078
|
-
"gpt-4.1-2025-04-14",
|
|
5079
|
-
"gpt-4.1-mini",
|
|
5080
|
-
"gpt-4.1-mini-2025-04-14",
|
|
5081
|
-
"gpt-4.1-nano",
|
|
5082
|
-
"gpt-4.1-nano-2025-04-14",
|
|
5083
|
-
"gpt-4o",
|
|
5084
|
-
"gpt-4o-2024-05-13",
|
|
5085
|
-
"gpt-4o-2024-08-06",
|
|
5086
|
-
"gpt-4o-2024-11-20",
|
|
5087
|
-
"gpt-4o-audio-preview",
|
|
5088
|
-
"gpt-4o-audio-preview-2024-12-17",
|
|
5089
|
-
"gpt-4o-search-preview",
|
|
5090
|
-
"gpt-4o-search-preview-2025-03-11",
|
|
5091
|
-
"gpt-4o-mini-search-preview",
|
|
5092
|
-
"gpt-4o-mini-search-preview-2025-03-11",
|
|
5093
|
-
"gpt-4o-mini",
|
|
5094
|
-
"gpt-4o-mini-2024-07-18",
|
|
5095
|
-
"gpt-3.5-turbo-0125",
|
|
5096
|
-
"gpt-3.5-turbo",
|
|
5097
|
-
"gpt-3.5-turbo-1106",
|
|
5098
|
-
"gpt-5-chat-latest",
|
|
5099
|
-
...openaiResponsesReasoningModelIds
|
|
5100
|
-
];
|
|
5101
|
-
var openaiLanguageModelResponsesOptionsSchema = lazySchema17(
|
|
5031
|
+
z19.object({
|
|
5032
|
+
type: z19.literal("response.reasoning_summary_part.done"),
|
|
5033
|
+
item_id: z19.string(),
|
|
5034
|
+
summary_index: z19.number()
|
|
5035
|
+
}),
|
|
5036
|
+
z19.object({
|
|
5037
|
+
type: z19.literal("response.apply_patch_call_operation_diff.delta"),
|
|
5038
|
+
item_id: z19.string(),
|
|
5039
|
+
output_index: z19.number(),
|
|
5040
|
+
delta: z19.string(),
|
|
5041
|
+
obfuscation: z19.string().nullish()
|
|
5042
|
+
}),
|
|
5043
|
+
z19.object({
|
|
5044
|
+
type: z19.literal("response.apply_patch_call_operation_diff.done"),
|
|
5045
|
+
item_id: z19.string(),
|
|
5046
|
+
output_index: z19.number(),
|
|
5047
|
+
diff: z19.string()
|
|
5048
|
+
}),
|
|
5049
|
+
openaiResponsesNestedErrorChunkSchema,
|
|
5050
|
+
openaiResponsesErrorChunkSchema,
|
|
5051
|
+
z19.object({ type: z19.string() }).loose().refine((value) => !isModeledOpenAIResponsesChunk(value), {
|
|
5052
|
+
message: "Known response chunk failed schema validation"
|
|
5053
|
+
}).transform((value) => ({
|
|
5054
|
+
type: "unknown_chunk",
|
|
5055
|
+
message: value.type
|
|
5056
|
+
}))
|
|
5057
|
+
// fallback for unknown chunks
|
|
5058
|
+
])
|
|
5059
|
+
)
|
|
5060
|
+
);
|
|
5061
|
+
var openaiResponsesResponseSchema = lazySchema17(
|
|
5102
5062
|
() => zodSchema17(
|
|
5103
5063
|
z19.object({
|
|
5104
|
-
|
|
5105
|
-
|
|
5106
|
-
|
|
5107
|
-
|
|
5108
|
-
|
|
5109
|
-
|
|
5110
|
-
|
|
5111
|
-
|
|
5112
|
-
|
|
5113
|
-
|
|
5114
|
-
|
|
5115
|
-
|
|
5116
|
-
|
|
5117
|
-
|
|
5118
|
-
|
|
5119
|
-
|
|
5120
|
-
|
|
5121
|
-
|
|
5122
|
-
|
|
5064
|
+
id: z19.string().optional(),
|
|
5065
|
+
created_at: z19.number().optional(),
|
|
5066
|
+
error: z19.object({
|
|
5067
|
+
message: z19.string(),
|
|
5068
|
+
type: z19.string(),
|
|
5069
|
+
param: z19.string().nullish(),
|
|
5070
|
+
code: z19.string()
|
|
5071
|
+
}).nullish(),
|
|
5072
|
+
model: z19.string().optional(),
|
|
5073
|
+
output: z19.array(
|
|
5074
|
+
z19.discriminatedUnion("type", [
|
|
5075
|
+
z19.object({
|
|
5076
|
+
type: z19.literal("message"),
|
|
5077
|
+
role: z19.literal("assistant"),
|
|
5078
|
+
id: z19.string(),
|
|
5079
|
+
phase: z19.enum(["commentary", "final_answer"]).nullish(),
|
|
5080
|
+
content: z19.array(
|
|
5081
|
+
z19.object({
|
|
5082
|
+
type: z19.literal("output_text"),
|
|
5083
|
+
text: z19.string(),
|
|
5084
|
+
logprobs: z19.array(
|
|
5085
|
+
z19.object({
|
|
5086
|
+
token: z19.string(),
|
|
5087
|
+
logprob: z19.number(),
|
|
5088
|
+
top_logprobs: z19.array(
|
|
5089
|
+
z19.object({
|
|
5090
|
+
token: z19.string(),
|
|
5091
|
+
logprob: z19.number()
|
|
5092
|
+
})
|
|
5093
|
+
)
|
|
5094
|
+
})
|
|
5095
|
+
).nullish(),
|
|
5096
|
+
annotations: z19.array(
|
|
5097
|
+
z19.discriminatedUnion("type", [
|
|
5098
|
+
z19.object({
|
|
5099
|
+
type: z19.literal("url_citation"),
|
|
5100
|
+
start_index: z19.number(),
|
|
5101
|
+
end_index: z19.number(),
|
|
5102
|
+
url: z19.string(),
|
|
5103
|
+
title: z19.string()
|
|
5104
|
+
}),
|
|
5105
|
+
z19.object({
|
|
5106
|
+
type: z19.literal("file_citation"),
|
|
5107
|
+
file_id: z19.string(),
|
|
5108
|
+
filename: z19.string(),
|
|
5109
|
+
index: z19.number()
|
|
5110
|
+
}),
|
|
5111
|
+
z19.object({
|
|
5112
|
+
type: z19.literal("container_file_citation"),
|
|
5113
|
+
container_id: z19.string(),
|
|
5114
|
+
file_id: z19.string(),
|
|
5115
|
+
filename: z19.string(),
|
|
5116
|
+
start_index: z19.number(),
|
|
5117
|
+
end_index: z19.number()
|
|
5118
|
+
}),
|
|
5119
|
+
z19.object({
|
|
5120
|
+
type: z19.literal("file_path"),
|
|
5121
|
+
file_id: z19.string(),
|
|
5122
|
+
index: z19.number()
|
|
5123
|
+
})
|
|
5124
|
+
])
|
|
5125
|
+
)
|
|
5126
|
+
})
|
|
5127
|
+
)
|
|
5128
|
+
}),
|
|
5129
|
+
z19.object({
|
|
5130
|
+
type: z19.literal("web_search_call"),
|
|
5131
|
+
id: z19.string(),
|
|
5132
|
+
status: z19.string(),
|
|
5133
|
+
action: z19.discriminatedUnion("type", [
|
|
5134
|
+
z19.object({
|
|
5135
|
+
type: z19.literal("search"),
|
|
5136
|
+
query: z19.string().nullish(),
|
|
5137
|
+
queries: z19.array(z19.string()).nullish(),
|
|
5138
|
+
sources: z19.array(
|
|
5139
|
+
z19.discriminatedUnion("type", [
|
|
5140
|
+
z19.object({ type: z19.literal("url"), url: z19.string() }),
|
|
5141
|
+
z19.object({
|
|
5142
|
+
type: z19.literal("api"),
|
|
5143
|
+
name: z19.string()
|
|
5144
|
+
})
|
|
5145
|
+
])
|
|
5146
|
+
).nullish()
|
|
5147
|
+
}),
|
|
5148
|
+
z19.object({
|
|
5149
|
+
type: z19.literal("open_page"),
|
|
5150
|
+
url: z19.string().nullish()
|
|
5151
|
+
}),
|
|
5152
|
+
z19.object({
|
|
5153
|
+
type: z19.literal("find_in_page"),
|
|
5154
|
+
url: z19.string().nullish(),
|
|
5155
|
+
pattern: z19.string().nullish()
|
|
5156
|
+
})
|
|
5157
|
+
]).nullish()
|
|
5158
|
+
}),
|
|
5159
|
+
z19.object({
|
|
5160
|
+
type: z19.literal("file_search_call"),
|
|
5161
|
+
id: z19.string(),
|
|
5162
|
+
queries: z19.array(z19.string()),
|
|
5163
|
+
results: z19.array(
|
|
5164
|
+
z19.object({
|
|
5165
|
+
attributes: z19.record(
|
|
5166
|
+
z19.string(),
|
|
5167
|
+
z19.union([z19.string(), z19.number(), z19.boolean()])
|
|
5168
|
+
),
|
|
5169
|
+
file_id: z19.string(),
|
|
5170
|
+
filename: z19.string(),
|
|
5171
|
+
score: z19.number(),
|
|
5172
|
+
text: z19.string()
|
|
5173
|
+
})
|
|
5174
|
+
).nullish()
|
|
5175
|
+
}),
|
|
5176
|
+
z19.object({
|
|
5177
|
+
type: z19.literal("code_interpreter_call"),
|
|
5178
|
+
id: z19.string(),
|
|
5179
|
+
code: z19.string().nullable(),
|
|
5180
|
+
container_id: z19.string(),
|
|
5181
|
+
outputs: z19.array(
|
|
5182
|
+
z19.discriminatedUnion("type", [
|
|
5183
|
+
z19.object({ type: z19.literal("logs"), logs: z19.string() }),
|
|
5184
|
+
z19.object({ type: z19.literal("image"), url: z19.string() })
|
|
5185
|
+
])
|
|
5186
|
+
).nullable()
|
|
5187
|
+
}),
|
|
5188
|
+
z19.object({
|
|
5189
|
+
type: z19.literal("image_generation_call"),
|
|
5190
|
+
id: z19.string(),
|
|
5191
|
+
result: z19.string()
|
|
5192
|
+
}),
|
|
5193
|
+
openaiResponsesLocalShellCallSchema,
|
|
5194
|
+
z19.object({
|
|
5195
|
+
type: z19.literal("function_call"),
|
|
5196
|
+
call_id: z19.string(),
|
|
5197
|
+
name: z19.string(),
|
|
5198
|
+
arguments: z19.string(),
|
|
5199
|
+
id: z19.string(),
|
|
5200
|
+
async: z19.boolean().nullish(),
|
|
5201
|
+
namespace: z19.string().nullish()
|
|
5202
|
+
}),
|
|
5203
|
+
z19.object({
|
|
5204
|
+
type: z19.literal("custom_tool_call"),
|
|
5205
|
+
call_id: z19.string(),
|
|
5206
|
+
name: z19.string(),
|
|
5207
|
+
input: z19.string(),
|
|
5208
|
+
id: z19.string(),
|
|
5209
|
+
async: z19.boolean().nullish()
|
|
5210
|
+
}),
|
|
5211
|
+
z19.object({
|
|
5212
|
+
type: z19.literal("computer_call"),
|
|
5213
|
+
id: z19.string(),
|
|
5214
|
+
status: z19.string().optional()
|
|
5215
|
+
}),
|
|
5216
|
+
z19.object({
|
|
5217
|
+
type: z19.literal("reasoning"),
|
|
5218
|
+
id: z19.string(),
|
|
5219
|
+
encrypted_content: z19.string().nullish(),
|
|
5220
|
+
summary: z19.array(
|
|
5221
|
+
z19.object({
|
|
5222
|
+
type: z19.literal("summary_text"),
|
|
5223
|
+
text: z19.string()
|
|
5224
|
+
})
|
|
5225
|
+
)
|
|
5226
|
+
}),
|
|
5227
|
+
z19.object({
|
|
5228
|
+
type: z19.literal("mcp_call"),
|
|
5229
|
+
id: z19.string(),
|
|
5230
|
+
status: z19.string(),
|
|
5231
|
+
arguments: z19.string(),
|
|
5232
|
+
name: z19.string(),
|
|
5233
|
+
server_label: z19.string(),
|
|
5234
|
+
output: z19.string().nullish(),
|
|
5235
|
+
error: z19.union([
|
|
5236
|
+
z19.string(),
|
|
5237
|
+
z19.object({
|
|
5238
|
+
type: z19.string().optional(),
|
|
5239
|
+
code: z19.union([z19.number(), z19.string()]).optional(),
|
|
5240
|
+
message: z19.string().optional()
|
|
5241
|
+
}).loose()
|
|
5242
|
+
]).nullish(),
|
|
5243
|
+
approval_request_id: z19.string().nullish()
|
|
5244
|
+
}),
|
|
5245
|
+
z19.object({
|
|
5246
|
+
type: z19.literal("mcp_list_tools"),
|
|
5247
|
+
id: z19.string(),
|
|
5248
|
+
server_label: z19.string(),
|
|
5249
|
+
tools: z19.array(
|
|
5250
|
+
z19.object({
|
|
5251
|
+
name: z19.string(),
|
|
5252
|
+
description: z19.string().optional(),
|
|
5253
|
+
input_schema: z19.any(),
|
|
5254
|
+
annotations: z19.record(z19.string(), z19.unknown()).optional()
|
|
5255
|
+
})
|
|
5256
|
+
),
|
|
5257
|
+
error: z19.union([
|
|
5258
|
+
z19.string(),
|
|
5259
|
+
z19.object({
|
|
5260
|
+
type: z19.string().optional(),
|
|
5261
|
+
code: z19.union([z19.number(), z19.string()]).optional(),
|
|
5262
|
+
message: z19.string().optional()
|
|
5263
|
+
}).loose()
|
|
5264
|
+
]).optional()
|
|
5265
|
+
}),
|
|
5266
|
+
z19.object({
|
|
5267
|
+
type: z19.literal("mcp_approval_request"),
|
|
5268
|
+
id: z19.string(),
|
|
5269
|
+
server_label: z19.string(),
|
|
5270
|
+
name: z19.string(),
|
|
5271
|
+
arguments: z19.string(),
|
|
5272
|
+
approval_request_id: z19.string().optional()
|
|
5273
|
+
}),
|
|
5274
|
+
z19.object({
|
|
5275
|
+
type: z19.literal("apply_patch_call"),
|
|
5276
|
+
id: z19.string(),
|
|
5277
|
+
call_id: z19.string(),
|
|
5278
|
+
status: z19.enum(["in_progress", "completed"]),
|
|
5279
|
+
operation: z19.discriminatedUnion("type", [
|
|
5280
|
+
z19.object({
|
|
5281
|
+
type: z19.literal("create_file"),
|
|
5282
|
+
path: z19.string(),
|
|
5283
|
+
diff: z19.string()
|
|
5284
|
+
}),
|
|
5285
|
+
z19.object({
|
|
5286
|
+
type: z19.literal("delete_file"),
|
|
5287
|
+
path: z19.string()
|
|
5288
|
+
}),
|
|
5289
|
+
z19.object({
|
|
5290
|
+
type: z19.literal("update_file"),
|
|
5291
|
+
path: z19.string(),
|
|
5292
|
+
diff: z19.string()
|
|
5293
|
+
})
|
|
5294
|
+
])
|
|
5295
|
+
}),
|
|
5296
|
+
z19.object({
|
|
5297
|
+
type: z19.literal("shell_call"),
|
|
5298
|
+
id: z19.string(),
|
|
5299
|
+
call_id: z19.string(),
|
|
5300
|
+
status: z19.enum(["in_progress", "completed", "incomplete"]),
|
|
5301
|
+
action: z19.object({
|
|
5302
|
+
commands: z19.array(z19.string())
|
|
5303
|
+
})
|
|
5304
|
+
}),
|
|
5305
|
+
z19.object({
|
|
5306
|
+
type: z19.literal("shell_call_output"),
|
|
5307
|
+
id: z19.string(),
|
|
5308
|
+
call_id: z19.string(),
|
|
5309
|
+
status: z19.enum(["in_progress", "completed", "incomplete"]),
|
|
5310
|
+
output: z19.array(
|
|
5311
|
+
z19.object({
|
|
5312
|
+
stdout: z19.string(),
|
|
5313
|
+
stderr: z19.string(),
|
|
5314
|
+
outcome: z19.discriminatedUnion("type", [
|
|
5315
|
+
z19.object({ type: z19.literal("timeout") }),
|
|
5316
|
+
z19.object({
|
|
5317
|
+
type: z19.literal("exit"),
|
|
5318
|
+
exit_code: z19.number()
|
|
5319
|
+
})
|
|
5320
|
+
])
|
|
5321
|
+
})
|
|
5322
|
+
)
|
|
5323
|
+
}),
|
|
5324
|
+
z19.object({
|
|
5325
|
+
type: z19.literal("tool_search_call"),
|
|
5326
|
+
id: z19.string(),
|
|
5327
|
+
execution: z19.enum(["server", "client"]),
|
|
5328
|
+
call_id: z19.string().nullable(),
|
|
5329
|
+
status: z19.enum(["in_progress", "completed", "incomplete"]),
|
|
5330
|
+
arguments: z19.unknown()
|
|
5331
|
+
}),
|
|
5332
|
+
z19.object({
|
|
5333
|
+
type: z19.literal("tool_search_output"),
|
|
5334
|
+
id: z19.string(),
|
|
5335
|
+
execution: z19.enum(["server", "client"]),
|
|
5336
|
+
call_id: z19.string().nullable(),
|
|
5337
|
+
status: z19.enum(["in_progress", "completed", "incomplete"]),
|
|
5338
|
+
tools: z19.array(z19.record(z19.string(), jsonValueSchema.optional()))
|
|
5339
|
+
})
|
|
5123
5340
|
])
|
|
5124
|
-
).
|
|
5125
|
-
|
|
5126
|
-
|
|
5127
|
-
|
|
5128
|
-
|
|
5129
|
-
|
|
5130
|
-
|
|
5131
|
-
/**
|
|
5132
|
-
* Return the log probabilities of the tokens. Including logprobs will increase
|
|
5133
|
-
* the response size and can slow down response times. However, it can
|
|
5134
|
-
* be useful to better understand how the model is behaving.
|
|
5135
|
-
*
|
|
5136
|
-
* Setting to true will return the log probabilities of the tokens that
|
|
5137
|
-
* were generated.
|
|
5138
|
-
*
|
|
5139
|
-
* Setting to a number will return the log probabilities of the top n
|
|
5140
|
-
* tokens that were generated.
|
|
5141
|
-
*
|
|
5142
|
-
* @see https://platform.openai.com/docs/api-reference/responses/create
|
|
5143
|
-
* @see https://cookbook.openai.com/examples/using_logprobs
|
|
5144
|
-
*/
|
|
5145
|
-
logprobs: z19.union([z19.boolean(), z19.number().min(1).max(TOP_LOGPROBS_MAX)]).optional(),
|
|
5146
|
-
/**
|
|
5147
|
-
* The maximum number of total calls to built-in tools that can be processed in a response.
|
|
5148
|
-
* This maximum number applies across all built-in tool calls, not per individual tool.
|
|
5149
|
-
* Any further attempts to call a tool by the model will be ignored.
|
|
5150
|
-
*/
|
|
5151
|
-
maxToolCalls: z19.number().nullish(),
|
|
5152
|
-
/**
|
|
5153
|
-
* Additional metadata to store with the generation.
|
|
5154
|
-
*/
|
|
5155
|
-
metadata: z19.any().nullish(),
|
|
5156
|
-
/**
|
|
5157
|
-
* Whether to use parallel tool calls. Defaults to `true`.
|
|
5158
|
-
*/
|
|
5159
|
-
parallelToolCalls: z19.boolean().nullish(),
|
|
5160
|
-
/**
|
|
5161
|
-
* The ID of the previous response. You can use it to continue a conversation.
|
|
5162
|
-
* Defaults to `undefined`.
|
|
5163
|
-
*/
|
|
5164
|
-
previousResponseId: z19.string().nullish(),
|
|
5165
|
-
/**
|
|
5166
|
-
* Sets a cache key to tie this prompt to cached prefixes for better caching performance.
|
|
5167
|
-
*/
|
|
5168
|
-
promptCacheKey: z19.string().nullish(),
|
|
5169
|
-
/**
|
|
5170
|
-
* Prompt cache behavior for GPT-5.6 and later models.
|
|
5171
|
-
* `mode` controls whether OpenAI also places an implicit breakpoint.
|
|
5172
|
-
* `ttl` sets the minimum cache lifetime and currently only supports 30 minutes.
|
|
5173
|
-
*/
|
|
5174
|
-
promptCacheOptions: z19.object({
|
|
5175
|
-
mode: z19.enum(["implicit", "explicit"]).optional(),
|
|
5176
|
-
ttl: z19.literal("30m").optional()
|
|
5177
|
-
}).optional(),
|
|
5178
|
-
/**
|
|
5179
|
-
* The retention policy for the prompt cache.
|
|
5180
|
-
* - 'in_memory': Default. Standard prompt caching behavior.
|
|
5181
|
-
* - '24h': Extended prompt caching that keeps cached prefixes active for up to 24 hours.
|
|
5182
|
-
* Available for models before GPT-5.6 that support extended caching.
|
|
5183
|
-
*
|
|
5184
|
-
* @deprecated For GPT-5.6 and later models, use `promptCacheOptions.ttl`.
|
|
5185
|
-
*
|
|
5186
|
-
* @default 'in_memory'
|
|
5187
|
-
*/
|
|
5188
|
-
promptCacheRetention: z19.enum(["in_memory", "24h"]).nullish(),
|
|
5189
|
-
/**
|
|
5190
|
-
* Reasoning effort for reasoning models. Defaults to `medium`. If you use
|
|
5191
|
-
* `providerOptions` to set the `reasoningEffort` option, this model setting will be ignored.
|
|
5192
|
-
* GPT-5.6 supports 'none' | 'low' | 'medium' | 'high' | 'xhigh' | 'max'.
|
|
5193
|
-
* GPT-6 and later models support 'low' | 'medium' | 'high' | 'xhigh' | 'max'.
|
|
5194
|
-
* Supported values vary by model.
|
|
5195
|
-
*/
|
|
5196
|
-
reasoningEffort: z19.string().nullish(),
|
|
5197
|
-
/**
|
|
5198
|
-
* Updates the reasoning effort for GPT-6 and later models starting with this response
|
|
5199
|
-
* without changing the request-level reasoning effort. This preserves the
|
|
5200
|
-
* request prefix for prompt caching.
|
|
5201
|
-
*
|
|
5202
|
-
* Only supported by GPT-6 and later models in standard, single-agent mode. Cannot be
|
|
5203
|
-
* combined with automatic truncation.
|
|
5204
|
-
*/
|
|
5205
|
-
reasoningEffortUpdate: z19.enum(["low", "medium", "high", "xhigh", "max"]).optional(),
|
|
5206
|
-
/**
|
|
5207
|
-
* Controls how much model work GPT-5.6 performs before returning a final answer.
|
|
5208
|
-
* `standard` is the default. `pro` increases quality, latency, and token usage.
|
|
5209
|
-
*/
|
|
5210
|
-
reasoningMode: z19.enum(["standard", "pro"]).optional(),
|
|
5211
|
-
/**
|
|
5212
|
-
* Controls which available reasoning items GPT-5.6 can use.
|
|
5213
|
-
* `auto` uses the model default, `current_turn` excludes reasoning from earlier
|
|
5214
|
-
* turns, and `all_turns` makes compatible earlier reasoning available.
|
|
5215
|
-
*/
|
|
5216
|
-
reasoningContext: z19.enum(["auto", "current_turn", "all_turns"]).optional(),
|
|
5217
|
-
/**
|
|
5218
|
-
* Controls reasoning summary output from the model.
|
|
5219
|
-
* Set to "auto" to automatically receive the richest level available,
|
|
5220
|
-
* or "detailed" for comprehensive summaries.
|
|
5221
|
-
*/
|
|
5222
|
-
reasoningSummary: z19.string().nullish(),
|
|
5223
|
-
/**
|
|
5224
|
-
* The identifier for safety monitoring and tracking.
|
|
5225
|
-
*/
|
|
5226
|
-
safetyIdentifier: z19.string().nullish(),
|
|
5227
|
-
/**
|
|
5228
|
-
* Service tier for the request.
|
|
5229
|
-
* Set to 'flex' for 50% cheaper processing at the cost of increased latency (available for o3, o4-mini, and gpt-5 models).
|
|
5230
|
-
* Set to 'priority' for faster processing with Enterprise access (available for gpt-4, gpt-5, gpt-5-mini, o3, o4-mini; gpt-5-nano is not supported).
|
|
5231
|
-
* Set to 'fast' for the same tier as 'priority' (OpenAI's newer name for it).
|
|
5232
|
-
*
|
|
5233
|
-
* Defaults to 'auto'.
|
|
5234
|
-
*/
|
|
5235
|
-
serviceTier: z19.enum(["auto", "flex", "priority", "fast", "default"]).nullish(),
|
|
5236
|
-
/**
|
|
5237
|
-
* Whether to store the generation. Defaults to `true`.
|
|
5238
|
-
*/
|
|
5239
|
-
store: z19.boolean().nullish(),
|
|
5240
|
-
/**
|
|
5241
|
-
* Whether to pass through non-image file types as generic input files.
|
|
5242
|
-
*
|
|
5243
|
-
* By default, inline file inputs are restricted to images and PDFs.
|
|
5244
|
-
* Enable this when the target OpenAI Responses model supports additional
|
|
5245
|
-
* file media types, such as text/csv.
|
|
5246
|
-
*/
|
|
5247
|
-
passThroughUnsupportedFiles: z19.boolean().optional(),
|
|
5248
|
-
/**
|
|
5249
|
-
* Whether to use strict JSON schema validation.
|
|
5250
|
-
* Defaults to `true`.
|
|
5251
|
-
*/
|
|
5252
|
-
strictJsonSchema: z19.boolean().nullish(),
|
|
5253
|
-
/**
|
|
5254
|
-
* Controls the verbosity of the model's responses. Lower values ('low') will result
|
|
5255
|
-
* in more concise responses, while higher values ('high') will result in more verbose responses.
|
|
5256
|
-
* Valid values: 'low', 'medium', 'high'.
|
|
5257
|
-
*/
|
|
5258
|
-
textVerbosity: z19.enum(["low", "medium", "high"]).nullish(),
|
|
5259
|
-
/**
|
|
5260
|
-
* Controls output truncation. 'auto' (default) performs truncation automatically;
|
|
5261
|
-
* 'disabled' turns truncation off.
|
|
5262
|
-
*/
|
|
5263
|
-
truncation: z19.enum(["auto", "disabled"]).nullish(),
|
|
5264
|
-
/**
|
|
5265
|
-
* A unique identifier representing your end-user, which can help OpenAI to
|
|
5266
|
-
* monitor and detect abuse.
|
|
5267
|
-
* Defaults to `undefined`.
|
|
5268
|
-
* @see https://platform.openai.com/docs/guides/safety-best-practices/end-user-ids
|
|
5269
|
-
*/
|
|
5270
|
-
user: z19.string().nullish(),
|
|
5271
|
-
/**
|
|
5272
|
-
* Override the system message mode for this model.
|
|
5273
|
-
* - 'system': Use the 'system' role for system messages (default for most models)
|
|
5274
|
-
* - 'developer': Use the 'developer' role for system messages (used by reasoning models)
|
|
5275
|
-
* - 'remove': Remove system messages entirely
|
|
5276
|
-
*
|
|
5277
|
-
* If not specified, the mode is automatically determined based on the model.
|
|
5278
|
-
*/
|
|
5279
|
-
systemMessageMode: z19.enum(["system", "developer", "remove"]).optional(),
|
|
5280
|
-
/**
|
|
5281
|
-
* Force treating this model as a reasoning model.
|
|
5282
|
-
*
|
|
5283
|
-
* This is useful for "stealth" reasoning models (e.g. via a custom baseURL)
|
|
5284
|
-
* where the model ID is not recognized by the SDK's allowlist.
|
|
5285
|
-
*
|
|
5286
|
-
* When enabled, the SDK applies reasoning-model parameter compatibility rules
|
|
5287
|
-
* and defaults `systemMessageMode` to `developer` unless overridden.
|
|
5288
|
-
*/
|
|
5289
|
-
forceReasoning: z19.boolean().optional(),
|
|
5290
|
-
/**
|
|
5291
|
-
* Restrict the callable tools to a subset while keeping the full tools
|
|
5292
|
-
* list intact, so prompt caching is preserved across requests with
|
|
5293
|
-
* different allowlists.
|
|
5294
|
-
*
|
|
5295
|
-
* When set, this overrides the request-level `toolChoice` and emits
|
|
5296
|
-
* `tool_choice: { type: "allowed_tools", mode, tools }` on the wire.
|
|
5297
|
-
*
|
|
5298
|
-
* @see https://developers.openai.com/api/reference/resources/responses/methods/create#(resource)%20responses%20%3E%20(model)%20tool_choice_allowed%20%3E%20(schema)
|
|
5299
|
-
*/
|
|
5300
|
-
allowedTools: z19.object({
|
|
5301
|
-
toolNames: z19.array(z19.string()).min(1),
|
|
5302
|
-
mode: z19.enum(["auto", "required"]).optional()
|
|
5303
|
-
}).optional()
|
|
5341
|
+
).optional(),
|
|
5342
|
+
service_tier: z19.string().nullish(),
|
|
5343
|
+
reasoning: z19.object({
|
|
5344
|
+
context: z19.string().nullish()
|
|
5345
|
+
}).nullish(),
|
|
5346
|
+
incomplete_details: z19.object({ reason: z19.string() }).nullish(),
|
|
5347
|
+
usage: openaiResponsesUsageSchema.nullish()
|
|
5304
5348
|
})
|
|
5305
5349
|
)
|
|
5306
5350
|
);
|
|
@@ -6158,6 +6202,18 @@ function extractApprovalRequestIdToToolCallIdMapping(prompt) {
|
|
|
6158
6202
|
}
|
|
6159
6203
|
return mapping;
|
|
6160
6204
|
}
|
|
6205
|
+
function getConfigurationUpdateUnsupportedReason({
|
|
6206
|
+
modelCapabilities,
|
|
6207
|
+
options
|
|
6208
|
+
}) {
|
|
6209
|
+
if (!modelCapabilities.supportsConfigurationUpdate) {
|
|
6210
|
+
return "reasoningEffortUpdate is only supported by GPT-6 and later models";
|
|
6211
|
+
}
|
|
6212
|
+
if ((options == null ? void 0 : options.reasoningMode) === "pro" || (options == null ? void 0 : options.truncation) === "auto") {
|
|
6213
|
+
return "reasoningEffortUpdate requires standard reasoning mode without automatic truncation";
|
|
6214
|
+
}
|
|
6215
|
+
return void 0;
|
|
6216
|
+
}
|
|
6161
6217
|
var OpenAIResponsesLanguageModel = class {
|
|
6162
6218
|
constructor(modelId, config) {
|
|
6163
6219
|
this.specificationVersion = "v3";
|
|
@@ -6265,8 +6321,13 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
6265
6321
|
customProviderToolNames,
|
|
6266
6322
|
supportsAsyncToolCalling: modelCapabilities.supportsAsyncToolCalling
|
|
6267
6323
|
});
|
|
6324
|
+
const configurationUpdateUnsupportedReason = getConfigurationUpdateUnsupportedReason({
|
|
6325
|
+
modelCapabilities,
|
|
6326
|
+
options: openaiOptions
|
|
6327
|
+
});
|
|
6268
6328
|
const { input, warnings: inputWarnings } = await convertToOpenAIResponsesInput({
|
|
6269
6329
|
prompt,
|
|
6330
|
+
configurationUpdateUnsupportedReason,
|
|
6270
6331
|
toolNameMapping,
|
|
6271
6332
|
systemMessageMode: (_c = openaiOptions == null ? void 0 : openaiOptions.systemMessageMode) != null ? _c : isReasoningModel ? "developer" : modelCapabilities.systemMessageMode,
|
|
6272
6333
|
providerOptionsName,
|
|
@@ -6284,18 +6345,27 @@ var OpenAIResponsesLanguageModel = class {
|
|
|
6284
6345
|
});
|
|
6285
6346
|
warnings.push(...inputWarnings);
|
|
6286
6347
|
const reasoningEffortUpdate = openaiOptions == null ? void 0 : openaiOptions.reasoningEffortUpdate;
|
|
6287
|
-
|
|
6288
|
-
if (reasoningEffortUpdate != null && !configurationUpdateIsSupported) {
|
|
6348
|
+
if (reasoningEffortUpdate != null && configurationUpdateUnsupportedReason != null) {
|
|
6289
6349
|
warnings.push({
|
|
6290
6350
|
type: "unsupported",
|
|
6291
6351
|
feature: "reasoningEffortUpdate",
|
|
6292
|
-
details:
|
|
6352
|
+
details: configurationUpdateUnsupportedReason
|
|
6293
6353
|
});
|
|
6294
6354
|
} else if (reasoningEffortUpdate != null) {
|
|
6295
|
-
input
|
|
6296
|
-
|
|
6297
|
-
|
|
6298
|
-
|
|
6355
|
+
const firstItem = input[0];
|
|
6356
|
+
if ((firstItem == null ? void 0 : firstItem.type) !== "configuration_update" || firstItem.reasoning.effort !== reasoningEffortUpdate) {
|
|
6357
|
+
input.unshift({
|
|
6358
|
+
type: "configuration_update",
|
|
6359
|
+
reasoning: { effort: reasoningEffortUpdate }
|
|
6360
|
+
});
|
|
6361
|
+
}
|
|
6362
|
+
}
|
|
6363
|
+
for (let i = 1; i < input.length; i++) {
|
|
6364
|
+
if (input[i - 1].type === "configuration_update" && input[i].type === "configuration_update") {
|
|
6365
|
+
throw new UnsupportedFunctionalityError6({
|
|
6366
|
+
functionality: "Adjacent reasoning effort configuration updates"
|
|
6367
|
+
});
|
|
6368
|
+
}
|
|
6299
6369
|
}
|
|
6300
6370
|
const strictJsonSchema = (_f = openaiOptions == null ? void 0 : openaiOptions.strictJsonSchema) != null ? _f : true;
|
|
6301
6371
|
let include = openaiOptions == null ? void 0 : openaiOptions.include;
|